diff options
author | Utsav Oza <utsavoza96@gmail.com> | 2020-05-28 00:28:42 +0530 |
---|---|---|
committer | Utsav Oza <utsavoza96@gmail.com> | 2020-06-10 22:10:42 +0530 |
commit | 7883718c125f2580490254efdf0aac952b50ce3d (patch) | |
tree | 866d431004f1e925d5d23919f4d6276f5fd92118 /components/script_layout_interface | |
parent | f161ab8e57b0149b368f892f11c83d953c55dd5a (diff) | |
download | servo-7883718c125f2580490254efdf0aac952b50ce3d.tar.gz servo-7883718c125f2580490254efdf0aac952b50ce3d.zip |
Query layout to resolve canvas font property value
Diffstat (limited to 'components/script_layout_interface')
-rw-r--r-- | components/script_layout_interface/message.rs | 3 | ||||
-rw-r--r-- | components/script_layout_interface/rpc.rs | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs index 8495d61fc8a..5cd6c66345f 100644 --- a/components/script_layout_interface/message.rs +++ b/components/script_layout_interface/message.rs @@ -117,6 +117,7 @@ pub enum QueryMsg { ResolvedStyleQuery(TrustedNodeAddress, Option<PseudoElement>, PropertyId), StyleQuery, ElementInnerTextQuery(TrustedNodeAddress), + ParseFontQuery(TrustedNodeAddress, PropertyId, String), InnerWindowDimensionsQuery(BrowsingContextId), } @@ -145,6 +146,7 @@ impl ReflowGoal { QueryMsg::NodeScrollGeometryQuery(_) | QueryMsg::NodeScrollIdQuery(_) | QueryMsg::ResolvedStyleQuery(..) | + QueryMsg::ParseFontQuery(..) | QueryMsg::OffsetParentQuery(_) | QueryMsg::StyleQuery => false, }, @@ -166,6 +168,7 @@ impl ReflowGoal { QueryMsg::NodeScrollGeometryQuery(_) | QueryMsg::NodeScrollIdQuery(_) | QueryMsg::ResolvedStyleQuery(..) | + QueryMsg::ParseFontQuery(..) | QueryMsg::OffsetParentQuery(_) | QueryMsg::InnerWindowDimensionsQuery(_) | QueryMsg::StyleQuery => false, diff --git a/components/script_layout_interface/rpc.rs b/components/script_layout_interface/rpc.rs index 991437553cd..f21982475cb 100644 --- a/components/script_layout_interface/rpc.rs +++ b/components/script_layout_interface/rpc.rs @@ -6,6 +6,8 @@ use app_units::Au; use euclid::default::Rect; use euclid::Size2D; use script_traits::UntrustedNodeAddress; +use servo_arc::Arc; +use style::properties::ComputedValues; use style_traits::CSSPixel; use webrender_api::ExternalScrollId; @@ -30,6 +32,8 @@ pub trait LayoutRPC { fn node_scroll_id(&self) -> NodeScrollIdResponse; /// Query layout for the resolved value of a given CSS property fn resolved_style(&self) -> ResolvedStyleResponse; + /// Query layout to get the parsed font property for canvas. + fn parsed_font(&self) -> Option<Arc<ComputedValues>>; fn offset_parent(&self) -> OffsetParentResponse; fn text_index(&self) -> TextIndexResponse; /// Requests the list of nodes from the given point. |