diff options
Diffstat (limited to 'components/script_layout_interface')
-rw-r--r-- | components/script_layout_interface/message.rs | 26 | ||||
-rw-r--r-- | components/script_layout_interface/rpc.rs | 8 |
2 files changed, 16 insertions, 18 deletions
diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs index a026b349ab8..6f8009ecdd8 100644 --- a/components/script_layout_interface/message.rs +++ b/components/script_layout_interface/message.rs @@ -100,6 +100,11 @@ pub enum Msg { SetNavigationStart(f64), } +#[derive(Debug, PartialEq)] +pub enum NodesFromPointQueryType { + All, + Topmost, +} /// Any query to perform with this reflow. #[derive(Debug, PartialEq)] @@ -109,7 +114,6 @@ pub enum ReflowGoal { ContentBoxQuery(TrustedNodeAddress), ContentBoxesQuery(TrustedNodeAddress), NodeOverflowQuery(TrustedNodeAddress), - HitTestQuery(Point2D<f32>, bool), NodeScrollRootIdQuery(TrustedNodeAddress), NodeGeometryQuery(TrustedNodeAddress), NodeScrollGeometryQuery(TrustedNodeAddress), @@ -117,7 +121,7 @@ pub enum ReflowGoal { OffsetParentQuery(TrustedNodeAddress), MarginStyleQuery(TrustedNodeAddress), TextIndexQuery(TrustedNodeAddress, i32, i32), - NodesFromPoint(Point2D<f32>), + NodesFromPointQuery(Point2D<f32>, NodesFromPointQueryType), } impl ReflowGoal { @@ -125,9 +129,8 @@ impl ReflowGoal { /// be present or false if it only needs stacking-relative positions. pub fn needs_display_list(&self) -> bool { match *self { - ReflowGoal::NodesFromPoint(..) | ReflowGoal::HitTestQuery(..) | - ReflowGoal::TextIndexQuery(..) | ReflowGoal::TickAnimations | - ReflowGoal::Full => true, + ReflowGoal::NodesFromPointQuery(..) | ReflowGoal::TextIndexQuery(..) | + ReflowGoal::TickAnimations | ReflowGoal::Full => true, ReflowGoal::ContentBoxQuery(_) | ReflowGoal::ContentBoxesQuery(_) | ReflowGoal::NodeGeometryQuery(_) | ReflowGoal::NodeScrollGeometryQuery(_) | ReflowGoal::NodeOverflowQuery(_) | ReflowGoal::NodeScrollRootIdQuery(_) | @@ -141,12 +144,13 @@ impl ReflowGoal { pub fn needs_display(&self) -> bool { match *self { ReflowGoal::MarginStyleQuery(_) | ReflowGoal::TextIndexQuery(..) | - ReflowGoal::HitTestQuery(..) | ReflowGoal::ContentBoxQuery(_) | - ReflowGoal::ContentBoxesQuery(_) | ReflowGoal::NodeGeometryQuery(_) | - ReflowGoal::NodeScrollGeometryQuery(_) | ReflowGoal::NodeOverflowQuery(_) | - ReflowGoal::NodeScrollRootIdQuery(_) | ReflowGoal::ResolvedStyleQuery(..) | - ReflowGoal::OffsetParentQuery(_) | ReflowGoal::NodesFromPoint(..) => false, - ReflowGoal::Full | ReflowGoal::TickAnimations => true, + ReflowGoal::ContentBoxQuery(_) | ReflowGoal::ContentBoxesQuery(_) | + ReflowGoal::NodeGeometryQuery(_) | ReflowGoal::NodeScrollGeometryQuery(_) | + ReflowGoal::NodeOverflowQuery(_) | ReflowGoal::NodeScrollRootIdQuery(_) | + ReflowGoal::ResolvedStyleQuery(..) | + ReflowGoal::OffsetParentQuery(_) => false, + ReflowGoal::NodesFromPointQuery(..) | ReflowGoal::Full | + ReflowGoal::TickAnimations => true, } } } diff --git a/components/script_layout_interface/rpc.rs b/components/script_layout_interface/rpc.rs index ab3509e7604..5702c8cce9d 100644 --- a/components/script_layout_interface/rpc.rs +++ b/components/script_layout_interface/rpc.rs @@ -29,17 +29,15 @@ pub trait LayoutRPC { fn node_scroll_area(&self) -> NodeGeometryResponse; /// Requests the scroll root id of this node. Used by APIs such as `scrollTop` fn node_scroll_root_id(&self) -> NodeScrollRootIdResponse; - /// Requests the node containing the point of interest - fn hit_test(&self) -> HitTestResponse; /// Query layout for the resolved value of a given CSS property fn resolved_style(&self) -> ResolvedStyleResponse; fn offset_parent(&self) -> OffsetParentResponse; /// Query layout for the resolve values of the margin properties for an element. fn margin_style(&self) -> MarginStyleResponse; + fn text_index(&self) -> TextIndexResponse; /// Requests the list of nodes from the given point. fn nodes_from_point_response(&self) -> Vec<UntrustedNodeAddress>; - fn text_index(&self) -> TextIndexResponse; } pub struct ContentBoxResponse(pub Option<Rect<Au>>); @@ -54,10 +52,6 @@ pub struct NodeOverflowResponse(pub Option<Point2D<overflow_x::computed_value::T pub struct NodeScrollRootIdResponse(pub ClipId); -pub struct HitTestResponse { - pub node_address: Option<UntrustedNodeAddress>, -} - pub struct ResolvedStyleResponse(pub String); #[derive(Clone)] |