2 <script src=
"/resources/testharness.js"></script>
3 <script src=
"/resources/testharnessreport.js"></script>
5 <iframe srcdoc=
"Foo"></iframe>
7 const NON_CONTENT_ACCESSIBLE_PROPERTIES
= [
11 "-moz-window-input-region-margin",
13 "-moz-window-opacity",
14 "-moz-window-transform",
15 "-moz-window-transform-origin",
20 "-moz-font-smoothing-background-color",
21 "-moz-min-font-size-ratio",
22 "-moz-default-appearance",
24 "-moz-control-character-visibility",
25 "-moz-context-properties",
28 function testInWin(win
) {
29 const doc
= win
.document
;
30 const sheet
= doc
.createElement("style");
31 const div
= doc
.createElement("div");
32 doc
.documentElement
.appendChild(sheet
);
33 doc
.documentElement
.appendChild(div
);
35 sheet
.textContent
= `div { color: initial }`;
36 assert_equals(sheet
.sheet
.cssRules
[0].style
.length
, 1, `sanity: ${doc.documentURI}`);
38 for (const prop
of NON_CONTENT_ACCESSIBLE_PROPERTIES
) {
39 sheet
.textContent
= `div { ${prop}: initial }`;
40 let block
= sheet
.sheet
.cssRules
[0].style
;
44 `${prop} shouldn't be parsed in ${doc.documentURI}`
46 block
.setProperty(prop
, "initial");
50 `${prop} shouldn't be settable via CSSOM in ${doc.documentURI}`
53 win
.getComputedStyle(div
).getPropertyValue(prop
),
55 `${prop} shouldn't be accessible via CSSOM in ${doc.documentURI}`
58 win
.CSS
.supports(prop
+ ': initial'),
59 `${prop} shouldn't be exposed in CSS.supports in ${doc.documentURI}`
62 win
.CSS
.supports(prop
, 'initial'),
63 `${prop} shouldn't be exposed in CSS.supports in ${doc.documentURI} (2-value version)`
68 let t
= async_test("test non-content-accessible props");
69 onload
= t
.step_func_done(function() {
71 for (let f
of document
.querySelectorAll("iframe")) {
72 testInWin(f
.contentWindow
);