1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/style/test/test_bug798843_pref.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,57 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 + Make sure that the SVG glyph context-* values are not considered real values 1.8 + when gfx.font_rendering.opentype_svg.enabled is pref'ed off. 1.9 +--> 1.10 +<head> 1.11 + <title>Test that SVG glyph context-* values can be pref'ed off</title> 1.12 + <script src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 +</head> 1.14 +<body> 1.15 + 1.16 +<script> 1.17 + 1.18 +var props = { 1.19 + "fill" : "context-stroke none", 1.20 + "stroke" : "context-fill none", 1.21 + "fillOpacity" : "context-stroke-opacity", 1.22 + "strokeOpacity" : "context-fill-opacity", 1.23 + "strokeDasharray" : "context-value", 1.24 + "strokeDashoffset" : "context-value", 1.25 + "strokeWidth" : "context-value" 1.26 +}; 1.27 + 1.28 +function testDisabled() { 1.29 + for (var p in props) { 1.30 + document.body.style[p] = props[p]; 1.31 + is(document.body.style[p], "", p + " not settable to " + props[p]); 1.32 + document.body.style[p] = ""; 1.33 + } 1.34 + SimpleTest.finish(); 1.35 +} 1.36 + 1.37 +function testEnabled() { 1.38 + for (var p in props) { 1.39 + document.body.style[p] = props[p]; 1.40 + is(document.body.style[p], props[p], p + " settable to " + props[p]); 1.41 + document.body.style[p] = ""; 1.42 + } 1.43 + 1.44 + SpecialPowers.pushPrefEnv( 1.45 + {'set': [['gfx.font_rendering.opentype_svg.enabled', false]]}, 1.46 + testDisabled 1.47 + ); 1.48 +} 1.49 + 1.50 +SimpleTest.waitForExplicitFinish(); 1.51 + 1.52 +SpecialPowers.pushPrefEnv( 1.53 + {'set': [['gfx.font_rendering.opentype_svg.enabled', true]]}, 1.54 + testEnabled 1.55 +); 1.56 + 1.57 +</script> 1.58 + 1.59 +</body> 1.60 +</html>