diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2013-05-30 17:28:08 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2013-05-30 17:28:08 -0700 |
commit | f77eef59883dcb96f99c5633b1cca7a8df545159 (patch) | |
tree | 0b607a954873888b641c7337f439986cb74c8dc2 /src/components/script/layout_interface.rs | |
parent | ea1a406589b391fcf0dbcf523969e134decaf227 (diff) | |
download | servo-f77eef59883dcb96f99c5633b1cca7a8df545159.tar.gz servo-f77eef59883dcb96f99c5633b1cca7a8df545159.zip |
Basic hit testing functionality
Diffstat (limited to 'src/components/script/layout_interface.rs')
-rw-r--r-- | src/components/script/layout_interface.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/components/script/layout_interface.rs b/src/components/script/layout_interface.rs index b442dc440d3..86077244ecd 100644 --- a/src/components/script/layout_interface.rs +++ b/src/components/script/layout_interface.rs @@ -6,12 +6,13 @@ /// coupling between these two components, and enables the DOM to be placed in a separate crate /// from layout. -use dom::node::{AbstractNode, ScriptView}; +use dom::node::{AbstractNode, ScriptView, LayoutView}; use script_task::ScriptMsg; use core::comm::{Chan, SharedChan}; use geom::rect::Rect; use geom::size::Size2D; +use geom::point::Point2D; use gfx::geometry::Au; use newcss::stylesheet::Stylesheet; use std::net::url::Url; @@ -43,6 +44,8 @@ pub enum LayoutQuery { ContentBoxQuery(AbstractNode<ScriptView>), /// Requests the dimensions of all the content boxes, as in the `getClientRects()` call. ContentBoxesQuery(AbstractNode<ScriptView>), + /// Requests the node containing the point of interest + HitTestQuery(AbstractNode<ScriptView>, Point2D<f32>), } /// The reply of a synchronous message from script to layout. @@ -54,6 +57,8 @@ pub enum LayoutResponse { ContentBoxResponse(Rect<Au>), /// A response to the `ContentBoxesQuery` message. ContentBoxesResponse(~[Rect<Au>]), + /// A response to the `HitTestQuery` message. + HitTestResponse(AbstractNode<LayoutView>), } /// Dirty bits for layout. |