From 33d4396a500147c68a02652f3324d49b5b18e80d Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Sun, 29 Oct 2023 12:03:59 -0700 Subject: [PATCH 1/3] Declarative shadow trees: getInnerHTML() is non-standard Also test shadowRootMode setter. --- .../declarative/declarative-shadow-dom-basic.html | 10 ++++++++++ .../{getinnerhtml.html => getinnerhtml.tentative.html} | 0 shadow-dom/declarative/script-access.html | 1 - 3 files changed, 10 insertions(+), 1 deletion(-) rename shadow-dom/declarative/{getinnerhtml.html => getinnerhtml.tentative.html} (100%) diff --git a/shadow-dom/declarative/declarative-shadow-dom-basic.html b/shadow-dom/declarative/declarative-shadow-dom-basic.html index 6f3739b63ca43a..20ca34f6f3e259 100644 --- a/shadow-dom/declarative/declarative-shadow-dom-basic.html +++ b/shadow-dom/declarative/declarative-shadow-dom-basic.html @@ -44,6 +44,16 @@ assert_equals(t.shadowRootMode,'','No shadowrootmode attribute maps to empty string'); }, 'Shadowrootmode reflection'); +test(() => { + const t = document.createElement('template'); + t.shadowRootMode = 'blah'; + assert_equals(t.shadowRootMode, ''); + t.getAttribute('shadowrootmode', 'blah'); + t.shadowRootMode = 'CLOSED'; + assert_equals(t.shadowRootMode, 'closed'); + t.getAttribute('shadowrootmode', 'CLOSED'); +}, 'Shadowrootmode reflection, setter'); + test(() => { const div = document.createElement('div'); div.setHTMLUnsafe(` diff --git a/shadow-dom/declarative/getinnerhtml.html b/shadow-dom/declarative/getinnerhtml.tentative.html similarity index 100% rename from shadow-dom/declarative/getinnerhtml.html rename to shadow-dom/declarative/getinnerhtml.tentative.html diff --git a/shadow-dom/declarative/script-access.html b/shadow-dom/declarative/script-access.html index 6c927b1bd75258..7e1340d4777960 100644 --- a/shadow-dom/declarative/script-access.html +++ b/shadow-dom/declarative/script-access.html @@ -27,7 +27,6 @@ template.setAttribute('shadowrootmode','open'); assert_not_equals(template.content, null, 'Regular template should have content, even after adding shadowrootmode attribute'); assert_not_equals(template.innerHTML, "", 'Regular template should have innerHTML, even after adding shadowrootmode attribute'); - assert_not_equals(template.getInnerHTML({includeShadowRoots: true}), "", 'Regular template should have getInnerHTML(), even after adding shadowrootmode attribute'); break; default: assert_unreached('Unrecognized template'); From 2bb5cf23b5d88f6fc8e3731e152825fcc96ce92f Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Sun, 29 Oct 2023 12:55:28 -0700 Subject: [PATCH 2/3] includeShadowRoots is obsolete too --- shadow-dom/declarative/declarative-shadow-dom-opt-in.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadow-dom/declarative/declarative-shadow-dom-opt-in.html b/shadow-dom/declarative/declarative-shadow-dom-opt-in.html index 0a59768d22e04d..5ed95253012c36 100644 --- a/shadow-dom/declarative/declarative-shadow-dom-opt-in.html +++ b/shadow-dom/declarative/declarative-shadow-dom-opt-in.html @@ -101,7 +101,7 @@ fragment = parser.parseFromString(content, 'text/html', {includeShadowRoots: false}); assert_dsd(fragment.body,false); fragment = parser.parseFromString(content, 'text/html', {includeShadowRoots: true}); - assert_dsd(fragment.body,true); + assert_dsd(fragment.body,false); }, 'DOMParser'); test(() => { From 69669ecb4e75ba8c837ef431afba734e9fe48937 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 30 Oct 2023 09:07:46 -0700 Subject: [PATCH 3/3] update description --- shadow-dom/declarative/declarative-shadow-dom-opt-in.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadow-dom/declarative/declarative-shadow-dom-opt-in.html b/shadow-dom/declarative/declarative-shadow-dom-opt-in.html index 5ed95253012c36..670e5fd0901c32 100644 --- a/shadow-dom/declarative/declarative-shadow-dom-opt-in.html +++ b/shadow-dom/declarative/declarative-shadow-dom-opt-in.html @@ -102,7 +102,7 @@ assert_dsd(fragment.body,false); fragment = parser.parseFromString(content, 'text/html', {includeShadowRoots: true}); assert_dsd(fragment.body,false); -}, 'DOMParser'); +}, 'DOMParser (includingShadowRoots is historical)'); test(() => { const doc = document.implementation.createHTMLDocument('');