mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Remove unused arguments from methods.
This commit is contained in:
parent
466e895cdf
commit
ff767b13a9
6 changed files with 13 additions and 31 deletions
|
@ -125,7 +125,7 @@ impl Animations {
|
|||
pub(crate) fn do_post_reflow_update(&self, window: &Window, now: f64) {
|
||||
let pipeline_id = window.pipeline_id();
|
||||
let mut sets = self.sets.sets.write();
|
||||
self.root_newly_animating_dom_nodes(&sets, window);
|
||||
self.root_newly_animating_dom_nodes(&sets);
|
||||
|
||||
for (key, set) in sets.iter_mut() {
|
||||
self.handle_canceled_animations(key, set, now, pipeline_id);
|
||||
|
@ -305,9 +305,7 @@ impl Animations {
|
|||
fn root_newly_animating_dom_nodes(
|
||||
&self,
|
||||
sets: &FxHashMap<AnimationSetKey, ElementAnimationSet>,
|
||||
window: &Window,
|
||||
) {
|
||||
let js_runtime = window.get_js_runtime().as_ref().unwrap().rt();
|
||||
let mut rooted_nodes = self.rooted_nodes.borrow_mut();
|
||||
for (key, set) in sets.iter() {
|
||||
let opaque_node = key.node;
|
||||
|
@ -322,7 +320,7 @@ impl Animations {
|
|||
unsafe {
|
||||
rooted_nodes.insert(
|
||||
opaque_node,
|
||||
Dom::from_ref(&*from_untrusted_node_address(js_runtime, address)),
|
||||
Dom::from_ref(&*from_untrusted_node_address(address)),
|
||||
)
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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, JSRuntime};
|
||||
use js::jsapi::{JSObject};
|
||||
use keyboard_types::{Code, Key, KeyState};
|
||||
use metrics::{
|
||||
InteractiveFlag, InteractiveMetrics, InteractiveWindow, ProfilerMetadataFactory,
|
||||
|
@ -1187,7 +1187,6 @@ impl Document {
|
|||
#[allow(unsafe_code)]
|
||||
pub unsafe fn handle_mouse_event(
|
||||
&self,
|
||||
js_runtime: *mut JSRuntime,
|
||||
button: MouseButton,
|
||||
client_point: Point2D<f32>,
|
||||
mouse_event_type: MouseEventType,
|
||||
|
@ -1203,7 +1202,7 @@ impl Document {
|
|||
debug!("{}: at {:?}", mouse_event_type_string, client_point);
|
||||
|
||||
let el = node_address.and_then(|address| {
|
||||
let node = node::from_untrusted_node_address(js_runtime, address);
|
||||
let node = node::from_untrusted_node_address(address);
|
||||
node.inclusive_ancestors(ShadowIncluding::No)
|
||||
.filter_map(DomRoot::downcast::<Element>)
|
||||
.next()
|
||||
|
@ -1391,14 +1390,13 @@ impl Document {
|
|||
#[allow(unsafe_code)]
|
||||
pub unsafe fn handle_mouse_move_event(
|
||||
&self,
|
||||
js_runtime: *mut JSRuntime,
|
||||
client_point: Point2D<f32>,
|
||||
prev_mouse_over_target: &MutNullableDom<Element>,
|
||||
node_address: Option<UntrustedNodeAddress>,
|
||||
pressed_mouse_buttons: u16,
|
||||
) {
|
||||
let maybe_new_target = node_address.and_then(|address| {
|
||||
let node = node::from_untrusted_node_address(js_runtime, address);
|
||||
let node = node::from_untrusted_node_address(address);
|
||||
node.inclusive_ancestors(ShadowIncluding::No)
|
||||
.filter_map(DomRoot::downcast::<Element>)
|
||||
.next()
|
||||
|
@ -1564,7 +1562,6 @@ impl Document {
|
|||
#[allow(unsafe_code)]
|
||||
pub unsafe fn handle_wheel_event(
|
||||
&self,
|
||||
js_runtime: *mut JSRuntime,
|
||||
delta: WheelDelta,
|
||||
client_point: Point2D<f32>,
|
||||
node_address: Option<UntrustedNodeAddress>,
|
||||
|
@ -1573,7 +1570,7 @@ impl Document {
|
|||
debug!("{}: at {:?}", wheel_event_type_string, client_point);
|
||||
|
||||
let el = node_address.and_then(|address| {
|
||||
let node = node::from_untrusted_node_address(js_runtime, address);
|
||||
let node = node::from_untrusted_node_address(address);
|
||||
node.inclusive_ancestors(ShadowIncluding::No)
|
||||
.filter_map(DomRoot::downcast::<Element>)
|
||||
.next()
|
||||
|
@ -1611,7 +1608,6 @@ impl Document {
|
|||
#[allow(unsafe_code)]
|
||||
pub unsafe fn handle_touch_event(
|
||||
&self,
|
||||
js_runtime: *mut JSRuntime,
|
||||
event_type: TouchEventType,
|
||||
touch_id: TouchId,
|
||||
point: Point2D<f32>,
|
||||
|
@ -1627,7 +1623,7 @@ impl Document {
|
|||
};
|
||||
|
||||
let el = node_address.and_then(|address| {
|
||||
let node = node::from_untrusted_node_address(js_runtime, address);
|
||||
let node = node::from_untrusted_node_address(address);
|
||||
node.inclusive_ancestors(ShadowIncluding::No)
|
||||
.filter_map(DomRoot::downcast::<Element>)
|
||||
.next()
|
||||
|
|
|
@ -14,7 +14,6 @@ use crate::dom::node::{self, Node, VecPreOrderInsertionHelper};
|
|||
use crate::dom::window::Window;
|
||||
use crate::stylesheet_set::StylesheetSetRef;
|
||||
use euclid::default::Point2D;
|
||||
use js::jsapi::JS_GetRuntime;
|
||||
use script_layout_interface::message::{NodesFromPointQueryType, QueryMsg};
|
||||
use script_traits::UntrustedNodeAddress;
|
||||
use servo_arc::Arc;
|
||||
|
@ -131,8 +130,7 @@ impl DocumentOrShadowRoot {
|
|||
.first()
|
||||
{
|
||||
Some(address) => {
|
||||
let js_runtime = unsafe { JS_GetRuntime(*self.window.get_cx()) };
|
||||
let node = unsafe { node::from_untrusted_node_address(js_runtime, *address) };
|
||||
let node = unsafe { node::from_untrusted_node_address(*address) };
|
||||
let parent_node = node.GetParentNode().unwrap();
|
||||
let element_ref = node
|
||||
.downcast::<Element>()
|
||||
|
@ -167,15 +165,13 @@ impl DocumentOrShadowRoot {
|
|||
return vec![];
|
||||
}
|
||||
|
||||
let js_runtime = unsafe { JS_GetRuntime(*self.window.get_cx()) };
|
||||
|
||||
// Step 1 and Step 3
|
||||
let nodes = self.nodes_from_point(point, NodesFromPointQueryType::All);
|
||||
let mut elements: Vec<DomRoot<Element>> = nodes
|
||||
.iter()
|
||||
.flat_map(|&untrusted_node_address| {
|
||||
let node = unsafe {
|
||||
node::from_untrusted_node_address(js_runtime, untrusted_node_address)
|
||||
node::from_untrusted_node_address(untrusted_node_address)
|
||||
};
|
||||
DomRoot::downcast::<Element>(node)
|
||||
})
|
||||
|
|
|
@ -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, JSRuntime};
|
||||
use js::jsapi::{JSObject};
|
||||
use libc::{self, c_void, uintptr_t};
|
||||
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
|
||||
use msg::constellation_msg::{BrowsingContextId, PipelineId};
|
||||
|
@ -1322,7 +1322,6 @@ where
|
|||
/// returns it.
|
||||
#[allow(unsafe_code)]
|
||||
pub unsafe fn from_untrusted_node_address(
|
||||
_runtime: *mut JSRuntime,
|
||||
candidate: UntrustedNodeAddress,
|
||||
) -> DomRoot<Node> {
|
||||
// https://github.com/servo/servo/issues/6383
|
||||
|
|
|
@ -1755,9 +1755,7 @@ impl Window {
|
|||
|
||||
for image in complete.pending_images {
|
||||
let id = image.id;
|
||||
let js_runtime = self.js_runtime.borrow();
|
||||
let js_runtime = js_runtime.as_ref().unwrap();
|
||||
let node = unsafe { from_untrusted_node_address(js_runtime.rt(), image.node) };
|
||||
let node = unsafe { from_untrusted_node_address(image.node) };
|
||||
|
||||
if let PendingImageState::Unrequested(ref url) = image.state {
|
||||
fetch_image_for_layout(url.clone(), &*node, id, self.image_cache.clone());
|
||||
|
@ -1988,10 +1986,8 @@ impl Window {
|
|||
// FIXME(nox): Layout can reply with a garbage value which doesn't
|
||||
// actually correspond to an element, that's unsound.
|
||||
let response = self.layout_rpc.offset_parent();
|
||||
let js_runtime = self.js_runtime.borrow();
|
||||
let js_runtime = js_runtime.as_ref().unwrap();
|
||||
let element = response.node_address.and_then(|parent_node_address| {
|
||||
let node = unsafe { from_untrusted_node_address(js_runtime.rt(), parent_node_address) };
|
||||
let node = unsafe { from_untrusted_node_address(parent_node_address) };
|
||||
DomRoot::downcast(node)
|
||||
});
|
||||
(element, response.rect)
|
||||
|
|
|
@ -3527,7 +3527,6 @@ impl ScriptThread {
|
|||
|
||||
unsafe {
|
||||
document.handle_mouse_move_event(
|
||||
self.js_runtime.rt(),
|
||||
point,
|
||||
&self.topmost_mouse_over_target,
|
||||
node_address,
|
||||
|
@ -3654,7 +3653,6 @@ impl ScriptThread {
|
|||
};
|
||||
unsafe {
|
||||
document.handle_mouse_event(
|
||||
self.js_runtime.rt(),
|
||||
button,
|
||||
point,
|
||||
mouse_event_type,
|
||||
|
@ -3682,7 +3680,6 @@ impl ScriptThread {
|
|||
};
|
||||
unsafe {
|
||||
document.handle_touch_event(
|
||||
self.js_runtime.rt(),
|
||||
event_type,
|
||||
identifier,
|
||||
point,
|
||||
|
@ -3703,7 +3700,7 @@ impl ScriptThread {
|
|||
None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
|
||||
};
|
||||
unsafe {
|
||||
document.handle_wheel_event(self.js_runtime.rt(), wheel_delta, point, node_address)
|
||||
document.handle_wheel_event(wheel_delta, point, node_address)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue