diff options
author | Anthony Ramine <nox@nox.paris> | 2020-03-31 21:59:01 +0200 |
---|---|---|
committer | Anthony Ramine <nox@nox.paris> | 2020-03-31 22:04:35 +0200 |
commit | 9c8540af5c37c7df2d4c0dff27ca76e36a6e6c02 (patch) | |
tree | 8554bd7dd3b26ea5ade3d9231f4a0eb53e94a5f7 /components/layout_thread/dom_wrapper.rs | |
parent | 414d477b5482e44b47ab8034b158b2ad2e92bf27 (diff) | |
download | servo-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/dom_wrapper.rs')
-rw-r--r-- | components/layout_thread/dom_wrapper.rs | 18 |
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 { |