mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Fix errors
This commit is contained in:
parent
0854953e35
commit
466e895cdf
2 changed files with 36 additions and 28 deletions
|
@ -1203,7 +1203,7 @@ impl Document {
|
||||||
debug!("{}: at {:?}", mouse_event_type_string, client_point);
|
debug!("{}: at {:?}", mouse_event_type_string, client_point);
|
||||||
|
|
||||||
let el = node_address.and_then(|address| {
|
let el = node_address.and_then(|address| {
|
||||||
let node = unsafe { node::from_untrusted_node_address(js_runtime, address) };
|
let node = node::from_untrusted_node_address(js_runtime, address);
|
||||||
node.inclusive_ancestors(ShadowIncluding::No)
|
node.inclusive_ancestors(ShadowIncluding::No)
|
||||||
.filter_map(DomRoot::downcast::<Element>)
|
.filter_map(DomRoot::downcast::<Element>)
|
||||||
.next()
|
.next()
|
||||||
|
@ -1398,7 +1398,7 @@ impl Document {
|
||||||
pressed_mouse_buttons: u16,
|
pressed_mouse_buttons: u16,
|
||||||
) {
|
) {
|
||||||
let maybe_new_target = node_address.and_then(|address| {
|
let maybe_new_target = node_address.and_then(|address| {
|
||||||
let node = unsafe { node::from_untrusted_node_address(js_runtime, address) };
|
let node = node::from_untrusted_node_address(js_runtime, address);
|
||||||
node.inclusive_ancestors(ShadowIncluding::No)
|
node.inclusive_ancestors(ShadowIncluding::No)
|
||||||
.filter_map(DomRoot::downcast::<Element>)
|
.filter_map(DomRoot::downcast::<Element>)
|
||||||
.next()
|
.next()
|
||||||
|
@ -1573,7 +1573,7 @@ impl Document {
|
||||||
debug!("{}: at {:?}", wheel_event_type_string, client_point);
|
debug!("{}: at {:?}", wheel_event_type_string, client_point);
|
||||||
|
|
||||||
let el = node_address.and_then(|address| {
|
let el = node_address.and_then(|address| {
|
||||||
let node = unsafe { node::from_untrusted_node_address(js_runtime, address) };
|
let node = node::from_untrusted_node_address(js_runtime, address);
|
||||||
node.inclusive_ancestors(ShadowIncluding::No)
|
node.inclusive_ancestors(ShadowIncluding::No)
|
||||||
.filter_map(DomRoot::downcast::<Element>)
|
.filter_map(DomRoot::downcast::<Element>)
|
||||||
.next()
|
.next()
|
||||||
|
@ -1627,7 +1627,7 @@ impl Document {
|
||||||
};
|
};
|
||||||
|
|
||||||
let el = node_address.and_then(|address| {
|
let el = node_address.and_then(|address| {
|
||||||
let node = unsafe { node::from_untrusted_node_address(js_runtime, address) };
|
let node = node::from_untrusted_node_address(js_runtime, address);
|
||||||
node.inclusive_ancestors(ShadowIncluding::No)
|
node.inclusive_ancestors(ShadowIncluding::No)
|
||||||
.filter_map(DomRoot::downcast::<Element>)
|
.filter_map(DomRoot::downcast::<Element>)
|
||||||
.next()
|
.next()
|
||||||
|
|
|
@ -3525,13 +3525,15 @@ impl ScriptThread {
|
||||||
// Get the previous target temporarily
|
// Get the previous target temporarily
|
||||||
let prev_mouse_over_target = self.topmost_mouse_over_target.get();
|
let prev_mouse_over_target = self.topmost_mouse_over_target.get();
|
||||||
|
|
||||||
|
unsafe {
|
||||||
document.handle_mouse_move_event(
|
document.handle_mouse_move_event(
|
||||||
self.js_runtime.rt(),
|
self.js_runtime.rt(),
|
||||||
point,
|
point,
|
||||||
&self.topmost_mouse_over_target,
|
&self.topmost_mouse_over_target,
|
||||||
node_address,
|
node_address,
|
||||||
pressed_mouse_buttons,
|
pressed_mouse_buttons,
|
||||||
);
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// Short-circuit if nothing changed
|
// Short-circuit if nothing changed
|
||||||
if self.topmost_mouse_over_target.get() == prev_mouse_over_target {
|
if self.topmost_mouse_over_target.get() == prev_mouse_over_target {
|
||||||
|
@ -3650,6 +3652,7 @@ impl ScriptThread {
|
||||||
Some(document) => document,
|
Some(document) => document,
|
||||||
None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
|
None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
|
||||||
};
|
};
|
||||||
|
unsafe {
|
||||||
document.handle_mouse_event(
|
document.handle_mouse_event(
|
||||||
self.js_runtime.rt(),
|
self.js_runtime.rt(),
|
||||||
button,
|
button,
|
||||||
|
@ -3658,7 +3661,8 @@ impl ScriptThread {
|
||||||
node_address,
|
node_address,
|
||||||
point_in_node,
|
point_in_node,
|
||||||
pressed_mouse_buttons,
|
pressed_mouse_buttons,
|
||||||
);
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_touch_event(
|
fn handle_touch_event(
|
||||||
|
@ -3676,6 +3680,7 @@ impl ScriptThread {
|
||||||
return TouchEventResult::Processed(true);
|
return TouchEventResult::Processed(true);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
unsafe {
|
||||||
document.handle_touch_event(
|
document.handle_touch_event(
|
||||||
self.js_runtime.rt(),
|
self.js_runtime.rt(),
|
||||||
event_type,
|
event_type,
|
||||||
|
@ -3684,6 +3689,7 @@ impl ScriptThread {
|
||||||
node_address,
|
node_address,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn handle_wheel_event(
|
fn handle_wheel_event(
|
||||||
&self,
|
&self,
|
||||||
|
@ -3696,7 +3702,9 @@ impl ScriptThread {
|
||||||
Some(document) => document,
|
Some(document) => document,
|
||||||
None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
|
None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
|
||||||
};
|
};
|
||||||
document.handle_wheel_event(self.js_runtime.rt(), wheel_delta, point, node_address);
|
unsafe {
|
||||||
|
document.handle_wheel_event(self.js_runtime.rt(), wheel_delta, point, node_address)
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handle a "navigate an iframe" message from the constellation.
|
/// Handle a "navigate an iframe" message from the constellation.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue