diff options
author | bors-servo <servo-ops@mozilla.com> | 2020-03-30 10:56:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-30 10:56:35 -0400 |
commit | 236762880c48263f8fa2c5a4deb9cf8f7746013c (patch) | |
tree | b651381f3a88b9a46c56018946377bd8b879e737 /components/script/dom/document.rs | |
parent | fd6f9140f79a855b9db5fe4e305f8ca8b6c1a84f (diff) | |
parent | 02fb5a68e6285d86c0a091e4c6ac36a7d436d3f1 (diff) | |
download | servo-236762880c48263f8fa2c5a4deb9cf8f7746013c.tar.gz servo-236762880c48263f8fa2c5a4deb9cf8f7746013c.zip |
Auto merge of #26058 - servo:layout-2020-improvements, r=SimonSapin
Make many improvements to the layout/script comms story
Now `LayoutDom<'dom, T>` is a mere wrapper around a `&'dom T`.
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index f119429e01f..1e60b3b79fc 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -2605,46 +2605,46 @@ pub enum DocumentSource { } #[allow(unsafe_code)] -pub trait LayoutDocumentHelpers { - unsafe fn is_html_document_for_layout(&self) -> bool; - unsafe fn needs_paint_from_layout(&self); - 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>>; - unsafe fn shadow_roots_styles_changed(&self) -> bool; - unsafe fn flush_shadow_roots_stylesheets(&self); +pub trait LayoutDocumentHelpers<'dom> { + unsafe fn is_html_document_for_layout(self) -> bool; + unsafe fn needs_paint_from_layout(self); + unsafe fn will_paint(self); + unsafe fn quirks_mode(self) -> QuirksMode; + unsafe fn style_shared_lock(self) -> &'dom StyleSharedRwLock; + unsafe fn shadow_roots(self) -> Vec<LayoutDom<'dom, ShadowRoot>>; + unsafe fn shadow_roots_styles_changed(self) -> bool; + unsafe fn flush_shadow_roots_stylesheets(self); } #[allow(unsafe_code)] -impl LayoutDocumentHelpers for LayoutDom<'_, Document> { +impl<'dom> LayoutDocumentHelpers<'dom> for LayoutDom<'dom, Document> { #[inline] - unsafe fn is_html_document_for_layout(&self) -> bool { + unsafe fn is_html_document_for_layout(self) -> bool { (*self.unsafe_get()).is_html_document } #[inline] - unsafe fn needs_paint_from_layout(&self) { + unsafe fn needs_paint_from_layout(self) { (*self.unsafe_get()).needs_paint.set(true) } #[inline] - unsafe fn will_paint(&self) { + unsafe fn will_paint(self) { (*self.unsafe_get()).needs_paint.set(false) } #[inline] - unsafe fn quirks_mode(&self) -> QuirksMode { + unsafe fn quirks_mode(self) -> QuirksMode { (*self.unsafe_get()).quirks_mode() } #[inline] - unsafe fn style_shared_lock(&self) -> &StyleSharedRwLock { + unsafe fn style_shared_lock(self) -> &'dom StyleSharedRwLock { (*self.unsafe_get()).style_shared_lock() } #[inline] - unsafe fn shadow_roots(&self) -> Vec<LayoutDom<ShadowRoot>> { + unsafe fn shadow_roots(self) -> Vec<LayoutDom<'dom, ShadowRoot>> { (*self.unsafe_get()) .shadow_roots .borrow_for_layout() @@ -2654,12 +2654,12 @@ impl LayoutDocumentHelpers for LayoutDom<'_, Document> { } #[inline] - unsafe fn shadow_roots_styles_changed(&self) -> bool { + unsafe fn shadow_roots_styles_changed(self) -> bool { (*self.unsafe_get()).shadow_roots_styles_changed() } #[inline] - unsafe fn flush_shadow_roots_stylesheets(&self) { + unsafe fn flush_shadow_roots_stylesheets(self) { (*self.unsafe_get()).flush_shadow_roots_stylesheets() } } |