Invalidate and flush shadow tree stylesheets where needed

This commit is contained in:
Fernando Jiménez Moreno 2019-02-13 17:01:30 +01:00
parent 18c1b8f690
commit 519cc2c317
8 changed files with 115 additions and 25 deletions

View file

@ -2430,6 +2430,7 @@ pub trait LayoutDocumentHelpers {
unsafe fn will_paint(&self);
unsafe fn quirks_mode(&self) -> QuirksMode;
unsafe fn style_shared_lock(&self) -> &StyleSharedRwLock;
unsafe fn shadow_roots(&self) -> Vec<LayoutDom<ShadowRoot>>;
}
#[allow(unsafe_code)]
@ -2474,6 +2475,16 @@ impl LayoutDocumentHelpers for LayoutDom<Document> {
unsafe fn style_shared_lock(&self) -> &StyleSharedRwLock {
(*self.unsafe_get()).style_shared_lock()
}
#[inline]
unsafe fn shadow_roots(&self) -> Vec<LayoutDom<ShadowRoot>> {
(*self.unsafe_get())
.shadow_roots
.borrow_for_layout()
.iter()
.map(|sr| sr.to_layout())
.collect()
}
}
// https://html.spec.whatwg.org/multipage/#is-a-registrable-domain-suffix-of-or-is-equal-to