diff --git a/components/script/dom/shadowroot.rs b/components/script/dom/shadowroot.rs index 5e810c8b7cc..8a2c8f897b2 100644 --- a/components/script/dom/shadowroot.rs +++ b/components/script/dom/shadowroot.rs @@ -14,6 +14,7 @@ use script_bindings::script_runtime::JSContext; use servo_arc::Arc; use style::author_styles::AuthorStyles; use style::dom::TElement; +use style::invalidation::element::restyle_hints::RestyleHint; use style::shared_lock::SharedRwLockReadGuard; use style::stylesheets::Stylesheet; use style::stylist::{CascadeData, Stylist}; @@ -270,6 +271,11 @@ impl ShadowRoot { // Mark the host element dirty so a reflow will be performed. if let Some(host) = self.host.get() { host.upcast::().dirty(NodeDamage::Style); + + // Also mark the host element with `RestyleHint::restyle_subtree` so a reflow + // can traverse into the shadow tree. + let mut restyle = self.document.ensure_pending_restyle(&host); + restyle.hint.insert(RestyleHint::restyle_subtree()); } } diff --git a/tests/wpt/meta/css/cssom/CSSStyleSheet-constructable-baseURL.html.ini b/tests/wpt/meta/css/cssom/CSSStyleSheet-constructable-baseURL.html.ini index f9b211c4a49..a9bad39b1da 100644 --- a/tests/wpt/meta/css/cssom/CSSStyleSheet-constructable-baseURL.html.ini +++ b/tests/wpt/meta/css/cssom/CSSStyleSheet-constructable-baseURL.html.ini @@ -1,3 +1,9 @@ [CSSStyleSheet-constructable-baseURL.html] + [Constructing sheet with custom base URL ueses that URL for CSS rules] + expected: FAIL + + [Constructing sheet with relative URL adds to the constructor document's base URL] + expected: FAIL + [Constructing sheet with invalid base URL throws a NotAllowedError] expected: FAIL diff --git a/tests/wpt/meta/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html.ini b/tests/wpt/meta/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html.ini index ac116f45da3..7c72997bd6c 100644 --- a/tests/wpt/meta/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html.ini +++ b/tests/wpt/meta/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html.ini @@ -1,9 +1,3 @@ [CSSStyleSheet-constructable-disallow-import.tentative.html] - [@import rules are not parsed in CSSStyleSheet.replaceSync] - expected: FAIL - - [@import rules are not parsed in CSSStyleSheet.replace] - expected: FAIL - [@import rules should not trigger any loads.] expected: FAIL diff --git a/tests/wpt/meta/css/cssom/CSSStyleSheet-constructable.html.ini b/tests/wpt/meta/css/cssom/CSSStyleSheet-constructable.html.ini index 1fc25551ed3..0276919c8b3 100644 --- a/tests/wpt/meta/css/cssom/CSSStyleSheet-constructable.html.ini +++ b/tests/wpt/meta/css/cssom/CSSStyleSheet-constructable.html.ini @@ -14,9 +14,6 @@ [Constructed stylesheet can be used and modified in multiple TreeScopes] expected: FAIL - [CSSStyleSheet.replaceSync correctly updates the style of its adopters synchronously] - expected: FAIL - [Adopted sheets are ordered after non-adopted sheets in the shadow root] expected: FAIL