From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../declarative/declarative-shadow-dom-basic.html | 43 ++++++++++++++++++ .../declarative-shadow-dom-repeats-2.html | 36 +++++++++++++++ .../declarative-shadow-dom-repeats.html | 53 ++++++++++++++-------- .../shadow-dom/declarative/gethtml.tentative.html | 25 +++++----- 4 files changed, 125 insertions(+), 32 deletions(-) create mode 100644 testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-repeats-2.html (limited to 'testing/web-platform/tests/shadow-dom/declarative') diff --git a/testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-basic.html b/testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-basic.html index 8bc6bec5f5..4f174b8e5f 100644 --- a/testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-basic.html +++ b/testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-basic.html @@ -54,6 +54,49 @@ test(() => { t.getAttribute('shadowrootmode', 'CLOSED'); }, 'Shadowrootmode reflection, setter'); +test(() => { + const t = document.createElement('template'); + t.setAttribute('shadowrootdelegatesfocus',''); + assert_equals(t.shadowRootDelegatesFocus,true,'The shadowRootDelegatesFocus IDL should reflect the content attribute'); + t.setAttribute('shadowrootdelegatesfocus','foobar'); + assert_equals(t.shadowRootDelegatesFocus,true,'The value doesn\'t matter'); + t.removeAttribute('shadowrootdelegatesfocus'); + assert_equals(t.shadowRootDelegatesFocus,false,'No shadowRootDelegatesFocus attribute maps to false'); +}, 'Shadowrootdelegatesfocus reflection'); + +test(() => { + const t = document.createElement('template'); + assert_equals(t.getAttribute('shadowrootdelegatesfocus'), null); + t.shadowRootDelegatesFocus = true; + assert_equals(t.getAttribute('shadowrootdelegatesfocus'), ''); + assert_equals(t.shadowRootDelegatesFocus, true); + t.shadowRootDelegatesFocus = false; + assert_equals(t.getAttribute('shadowrootdelegatesfocus'), null); + assert_equals(t.shadowRootDelegatesFocus, false); +}, 'Shadowrootdelegatesfocus reflection, setter'); + + +test(() => { + const t = document.createElement('template'); + t.setAttribute('shadowrootclonable',''); + assert_equals(t.shadowRootClonable,true,'The shadowRootClonable IDL should reflect the content attribute'); + t.setAttribute('shadowrootclonable','foobar'); + assert_equals(t.shadowRootClonable,true,'The value doesn\'t matter'); + t.removeAttribute('shadowrootclonable'); + assert_equals(t.shadowRootClonable,false,'No shadowRootClonable attribute maps to false'); +}, 'Shadowrootclonable reflection'); + +test(() => { + const t = document.createElement('template'); + assert_equals(t.getAttribute('shadowrootclonable'), null); + t.shadowRootClonable = true; + assert_equals(t.getAttribute('shadowrootclonable'), ''); + assert_equals(t.shadowRootClonable, true); + t.shadowRootClonable = false; + assert_equals(t.getAttribute('shadowrootclonable'), null); + assert_equals(t.shadowRootClonable, false); +}, 'Shadowrootclonable reflection, setter'); + test(() => { const div = document.createElement('div'); div.setHTMLUnsafe(` 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 @@ + +Duplicate declarative shadow trees + + + +
+ + + +
+ +
+ + + +
+ + diff --git a/testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-repeats.html b/testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-repeats.html index 69f5c0f077..9cee41f2f3 100644 --- a/testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-repeats.html +++ b/testing/web-platform/tests/shadow-dom/declarative/declarative-shadow-dom-repeats.html @@ -22,13 +22,19 @@ @@ -40,39 +46,48 @@ test((t) => { test((t) => { assert_throws_dom("NotSupportedError",() => { open1.attachShadow({mode: "closed"}); - },'Mismatched shadow root type should throw'); + },'Mismatched shadow root mode should throw'); const initialShadow = open1.shadowRoot; const shadow = open1.attachShadow({mode: "open"}); // Shouldn't throw assert_equals(shadow,initialShadow,'Same shadow should be returned'); assert_equals(shadow.textContent,'','Shadow should be empty'); -},'Calling attachShadow() on declarative shadow root must match type'); +},'Calling attachShadow() on declarative shadow root must match mode');
-