layout/style/test/test_bug798843_pref.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4   Make sure that the SVG glyph context-* values are not considered real values
     5   when gfx.font_rendering.opentype_svg.enabled is pref'ed off.
     6 -->
     7 <head>
     8   <title>Test that SVG glyph context-* values can be pref'ed off</title>
     9   <script src="/tests/SimpleTest/SimpleTest.js"></script>
    10 </head>
    11 <body>
    13 <script>
    15 var props = {
    16   "fill" : "context-stroke none",
    17   "stroke" : "context-fill none",
    18   "fillOpacity" : "context-stroke-opacity",
    19   "strokeOpacity" : "context-fill-opacity",
    20   "strokeDasharray" : "context-value",
    21   "strokeDashoffset" : "context-value",
    22   "strokeWidth" : "context-value"
    23 };
    25 function testDisabled() {
    26   for (var p in props) {
    27     document.body.style[p] = props[p];
    28     is(document.body.style[p], "", p + " not settable to " + props[p]);
    29     document.body.style[p] = "";
    30   }
    31   SimpleTest.finish();
    32 }
    34 function testEnabled() {
    35   for (var p in props) {
    36     document.body.style[p] = props[p];
    37     is(document.body.style[p], props[p], p + " settable to " + props[p]);
    38     document.body.style[p] = "";
    39   }
    41   SpecialPowers.pushPrefEnv(
    42     {'set': [['gfx.font_rendering.opentype_svg.enabled', false]]},
    43     testDisabled
    44   );
    45 }
    47 SimpleTest.waitForExplicitFinish();
    49 SpecialPowers.pushPrefEnv(
    50   {'set': [['gfx.font_rendering.opentype_svg.enabled', true]]},
    51   testEnabled
    52 );
    54 </script>
    56 </body>
    57 </html>

mercurial