diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 1488cdbd351..2b2613e0b6e 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -663,14 +663,8 @@ impl Document { has_dirty_descendants &= *ancestor != *new_dirty_root; } - let maybe_shadow_host = new_dirty_root - .downcast::() - .map(ShadowRootMethods::Host); - let new_dirty_root_element = new_dirty_root - .downcast::() - .or(maybe_shadow_host.as_deref()); - - self.dirty_root.set(new_dirty_root_element); + self.dirty_root + .set(Some(new_dirty_root.downcast::().unwrap())); } pub(crate) fn take_dirty_root(&self) -> Option> {