diff options
author | David Zbarsky <dzbarsky@gmail.com> | 2015-07-27 23:05:18 -0400 |
---|---|---|
committer | David Zbarsky <dzbarsky@gmail.com> | 2015-07-29 20:17:50 -0400 |
commit | e484d6b5e3f378a33fabf5ff64cb9a7f76f3ba68 (patch) | |
tree | 49235a86cc3949b27d2262c8bfb11af5c964a249 /components/script/layout_interface.rs | |
parent | 416931f4be43826d3b2a96905c22f626c88b603c (diff) | |
download | servo-e484d6b5e3f378a33fabf5ff64cb9a7f76f3ba68.tar.gz servo-e484d6b5e3f378a33fabf5ff64cb9a7f76f3ba68.zip |
Implement getComputedStyle
Diffstat (limited to 'components/script/layout_interface.rs')
-rw-r--r-- | components/script/layout_interface.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs index d94f6e4a581..092938b8797 100644 --- a/components/script/layout_interface.rs +++ b/components/script/layout_interface.rs @@ -21,8 +21,10 @@ use net_traits::PendingAsyncLoad; use profile_traits::mem::ReportsChan; use script_traits::{ConstellationControlMsg, LayoutControlMsg, ScriptControlChan}; use script_traits::{OpaqueScriptLayoutChannel, StylesheetLoadResponder, UntrustedNodeAddress}; +use selectors::parser::PseudoElement; use std::any::Any; use std::sync::mpsc::{channel, Receiver, Sender}; +use string_cache::Atom; use style::animation::PropertyAnimation; use style::media_queries::MediaQueryList; use style::stylesheets::Stylesheet; @@ -100,8 +102,11 @@ pub trait LayoutRPC { /// Requests the node containing the point of interest fn hit_test(&self, node: TrustedNodeAddress, point: Point2D<f32>) -> Result<HitTestResponse, ()>; fn mouse_over(&self, node: TrustedNodeAddress, point: Point2D<f32>) -> Result<MouseOverResponse, ()>; + /// Query layout for the resolved value of a given CSS property + fn resolved_style(&self) -> ResolvedStyleResponse; } + pub struct ContentBoxResponse(pub Rect<Au>); pub struct ContentBoxesResponse(pub Vec<Rect<Au>>); pub struct NodeGeometryResponse { @@ -109,6 +114,7 @@ pub struct NodeGeometryResponse { } pub struct HitTestResponse(pub UntrustedNodeAddress); pub struct MouseOverResponse(pub Vec<UntrustedNodeAddress>); +pub struct ResolvedStyleResponse(pub Option<String>); /// Why we're doing reflow. #[derive(PartialEq, Copy, Clone, Debug)] @@ -126,6 +132,7 @@ pub enum ReflowQueryType { ContentBoxQuery(TrustedNodeAddress), ContentBoxesQuery(TrustedNodeAddress), NodeGeometryQuery(TrustedNodeAddress), + ResolvedStyleQuery(TrustedNodeAddress, Option<PseudoElement>, Atom), } /// Information needed for a reflow. |