aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread
diff options
context:
space:
mode:
authorAnthony Ramine <nox@nox.paris>2020-03-31 21:59:01 +0200
committerAnthony Ramine <nox@nox.paris>2020-03-31 22:04:35 +0200
commit9c8540af5c37c7df2d4c0dff27ca76e36a6e6c02 (patch)
tree8554bd7dd3b26ea5ade3d9231f4a0eb53e94a5f7 /components/layout_thread
parent414d477b5482e44b47ab8034b158b2ad2e92bf27 (diff)
downloadservo-9c8540af5c37c7df2d4c0dff27ca76e36a6e6c02.tar.gz
servo-9c8540af5c37c7df2d4c0dff27ca76e36a6e6c02.zip
Make layout methods accessing rare data be safe
They don't do anything fancy so there is no additional unsafety calling them compared to using LayoutDom in the first place, the usual story of all those changes.
Diffstat (limited to 'components/layout_thread')
-rw-r--r--components/layout_thread/dom_wrapper.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/components/layout_thread/dom_wrapper.rs b/components/layout_thread/dom_wrapper.rs
index 7d3ad1e5c5a..3ad5927c89b 100644
--- a/components/layout_thread/dom_wrapper.rs
+++ b/components/layout_thread/dom_wrapper.rs
@@ -649,21 +649,17 @@ impl<'le> TElement for ServoLayoutElement<'le> {
/// The shadow root this element is a host of.
fn shadow_root(&self) -> Option<ServoShadowRoot<'le>> {
- unsafe {
- self.element
- .get_shadow_root_for_layout()
- .map(ServoShadowRoot::from_layout_js)
- }
+ self.element
+ .get_shadow_root_for_layout()
+ .map(ServoShadowRoot::from_layout_js)
}
/// The shadow root which roots the subtree this element is contained in.
fn containing_shadow(&self) -> Option<ServoShadowRoot<'le>> {
- unsafe {
- self.element
- .upcast()
- .containing_shadow_root_for_layout()
- .map(ServoShadowRoot::from_layout_js)
- }
+ self.element
+ .upcast()
+ .containing_shadow_root_for_layout()
+ .map(ServoShadowRoot::from_layout_js)
}
fn local_name(&self) -> &LocalName {