summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-scoping/css-scoping-shadow-host-namespace.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-scoping/css-scoping-shadow-host-namespace.html
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-scoping/css-scoping-shadow-host-namespace.html')
-rw-r--r--testing/web-platform/tests/css/css-scoping/css-scoping-shadow-host-namespace.html82
1 files changed, 82 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-scoping/css-scoping-shadow-host-namespace.html b/testing/web-platform/tests/css/css-scoping/css-scoping-shadow-host-namespace.html
new file mode 100644
index 0000000000..46dffc8de3
--- /dev/null
+++ b/testing/web-platform/tests/css/css-scoping/css-scoping-shadow-host-namespace.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS Scoping Module Level 1 - :host, :host-context, and default @namespace</title>
+ <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com"/>
+ <link rel="help" href="https://www.w3.org/TR/css-scoping-1/#host-selector">
+ <link rel="help" href="https://www.w3.org/TR/css3-selectors/#typenmsp">
+ <link rel="help" href="https://www.w3.org/TR/css3-selectors/#univnmsp">
+ <link rel="match" href="reference/green-box.html"/>
+</head>
+<body>
+ <style>
+ .host {
+ display: block;
+ width: 100px;
+ height: 10px;
+ background: red;
+ }
+ #host-3, #host-5, #host-10 {
+ background: green;
+ }
+ </style>
+ <p>Test passes if you see a single 100px by 100px green box below.</p>
+ <div id="host-1" class="host">FAIL</div>
+ <div id="host-2" class="host">FAIL</div>
+ <div id="host-3" class="host">FAIL</div>
+ <div id="host-4" class="host">FAIL</div>
+ <div id="host-5" class="host">FAIL</div>
+ <div id="host-6" class="host">FAIL</div>
+ <div id="host-7" class="host">FAIL</div>
+ <div id="host-8" class="host">FAIL</div>
+ <div id="host-9" class="host">FAIL</div>
+ <div id="host-10" class="host">FAIL</div>
+ <script>
+ try {
+ var shadowHost = document.querySelector('#host-1');
+ shadowRoot = shadowHost.attachShadow({mode: 'open'});
+ shadowRoot.innerHTML = '<style>@namespace url(http://www.w3.org/1999/xhtml); :host { background: green !important; } </style>';
+
+ shadowHost = document.querySelector('#host-2');
+ shadowRoot = shadowHost.attachShadow({mode: 'open'});
+ shadowRoot.innerHTML = '<style>@namespace url(http://dummy); :host { background: green !important; } </style>';
+
+ shadowHost = document.querySelector('#host-3');
+ shadowRoot = shadowHost.attachShadow({mode: 'open'});
+ shadowRoot.innerHTML = '<style>@namespace url(http://dummy); :host(*) { background: red !important; } </style>';
+
+ shadowHost = document.querySelector('#host-4');
+ shadowRoot = shadowHost.attachShadow({mode: 'open'});
+ shadowRoot.innerHTML = '<style>@namespace url(http://dummy); :host(*|*) { background: green !important; } </style>';
+
+ shadowHost = document.querySelector('#host-5');
+ shadowRoot = shadowHost.attachShadow({mode: 'open'});
+ shadowRoot.innerHTML = '<style>@namespace url(http://dummy); :host-context(*) { background: red !important; } </style>';
+
+ shadowHost = document.querySelector('#host-6');
+ shadowRoot = shadowHost.attachShadow({mode: 'open'});
+ shadowRoot.innerHTML = '<style>@namespace url(http://dummy); :host-context(*|*) { background: green !important; } </style>';
+
+ shadowHost = document.querySelector('#host-7');
+ shadowRoot = shadowHost.attachShadow({mode: 'open'});
+ shadowRoot.innerHTML = '<style>@namespace url(http://www.w3.org/1999/xhtml); :host(*) { background: green !important; } </style>';
+
+ shadowHost = document.querySelector('#host-8');
+ shadowRoot = shadowHost.attachShadow({mode: 'open'});
+ shadowRoot.innerHTML = '<style>@namespace url(http://www.w3.org/1999/xhtml); :host-context(*) { background: green !important; } </style>';
+
+ shadowHost = document.querySelector('#host-9');
+ shadowRoot = shadowHost.attachShadow({mode: 'open'});
+ shadowRoot.innerHTML = '<style>@namespace url(http://www.w3.org/1999/xhtml); :host(div) { background: green !important; } </style>';
+
+ shadowHost = document.querySelector('#host-10');
+ shadowRoot = shadowHost.attachShadow({mode: 'open'});
+ shadowRoot.innerHTML = '<style>@namespace url(http://dummy); :host-context(html) { background: red !important; } </style>';
+
+ } catch (exception) {
+ document.body.appendChild(document.createTextNode(exception));
+ }
+
+ </script>
+</body>
+</html>