Bug 798843 - Test to check that context-* attribute values are not valid when gfx.font-rendering.opentype_svg.enabled pref is false r=dbaron

This commit is contained in:
Edwin Flores 2013-05-16 14:35:15 +12:00
Родитель 8a4ca2262b
Коммит 5f11a4ac73
2 изменённых файлов: 51 добавлений и 0 удалений

Просмотреть файл

@ -84,6 +84,7 @@ MOCHITEST_FILES = test_acid3_test46.html \
test_bug716226.html \
test_bug765590.html \
test_bug798567.html \
test_bug798843_pref.html \
test_cascade.html \
test_ch_ex_no_infloops.html \
test_compute_data_with_start_struct.html \

Просмотреть файл

@ -0,0 +1,50 @@
<!DOCTYPE HTML>
<html>
<!--
Make sure that the SVG glyph context-* values are not considered real values
when gfx.font_rendering.opentype_svg.enabled is pref'ed off.
-->
<head>
<title>Test that SVG glyph context-* values can be pref'ed off</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
</head>
<body>
<script>
var props = {
"fill" : "context-stroke none",
"stroke" : "context-fill none",
"fillOpacity" : "context-stroke-opacity",
"strokeOpacity" : "context-fill-opacity",
"strokeDasharray" : "context-value",
"strokeDashoffset" : "context-value",
"strokeWidth" : "context-value"
};
var origPref = SpecialPowers.getBoolPref("gfx.font_rendering.opentype_svg.enabled");
SpecialPowers.setBoolPref("gfx.font_rendering.opentype_svg.enabled", true);
for (var prop in props) {
document.body.style[prop] = props[prop];
is(document.body.style[prop], props[prop],
prop + " settable to " + props[prop]);
document.body.style[prop] = "";
}
SpecialPowers.setBoolPref("gfx.font_rendering.opentype_svg.enabled", false);
for (var prop in props) {
document.body.style[prop] = props[prop];
is(document.body.style[prop], "",
prop + " not settable to " + props[prop]);
document.body.style[prop] = "";
}
SpecialPowers.setBoolPref("gfx.font_rendering.opentype_svg.enabled", origPref);
</script>
</body>
</html>