diff --git a/components/layout_thread/dom_wrapper.rs b/components/layout_thread/dom_wrapper.rs index 5c9cf183053..db8d0ffc36d 100644 --- a/components/layout_thread/dom_wrapper.rs +++ b/components/layout_thread/dom_wrapper.rs @@ -368,7 +368,7 @@ impl<'ld> ServoLayoutDocument<'ld> { } pub fn style_shared_lock(&self) -> &StyleSharedRwLock { - unsafe { self.document.style_shared_lock() } + self.document.style_shared_lock() } pub fn shadow_roots(&self) -> Vec { diff --git a/components/layout_thread_2020/dom_wrapper.rs b/components/layout_thread_2020/dom_wrapper.rs index 0e527bd75d9..bd187482ee5 100644 --- a/components/layout_thread_2020/dom_wrapper.rs +++ b/components/layout_thread_2020/dom_wrapper.rs @@ -375,7 +375,7 @@ impl<'ld> ServoLayoutDocument<'ld> { } pub fn style_shared_lock(&self) -> &StyleSharedRwLock { - unsafe { self.document.style_shared_lock() } + self.document.style_shared_lock() } pub fn shadow_roots(&self) -> Vec { diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index c3c64babfef..afaf0a5292b 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -2610,7 +2610,7 @@ pub trait LayoutDocumentHelpers<'dom> { unsafe fn needs_paint_from_layout(self); unsafe fn will_paint(self); fn quirks_mode(self) -> QuirksMode; - unsafe fn style_shared_lock(self) -> &'dom StyleSharedRwLock; + fn style_shared_lock(self) -> &'dom StyleSharedRwLock; fn shadow_roots(self) -> Vec>; fn shadow_roots_styles_changed(self) -> bool; unsafe fn flush_shadow_roots_stylesheets(self); @@ -2639,8 +2639,8 @@ impl<'dom> LayoutDocumentHelpers<'dom> for LayoutDom<'dom, Document> { } #[inline] - unsafe fn style_shared_lock(self) -> &'dom StyleSharedRwLock { - (*self.unsafe_get()).style_shared_lock() + fn style_shared_lock(self) -> &'dom StyleSharedRwLock { + unsafe { self.unsafe_get().style_shared_lock() } } #[inline]