diff options
author | Anthony Ramine <nox@nox.paris> | 2020-04-01 11:35:07 +0200 |
---|---|---|
committer | Anthony Ramine <nox@nox.paris> | 2020-04-01 11:40:56 +0200 |
commit | d9e4f7a0ba3f5853174d1aa0185932de9cb5ae06 (patch) | |
tree | 8c8e31d12678a36e692b3271025984614fd1a3aa /components/script/dom/node.rs | |
parent | 28e5abe60667653464336ce04a274a907c807d83 (diff) | |
download | servo-d9e4f7a0ba3f5853174d1aa0185932de9cb5ae06.tar.gz servo-d9e4f7a0ba3f5853174d1aa0185932de9cb5ae06.zip |
Introduce more layout helpers to make selection_for_layout be safe
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index b7215cfd92b..1a889ae0ac1 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -1478,14 +1478,13 @@ impl<'dom> LayoutNodeHelpers<'dom> for LayoutDom<'dom, Node> { panic!("not text!") } - #[allow(unsafe_code)] fn selection(self) -> Option<Range<usize>> { if let Some(area) = self.downcast::<HTMLTextAreaElement>() { - return unsafe { area.selection_for_layout() }; + return area.selection_for_layout(); } if let Some(input) = self.downcast::<HTMLInputElement>() { - return unsafe { input.selection_for_layout() }; + return input.selection_for_layout(); } None |