diff --git a/html/semantics/scripting-1/the-script-element/css-module/css-module-parse-error.html b/html/semantics/scripting-1/the-script-element/css-module/css-module-parse-error.html new file mode 100644 index 00000000000000..0416254f688b88 --- /dev/null +++ b/html/semantics/scripting-1/the-script-element/css-module/css-module-parse-error.html @@ -0,0 +1,40 @@ + +CSS module import: parse errors produce empty stylesheet + + + + + + + diff --git a/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-disconnect-iframe.html b/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-disconnect-iframe.html index 9777fafb99e5a3..a6ba18f949bdc0 100644 --- a/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-disconnect-iframe.html +++ b/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-disconnect-iframe.html @@ -9,9 +9,10 @@ diff --git a/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-failure-shared.html b/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-failure-shared.html new file mode 100644 index 00000000000000..97f26c3f36070e --- /dev/null +++ b/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-failure-shared.html @@ -0,0 +1,78 @@ + +shadowrootadoptedstylesheets failed fetches are sticky across consumers + + + + + + + + diff --git a/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-failure.html b/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-failure.html index 35b13fb96b5601..7921d68394d741 100644 --- a/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-failure.html +++ b/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-failure.html @@ -6,44 +6,157 @@ + diff --git a/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-mutation-removed-still-updates.html b/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-mutation-removed-still-updates.html new file mode 100644 index 00000000000000..602978374f6e10 --- /dev/null +++ b/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-async-fetch-mutation-removed-still-updates.html @@ -0,0 +1,55 @@ + +shadowrootadoptedstylesheets mutation: removed sheet updated by fetch + + + + + + + + diff --git a/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-modulepreload-failure.html b/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-modulepreload-failure.html index 9fe536b4452d68..75553ab6803693 100644 --- a/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-modulepreload-failure.html +++ b/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-modulepreload-failure.html @@ -29,15 +29,12 @@ const { shadowRoot, testElement } = createStylesheetHost(badUrl); - // The module map should contain a failed entry, so the shadow root should - // still create a placeholder. - assert_equals(shadowRoot.adoptedStyleSheets.length, 1, - "After failed preload: expected 1 entry."); - assert_equals(shadowRoot.adoptedStyleSheets[0].cssRules.length, 0, - "After failed preload: sheet should be empty."); + // A failed CSS module fetch should not contribute an entry. + assert_equals(shadowRoot.adoptedStyleSheets.length, 0, + "After failed preload: no sheet should be added."); assert_equals(getComputedStyle(testElement).color, "rgb(0, 0, 0)", "No styles should be applied from a failed modulepreload."); - }, "Failed modulepreload (404) results in empty sheet for shadowrootadoptedstylesheets."); + }, "Failed modulepreload (404) is skipped by shadowrootadoptedstylesheets."); promise_test(async (t) => { // --- Scenario 2: mix of valid and invalid modulepreloads. --- @@ -53,13 +50,11 @@ const { shadowRoot: sr2, testElement: te2 } = createStylesheetHost( [badUrl2, goodUrl]); - assert_equals(sr2.adoptedStyleSheets.length, 2, - "Two entries should be present."); - assert_equals(sr2.adoptedStyleSheets[0].cssRules.length, 0, - "First entry (failed preload) should be empty."); - assertSheetRule(sr2, 1, "span { color: blue; }", "Second entry (valid)"); + assert_equals(sr2.adoptedStyleSheets.length, 1, + "Only the valid preload should contribute a sheet."); + assertSheetRule(sr2, 0, "span { color: blue; }", "Valid preload"); assert_equals(getComputedStyle(te2).color, "rgb(0, 0, 255)", "Blue styles from the valid preload should be applied."); - }, "Mixed valid/invalid modulepreloads: valid ones work, failed ones leave empty sheets."); + }, "Mixed valid/invalid modulepreloads: failed ones are skipped and valid ones work."); diff --git a/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-placeholder-identity.html b/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-placeholder-identity.html index ff53c051b355df..16c55fc37fd14e 100644 --- a/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-placeholder-identity.html +++ b/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-placeholder-identity.html @@ -8,15 +8,15 @@