summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-repeats-2.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-repeats-2.html
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-repeats-2.html')
-rw-r--r--testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-repeats-2.html36
1 files changed, 36 insertions, 0 deletions
diff --git a/testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-repeats-2.html b/testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-repeats-2.html
new file mode 100644
index 0000000000..74b14b8d8f
--- /dev/null
+++ b/testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-repeats-2.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Duplicate declarative shadow trees</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+
+<div id=multiple1>
+ <template shadowrootmode=open>1</template>
+ <template shadowrootmode=open>2</template>
+ <template shadowrootmode=open>3</template>
+</div>
+
+<div id=multiple2>
+ <template shadowrootmode=closed>1</template>
+ <template shadowrootmode=closed>2</template>
+ <template shadowrootmode=open>3</template>
+</div>
+
+<script>
+test((t) => {
+ t.add_cleanup(() => {
+ multiple1.remove();
+ multiple2.remove();
+ });
+ let shadow = multiple1.shadowRoot;
+ assert_true(!!shadow,'Remaining shadow root should be open');
+ assert_equals(shadow.textContent,"1");
+ assert_equals(multiple1.childElementCount, 2);
+ assert_equals(multiple1.firstElementChild.content.textContent, "2");
+ assert_equals(multiple1.lastElementChild.content.textContent, "3");
+ shadow = multiple2.shadowRoot;
+ assert_false(!!shadow,'Remaining shadow root should be closed');
+ assert_equals(multiple2.childElementCount, 2);
+ assert_equals(multiple2.firstElementChild.content.textContent, "2");
+ assert_equals(multiple2.lastElementChild.content.textContent, "3");
+},'Repeated declarative shadow roots keep only the first');
+</script>