diff options
author | Jack Moffitt <jack@metajack.im> | 2016-03-03 17:04:55 -0700 |
---|---|---|
committer | Jack Moffitt <jack@metajack.im> | 2016-03-03 17:04:55 -0700 |
commit | f7aa6a32e9ab5cc3b4ec88ba4d06ab4d27405ffe (patch) | |
tree | b0d3f660f409c68dc129b62300e326c07c05aa65 | |
parent | 55fc48e4c46917a0f036d0054fac296bb5719434 (diff) | |
download | servo-f7aa6a32e9ab5cc3b4ec88ba4d06ab4d27405ffe.tar.gz servo-f7aa6a32e9ab5cc3b4ec88ba4d06ab4d27405ffe.zip |
Unrevert the fix for hit testing through shadows
This was originally #9428 but got accidentally reverted during rebase in
Fixes #9865.
-rw-r--r-- | components/gfx/display_list/mod.rs | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index ddd98a07d5e..516fd5cba60 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -1314,23 +1314,30 @@ impl DisplayItem { return; } - if let DisplayItem::BorderClass(ref border) = *self { - // If the point is inside the border, it didn't hit the border! - let interior_rect = - Rect::new( - Point2D::new(border.base.bounds.origin.x + - border.border_widths.left, - border.base.bounds.origin.y + - border.border_widths.top), - Size2D::new(border.base.bounds.size.width - + match *self { + DisplayItem::BorderClass(ref border) => { + // If the point is inside the border, it didn't hit the border! + let interior_rect = + Rect::new( + Point2D::new(border.base.bounds.origin.x + + border.border_widths.left, + border.base.bounds.origin.y + + border.border_widths.top), + Size2D::new(border.base.bounds.size.width - (border.border_widths.left + border.border_widths.right), - border.base.bounds.size.height - + border.base.bounds.size.height - (border.border_widths.top + border.border_widths.bottom))); - if interior_rect.contains(&point) { - return; + if interior_rect.contains(&point) { + return; + } + } + DisplayItem::BoxShadowClass(_) => { + // Box shadows can never be hit. + return } + _ => {} } // We found a hit! |