diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /testing/web-platform/tests/shadow-dom/declarative | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/shadow-dom/declarative')
-rw-r--r-- | testing/web-platform/tests/shadow-dom/declarative/WEB_FEATURES.yml | 3 | ||||
-rw-r--r-- | testing/web-platform/tests/shadow-dom/declarative/gethtml.html | 31 |
2 files changed, 12 insertions, 22 deletions
diff --git a/testing/web-platform/tests/shadow-dom/declarative/WEB_FEATURES.yml b/testing/web-platform/tests/shadow-dom/declarative/WEB_FEATURES.yml new file mode 100644 index 0000000000..4e31ed4962 --- /dev/null +++ b/testing/web-platform/tests/shadow-dom/declarative/WEB_FEATURES.yml @@ -0,0 +1,3 @@ +features: +- name: declarative-shadow-dom + files: "**" diff --git a/testing/web-platform/tests/shadow-dom/declarative/gethtml.html b/testing/web-platform/tests/shadow-dom/declarative/gethtml.html index d950ca7734..ff70653477 100644 --- a/testing/web-platform/tests/shadow-dom/declarative/gethtml.html +++ b/testing/web-platform/tests/shadow-dom/declarative/gethtml.html @@ -29,7 +29,6 @@ function testElementType(allowsShadowDom, elementType, runGetHTMLOnShadowRoot, } let shadowRoot; - const isOpen = mode === 'open'; let initDict = {mode: mode, delegatesFocus: delegatesFocus, clonable}; let expectedSerializable = null; switch (serializable) { @@ -47,12 +46,8 @@ function testElementType(allowsShadowDom, elementType, runGetHTMLOnShadowRoot, `shadowrootmode=${mode}${delegatesAttr}${serializableAttr}` + `${clonableAttr}>`; wrapper.setHTMLUnsafe(html); - if (isOpen) { - shadowRoot = wrapper.firstElementChild.shadowRoot; - } else { - // For closed shadow root, we rely on the behavior of attachShadow to return it to us - shadowRoot = wrapper.firstElementChild.attachShadow(initDict); - } + // Get hold of the declarative shadow root in a way that works when its mode is "closed" + shadowRoot = wrapper.firstElementChild.attachShadow(initDict); } else { // Imperative shadow dom const element = document.createElement(elementType); @@ -78,22 +73,14 @@ function testElementType(allowsShadowDom, elementType, runGetHTMLOnShadowRoot, assert_equals(shadowRoot.clonable,clonable); shadowRoot.appendChild(document.createElement('slot')); const emptyElement = `<${elementType}>${lightDOMContent}</${elementType}>`; - if (isOpen) { - if (expectedSerializable) { - assert_equals(wrapper.getHTML({serializableShadowRoots: true}), - correctHtml); - assert_equals(wrapper.firstElementChild.getHTML({ - serializableShadowRoots: true}), - `${correctShadowHtml}${lightDOMContent}`); - } else { - assert_equals(wrapper.getHTML({serializableShadowRoots: true}), emptyElement); - } - } else { - // Closed shadow roots should not be returned unless shadowRoots specifically contains the shadow root: + if (expectedSerializable) { assert_equals(wrapper.getHTML({serializableShadowRoots: true}), - emptyElement); - assert_equals(wrapper.getHTML({serializableShadowRoots: true, - shadowRoots: []}), emptyElement); + correctHtml); + assert_equals(wrapper.firstElementChild.getHTML({ + serializableShadowRoots: true}), + `${correctShadowHtml}${lightDOMContent}`); + } else { + assert_equals(wrapper.getHTML({serializableShadowRoots: true}), emptyElement); } // If we provide the shadow root, serialize it, regardless of serializableShadowRoots. assert_equals(wrapper.getHTML({serializableShadowRoots: true, shadowRoots: |