diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-03-04 04:00:30 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-03-04 04:00:30 +0530 |
commit | 37bcc161fe45bf8c1cb1172b8e0d12c7d03371b6 (patch) | |
tree | 3d2946b320f74975411fd99672c88de10042c1a2 /components/script/layout_interface.rs | |
parent | 55fc48e4c46917a0f036d0054fac296bb5719434 (diff) | |
parent | 2507bfb2cf3a5d16d457bb8ebc56545d8d6cee09 (diff) | |
download | servo-37bcc161fe45bf8c1cb1172b8e0d12c7d03371b6.tar.gz servo-37bcc161fe45bf8c1cb1172b8e0d12c7d03371b6.zip |
Auto merge of #9832 - metajack:suppress-reflows, r=mbrubeck
Suppress reflows before RefreshTick or FirstLoad
This fixes a bug where partially loaded content is displayed to the user
before it should be, usually before stylesheets have loaded. This commit
supresses reflows until either FirstLoad or RefreshTick, whichever comes
first.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9832)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/layout_interface.rs')
-rw-r--r-- | components/script/layout_interface.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs index 3976f0a8d20..9a8cddf97e1 100644 --- a/components/script/layout_interface.rs +++ b/components/script/layout_interface.rs @@ -105,7 +105,7 @@ pub trait LayoutRPC { /// Requests the geometry of this node. Used by APIs such as `clientTop`. fn node_geometry(&self) -> NodeGeometryResponse; /// Requests the node containing the point of interest - fn hit_test(&self, point: Point2D<f32>, update_cursor: bool) -> Result<HitTestResponse, ()>; + 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; @@ -134,10 +134,12 @@ impl MarginStyleResponse { pub struct ContentBoxResponse(pub Rect<Au>); pub struct ContentBoxesResponse(pub Vec<Rect<Au>>); +pub struct HitTestResponse { + pub node_address: Option<UntrustedNodeAddress>, +} pub struct NodeGeometryResponse { pub client_rect: Rect<i32>, } -pub struct HitTestResponse(pub UntrustedNodeAddress); pub struct ResolvedStyleResponse(pub Option<String>); #[derive(Clone)] @@ -161,6 +163,7 @@ pub enum ReflowQueryType { NoQuery, ContentBoxQuery(TrustedNodeAddress), ContentBoxesQuery(TrustedNodeAddress), + HitTestQuery(Point2D<f32>, bool), NodeGeometryQuery(TrustedNodeAddress), ResolvedStyleQuery(TrustedNodeAddress, Option<PseudoElement>, Atom), OffsetParentQuery(TrustedNodeAddress), |