aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2019-02-06 15:17:29 -0500
committerJosh Matthews <josh@joshmatthews.net>2019-02-06 15:19:03 -0500
commitf59e95ee3df314fe82de12c9f76ad484cd5d69f7 (patch)
treec88206f14fddf6318aa886398477b02e282638aa /components/layout
parenta34c8f952ebd585ad612c1cea74c47e9402d6ee0 (diff)
downloadservo-f59e95ee3df314fe82de12c9f76ad484cd5d69f7.tar.gz
servo-f59e95ee3df314fe82de12c9f76ad484cd5d69f7.zip
Ensure transparent hit test region is sized and positioned correctly.
Diffstat (limited to 'components/layout')
-rw-r--r--components/layout/display_list/builder.rs25
1 files changed, 22 insertions, 3 deletions
diff --git a/components/layout/display_list/builder.rs b/components/layout/display_list/builder.rs
index 17cdd5cdc1a..2a107ed0c88 100644
--- a/components/layout/display_list/builder.rs
+++ b/components/layout/display_list/builder.rs
@@ -390,7 +390,25 @@ impl<'a> DisplayListBuildState<'a> {
} else {
self.current_clipping_and_scrolling
};
+ self.create_base_display_item_with_clipping_and_scrolling(
+ bounds,
+ clip_rect,
+ node,
+ cursor,
+ section,
+ clipping_and_scrolling,
+ )
+ }
+ fn create_base_display_item_with_clipping_and_scrolling(
+ &self,
+ bounds: Rect<Au>,
+ clip_rect: Rect<Au>,
+ node: OpaqueNode,
+ cursor: Option<Cursor>,
+ section: DisplayListSection,
+ clipping_and_scrolling: ClippingAndScrolling,
+ ) -> BaseDisplayItem {
BaseDisplayItem::new(
bounds.to_layout(),
DisplayItemMetadata {
@@ -1640,14 +1658,15 @@ impl Fragment {
// of this fragment's background but behind its content. This ensures that any
// hit tests inside the content box but not on actual content target the current
// scrollable ancestor.
- let content_size = TypedRect::from_size(content_size);
- let base = state.create_base_display_item(
+ let content_size = TypedRect::new(stacking_relative_border_box.origin, content_size);
+ let base = state.create_base_display_item_with_clipping_and_scrolling(
content_size,
content_size,
self.node,
// FIXME(emilio): Why does this ignore pointer-events?
get_cursor(&self.style, Cursor::Default).or(Some(Cursor::Default)),
- DisplayListSection::Content,
+ display_list_section,
+ state.current_clipping_and_scrolling,
);
state.add_display_item(DisplayItem::Rectangle(CommonDisplayItem::new(
base,