diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2019-01-14 12:27:27 +0100 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2019-01-14 16:51:26 +0100 |
commit | e57d09abb83b26f4471477653819f3a1637c04aa (patch) | |
tree | 1d7e4a6a3beca09ae6a4fe60b5a2fc6d44c0e062 /components/script/script_thread.rs | |
parent | 887cc6255684864c1c5e282c30743f7126b346a1 (diff) | |
download | servo-e57d09abb83b26f4471477653819f3a1637c04aa.tar.gz servo-e57d09abb83b26f4471477653819f3a1637c04aa.zip |
Make Window::scroll_offsets store keys as OpaqueNode values
This is the type that is supposed to signal that we will never ever
try to get back a Node from it in an unsafe way, unlike
UntrustedNodeAddress.
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 99965a521a6..48dad65a725 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -146,6 +146,7 @@ use std::result::Result; use std::sync::Arc; use std::thread; use std::time::{Duration, SystemTime}; +use style::dom::OpaqueNode; use style::thread_state::{self, ThreadState}; use time::{at_utc, get_time, precise_time_ns, Timespec}; use url::percent_encoding::percent_decode; @@ -1914,7 +1915,7 @@ impl ScriptThread { if node_address == UntrustedNodeAddress(ptr::null()) { window.update_viewport_for_scroll(-scroll_offset.x, -scroll_offset.y); } else { - scroll_offsets.insert(node_address, -*scroll_offset); + scroll_offsets.insert(OpaqueNode(node_address.0 as usize), -*scroll_offset); } } window.set_scroll_offsets(scroll_offsets) |