mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
fmt
This commit is contained in:
parent
ff767b13a9
commit
217147b2e4
4 changed files with 6 additions and 19 deletions
|
@ -122,7 +122,7 @@ use euclid::default::{Point2D, Rect, Size2D};
|
|||
use html5ever::{LocalName, Namespace, QualName};
|
||||
use hyper_serde::Serde;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use js::jsapi::{JSObject};
|
||||
use js::jsapi::JSObject;
|
||||
use keyboard_types::{Code, Key, KeyState};
|
||||
use metrics::{
|
||||
InteractiveFlag, InteractiveMetrics, InteractiveWindow, ProfilerMetadataFactory,
|
||||
|
|
|
@ -170,9 +170,7 @@ impl DocumentOrShadowRoot {
|
|||
let mut elements: Vec<DomRoot<Element>> = nodes
|
||||
.iter()
|
||||
.flat_map(|&untrusted_node_address| {
|
||||
let node = unsafe {
|
||||
node::from_untrusted_node_address(untrusted_node_address)
|
||||
};
|
||||
let node = unsafe { node::from_untrusted_node_address(untrusted_node_address) };
|
||||
DomRoot::downcast::<Element>(node)
|
||||
})
|
||||
.collect();
|
||||
|
|
|
@ -69,7 +69,7 @@ use devtools_traits::NodeInfo;
|
|||
use dom_struct::dom_struct;
|
||||
use euclid::default::{Point2D, Rect, Size2D, Vector2D};
|
||||
use html5ever::{Namespace, Prefix, QualName};
|
||||
use js::jsapi::{JSObject};
|
||||
use js::jsapi::JSObject;
|
||||
use libc::{self, c_void, uintptr_t};
|
||||
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
|
||||
use msg::constellation_msg::{BrowsingContextId, PipelineId};
|
||||
|
@ -1321,9 +1321,7 @@ where
|
|||
/// If the given untrusted node address represents a valid DOM node in the given runtime,
|
||||
/// returns it.
|
||||
#[allow(unsafe_code)]
|
||||
pub unsafe fn from_untrusted_node_address(
|
||||
candidate: UntrustedNodeAddress,
|
||||
) -> DomRoot<Node> {
|
||||
pub unsafe fn from_untrusted_node_address(candidate: UntrustedNodeAddress) -> DomRoot<Node> {
|
||||
// https://github.com/servo/servo/issues/6383
|
||||
let candidate: uintptr_t = mem::transmute(candidate.0);
|
||||
// let object: *mut JSObject = jsfriendapi::bindgen::JS_GetAddressableObject(runtime,
|
||||
|
|
|
@ -3678,14 +3678,7 @@ impl ScriptThread {
|
|||
return TouchEventResult::Processed(true);
|
||||
},
|
||||
};
|
||||
unsafe {
|
||||
document.handle_touch_event(
|
||||
event_type,
|
||||
identifier,
|
||||
point,
|
||||
node_address,
|
||||
)
|
||||
}
|
||||
unsafe { document.handle_touch_event(event_type, identifier, point, node_address) }
|
||||
}
|
||||
|
||||
fn handle_wheel_event(
|
||||
|
@ -3699,9 +3692,7 @@ impl ScriptThread {
|
|||
Some(document) => document,
|
||||
None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
|
||||
};
|
||||
unsafe {
|
||||
document.handle_wheel_event(wheel_delta, point, node_address)
|
||||
};
|
||||
unsafe { document.handle_wheel_event(wheel_delta, point, node_address) };
|
||||
}
|
||||
|
||||
/// Handle a "navigate an iframe" message from the constellation.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue