test_bug798843_pref.html (1189B)
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> 12 13 <script> 14 15 var props = { 16 "strokeDasharray" : "context-value", 17 "strokeDashoffset" : "context-value", 18 "strokeWidth" : "context-value" 19 }; 20 21 function testDisabled() { 22 for (var p in props) { 23 document.body.style[p] = props[p]; 24 is(document.body.style[p], "", p + " not settable to " + props[p]); 25 document.body.style[p] = ""; 26 } 27 SimpleTest.finish(); 28 } 29 30 function testEnabled() { 31 for (var p in props) { 32 document.body.style[p] = props[p]; 33 is(document.body.style[p], props[p], p + " settable to " + props[p]); 34 document.body.style[p] = ""; 35 } 36 37 SpecialPowers.pushPrefEnv( 38 {'set': [['gfx.font_rendering.opentype_svg.enabled', false]]}, 39 testDisabled 40 ); 41 } 42 43 SimpleTest.waitForExplicitFinish(); 44 45 SpecialPowers.pushPrefEnv( 46 {'set': [['gfx.font_rendering.opentype_svg.enabled', true]]}, 47 testEnabled 48 ); 49 50 </script> 51 52 </body> 53 </html>