mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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.
This commit is contained in:
parent
887cc62556
commit
e57d09abb8
3 changed files with 12 additions and 14 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue