2 <script src=
"/resources/testharness.js"></script>
3 <script src=
"/resources/testharnessreport.js"></script>
5 <iframe srcdoc=
"Foo"></iframe>
7 const CHROME_ONLY_PROPERTIES
= [
8 "-moz-window-input-region-margin",
10 "-moz-window-opacity",
11 "-moz-window-transform",
12 "-moz-window-transform-origin",
13 "-moz-default-appearance",
17 const UA_ONLY_PROPERTIES
= [
21 "-moz-control-character-visibility",
27 "-moz-min-font-size-ratio",
28 // TODO: This should ideally be in CHROME_ONLY_PROPERTIES, but due to how
29 // [Pref] and [ChromeOnly] interact in WebIDL, the former wins.
30 "-moz-context-properties",
33 function testInWin(win
) {
34 const doc
= win
.document
;
35 const sheet
= doc
.createElement("style");
36 const div
= doc
.createElement("div");
37 doc
.documentElement
.appendChild(sheet
);
38 doc
.documentElement
.appendChild(div
);
40 sheet
.textContent
= `div { color: initial }`;
41 assert_equals(sheet
.sheet
.cssRules
[0].style
.length
, 1, `sanity: ${doc.documentURI}`);
43 for (const prop
of CHROME_ONLY_PROPERTIES
.concat(UA_ONLY_PROPERTIES
)) {
44 sheet
.textContent
= `div { ${prop}: initial }`;
45 let block
= sheet
.sheet
.cssRules
[0].style
;
46 assert_false(prop
in block
, `${prop} shouldn't be exposed in CSS2Properties`);
48 let isUAOnly
= UA_ONLY_PROPERTIES
.includes(prop
);
49 assert_equals(prop
in SpecialPowers
.wrap(block
), !isUAOnly
, `${prop} should be exposed to chrome code if needed`);
54 `${prop} shouldn't be parsed in ${doc.documentURI}`
56 block
.setProperty(prop
, "initial");
60 `${prop} shouldn't be settable via CSSOM in ${doc.documentURI}`
63 win
.getComputedStyle(div
).getPropertyValue(prop
),
65 `${prop} shouldn't be accessible via CSSOM in ${doc.documentURI}`
68 win
.CSS
.supports(prop
+ ': initial'),
69 `${prop} shouldn't be exposed in CSS.supports in ${doc.documentURI}`
72 win
.CSS
.supports(prop
, 'initial'),
73 `${prop} shouldn't be exposed in CSS.supports in ${doc.documentURI} (2-value version)`
78 let t
= async_test("test non-content-accessible props");
79 onload
= t
.step_func_done(function() {
81 for (let f
of document
.querySelectorAll("iframe")) {
82 testInWin(f
.contentWindow
);