2017-11-22 12:54:28 +03:00
|
|
|
<!doctype html>
|
|
|
|
<script src="/resources/testharness.js"></script>
|
|
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
|
|
<style id="sheet"></style>
|
|
|
|
<div></div>
|
|
|
|
<script>
|
|
|
|
const NON_CONTENT_ACCESSIBLE_PROPERTIES = [
|
|
|
|
"-x-span",
|
|
|
|
"-x-lang",
|
|
|
|
"-x-text-zoom",
|
2019-03-25 01:13:52 +03:00
|
|
|
"-moz-list-reversed",
|
2017-11-22 12:54:28 +03:00
|
|
|
"-moz-window-shadow",
|
2018-06-01 17:36:54 +03:00
|
|
|
"-moz-window-opacity",
|
|
|
|
"-moz-window-transform",
|
|
|
|
"-moz-window-transform-origin",
|
2017-11-22 12:54:28 +03:00
|
|
|
"-moz-top-layer",
|
|
|
|
"-moz-script-size-multiplier",
|
|
|
|
"-moz-script-level",
|
|
|
|
"-moz-math-display",
|
|
|
|
"-moz-math-variant",
|
|
|
|
"-moz-script-min-size",
|
|
|
|
"-moz-font-smoothing-background-color",
|
|
|
|
"-moz-min-font-size-ratio",
|
|
|
|
"-moz-script-size-multiplier",
|
2019-01-30 23:55:54 +03:00
|
|
|
// TODO(emilio): Whenever we stop using `-moz-binding` in a gazillion tests
|
|
|
|
// we should add it here.
|
2017-11-22 12:54:28 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
const sheet = document.getElementById("sheet");
|
|
|
|
const div = document.querySelector("div");
|
|
|
|
|
|
|
|
test(function() {
|
|
|
|
sheet.textContent = `div { color: initial }`;
|
|
|
|
assert_equals(sheet.sheet.cssRules[0].style.length, 1);
|
|
|
|
}, "sanity");
|
|
|
|
|
|
|
|
for (const prop of NON_CONTENT_ACCESSIBLE_PROPERTIES) {
|
|
|
|
test(function() {
|
|
|
|
sheet.textContent = `div { ${prop}: initial }`;
|
|
|
|
let block = sheet.sheet.cssRules[0].style;
|
|
|
|
assert_equals(
|
|
|
|
block.length,
|
|
|
|
0,
|
|
|
|
prop + " shouldn't be parsed in content"
|
|
|
|
);
|
|
|
|
block.setProperty(prop, "initial");
|
|
|
|
assert_equals(
|
|
|
|
block.length,
|
|
|
|
0,
|
|
|
|
prop + " shouldn't be settable via CSSOM in content"
|
|
|
|
);
|
|
|
|
assert_equals(
|
|
|
|
getComputedStyle(div).getPropertyValue(prop),
|
|
|
|
"",
|
|
|
|
prop + " shouldn't be accessible via CSSOM in content"
|
|
|
|
);
|
|
|
|
}, prop);
|
|
|
|
}
|
|
|
|
</script>
|