diff --git a/testing/web-platform/tests/scroll-animations/css/scroll-timeline-name-shadow.html b/testing/web-platform/tests/scroll-animations/css/scroll-timeline-name-shadow.html index c21fe1fa116df..6867f1eafbb13 100644 --- a/testing/web-platform/tests/scroll-animations/css/scroll-timeline-name-shadow.html +++ b/testing/web-platform/tests/scroll-animations/css/scroll-timeline-name-shadow.html @@ -315,6 +315,7 @@ shadowrootmode = open +shadowrootclonable > < style @@ -525,6 +526,7 @@ shadowrootmode = open +shadowrootclonable > < style @@ -748,6 +750,7 @@ shadowrootmode = open +shadowrootclonable > < style @@ -1036,6 +1039,7 @@ shadowrootmode = open +shadowrootclonable > < style diff --git a/testing/web-platform/tests/scroll-animations/css/view-timeline-name-shadow.html b/testing/web-platform/tests/scroll-animations/css/view-timeline-name-shadow.html index 30263eb569744..e6ce45cc3eddc 100644 --- a/testing/web-platform/tests/scroll-animations/css/view-timeline-name-shadow.html +++ b/testing/web-platform/tests/scroll-animations/css/view-timeline-name-shadow.html @@ -317,6 +317,7 @@ shadowrootmode = open +shadowrootclonable > < style @@ -520,6 +521,7 @@ shadowrootmode = open +shadowrootclonable > < style @@ -737,6 +739,7 @@ shadowrootmode = open +shadowrootclonable > < style @@ -1013,6 +1016,7 @@ shadowrootmode = open +shadowrootclonable > < style 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 72bb982e3f402..ccdba577a1ad7 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 @@ -1439,6 +1439,186 @@ ' ) ; +test +( +( +) += +> +{ +const +div += +document +. +createElement +( +' +div +' +) +; +div +. +setHTMLUnsafe +( +< +div +id += +" +host +" +> +< +template +shadowrootmode += +" +open +" +shadowrootclonable +> +< +/ +template +> +< +/ +div +> +) +; +var +host += +div +. +querySelector +( +' +# +host +' +) +; +assert_true +( +! +! +host +. +shadowRoot +" +No +shadow +root +found +" +) +; +assert_true +( +host +. +shadowRoot +. +clonable +" +clonable +should +be +true +" +) +; +div +. +setHTMLUnsafe +( +< +div +id += +" +host +" +> +< +template +shadowrootmode += +" +open +" +> +< +/ +template +> +< +/ +div +> +) +; +host += +div +. +querySelector +( +' +# +host +' +) +; +assert_true +( +! +! +host +. +shadowRoot +" +No +shadow +root +found +" +) +; +assert_false +( +host +. +shadowRoot +. +clonable +" +clonable +should +be +false +without +the +shadowrootclonable +attribute +" +) +; +} +' +Declarative +Shadow +DOM +: +clonable +attribute +' +) +; < / script @@ -1531,8 +1711,9 @@ ' ) ; -assert_equals -( +const +leftover += host . querySelector @@ -1541,15 +1722,57 @@ template ' ) -null -" -No +; +assert_true +( +! +! leftover +" +The +second +( +duplicate +) template -nodes -from -either -root +should +be +left +in +the +DOM +" +) +; +assert_true +( +leftover +instanceof +HTMLTemplateElement +) +; +assert_equals +( +leftover +. +getAttribute +( +' +shadowrootmode +' +) +" +closed +" +) +; +assert_equals +( +leftover +. +shadowRootMode +" +closed " ) ; @@ -1595,14 +1818,14 @@ textContent ' root -2 +1 ' " Content should come from -last +first declarative shadow root @@ -1649,6 +1872,7 @@ shadowrootmode = open +shadowrootclonable > Content < @@ -2043,6 +2267,10 @@ declarative shadow root +( +with +shadowrootclonable +) ' ) ; @@ -2092,6 +2320,7 @@ shadowrootmode = open +shadowrootclonable > Content < @@ -2287,6 +2516,7 @@ shadowrootmode = open +shadowrootclonable > Content < @@ -2473,6 +2703,7 @@ shadowrootmode = open +shadowrootclonable > < video 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 9bac3c1d31b94..67f72a703e51b 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 @@ -503,6 +503,7 @@ = open shadowrootdelegatesfocus +shadowrootclonable > Open delegates @@ -512,19 +513,18 @@ the default ) -named -slot -assignment +clonable ( +not the default ) -clonable +named +slot +assignment ( the default -for -declarative ) < / @@ -680,40 +680,6 @@ ' ) ; -/ -/ -See -https -: -/ -/ -github -. -com -/ -whatwg -/ -html -/ -issues -/ -10107 -: -the -behavior -of -the -/ -/ -clonable -flag -is -still -being -discussed -. -/ -/ assert_throws_dom ( " @@ -724,8 +690,6 @@ = > { -/ -/ open2 . attachShadow @@ -750,8 +714,6 @@ } ) ; -/ -/ } ' Mismatched diff --git a/testing/web-platform/tests/shadow-dom/declarative/gethtml.tentative.html b/testing/web-platform/tests/shadow-dom/declarative/gethtml.tentative.html index 43c2906ee5fa7..f1d3dacd6c759 100644 --- a/testing/web-platform/tests/shadow-dom/declarative/gethtml.tentative.html +++ b/testing/web-platform/tests/shadow-dom/declarative/gethtml.tentative.html @@ -131,6 +131,7 @@ mode delegatesFocus serializable +clonable ) { const @@ -295,6 +296,7 @@ delegatesFocus : delegatesFocus +clonable } ; let @@ -390,6 +392,21 @@ ' ' ; +const +clonableAttr += +clonable +? +' +shadowrootclonable += +" +" +' +: +' +' +; if ( allowsShadowDom @@ -419,6 +436,9 @@ { serializableAttr } +{ +clonableAttr +} > ; wrapper @@ -549,6 +569,9 @@ { serializableAttr } +{ +clonableAttr +} > < slot @@ -604,6 +627,14 @@ expectedSerializable ) ; +assert_equals +( +shadowRoot +. +clonable +clonable +) +; shadowRoot . appendChild @@ -998,6 +1029,11 @@ { serializable } +clonable += +{ +clonable +} . : ' @@ -1101,6 +1137,17 @@ for ( const +clonable +of +[ +false +true +] +) +{ +for +( +const mode of [ @@ -1138,6 +1185,7 @@ mode delegatesFocus serializable +clonable ) ; } @@ -1145,6 +1193,7 @@ } } } +} else { testElementType diff --git a/testing/web-platform/tests/shadow-dom/shadow-root-clonable.html b/testing/web-platform/tests/shadow-dom/shadow-root-clonable.html index 1acea8bd59736..5bcf65e12a009 100644 --- a/testing/web-platform/tests/shadow-dom/shadow-root-clonable.html +++ b/testing/web-platform/tests/shadow-dom/shadow-root-clonable.html @@ -584,7 +584,7 @@ root ) ; -assert_true +assert_false ( root . @@ -592,6 +592,9 @@ " clonable is +* +not +* automatically true for @@ -623,6 +626,135 @@ assert_true ( ! +clonedRoot +' +no +shadow +root +gets +cloned +' +) +; +} +" +declarative +shadow +roots +do +* +not +* +get +clonable +: +true +automatically +" +) +; +test +( +( +) += +> +{ +const +div += +document +. +createElement +( +" +div +" +) +; +div +. +setHTMLUnsafe +( +' +< +div +> +< +template +shadowrootmode += +open +shadowrootclonable +> +< +input +> +< +/ +template +> +< +/ +div +> +' +) +; +const +root += +div +. +firstElementChild +. +shadowRoot +; +assert_true +( +! +! +root +) +; +assert_true +( +root +. +clonable +" +clonable +gets +added +when +shadowrootclonable +is +present +" +) +; +const +clone += +div +. +cloneNode +( +true +) +; +const +clonedRoot += +clone +. +firstElementChild +. +shadowRoot +; +assert_true +( +! ! clonedRoot ) @@ -665,11 +797,13 @@ declarative shadow roots -get +can +opt +in +to clonable -: -true -automatically +with +shadowrootclonable " ) ; @@ -791,41 +925,14 @@ assert_true ( ! -! -clonedRoot -) -; -assert_equals -( -clonedRoot -. -children -. -length -1 -" -children -count -" -) -; -assert_equals -( clonedRoot -. -children -[ -0 -] -. -localName -" -input -" -" -children -content -" +' +no +shadow +root +gets +cloned +' ) ; } @@ -835,7 +942,10 @@ roots inside templates -also +do +* +not +* get cloned automatically