2 <script src=
"/resources/testharness.js"></script>
3 <script src=
"/resources/testharnessreport.js"></script>
5 <iframe srcdoc=
"Foo"></iframe>
7 const NON_CONTENT_ACCESSIBLE_ENV_VARS
= [
8 "-moz-gtk-csd-titlebar-radius",
9 "-moz-gtk-csd-minimize-button-position",
10 "-moz-gtk-csd-maximize-button-position",
11 "-moz-gtk-csd-close-button-position",
12 "-moz-content-preferred-color-scheme",
13 "scrollbar-inline-size",
16 function testInWin(win
) {
17 let doc
= win
.document
;
18 const div
= doc
.createElement("div");
19 doc
.documentElement
.appendChild(div
);
20 for (const envVar
of NON_CONTENT_ACCESSIBLE_ENV_VARS
) {
21 div
.style
.setProperty("--foo", `env(${envVar},FALLBACK_VALUE)`);
24 win
.getComputedStyle(div
).getPropertyValue("--foo"),
26 `${envVar} shouldn't be exposed to content in ${doc.documentURI}`
31 let t
= async_test("Test non-content-accessible env() vars");
32 onload
= t
.step_func_done(function() {
34 for (let f
of document
.querySelectorAll("iframe")) {
35 testInWin(f
.contentWindow
);