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