Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / layout / style / test / test_non_content_accessible_env_vars.html
blobf3fa474300e1190ebe7c29ee4fdccfda443fbd45
1 <!doctype html>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <iframe></iframe>
5 <iframe srcdoc="Foo"></iframe>
6 <script>
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)`);
23 assert_equals(
24 win.getComputedStyle(div).getPropertyValue("--foo"),
25 "FALLBACK_VALUE",
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() {
33 testInWin(window);
34 for (let f of document.querySelectorAll("iframe")) {
35 testInWin(f.contentWindow);
37 });
38 </script>