aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-01-26 06:42:57 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-01-26 06:42:57 +0530
commit71d49fc73dd0f3fe42757d87cb60b98c9454d5fa (patch)
tree472175bfec51a6ba1e5bfe6c401fe86d793caf68 /components
parentea147cbd8269458ccc56e104792b69a21fbc74ce (diff)
parent32a68a43ec52f248e955948210f6dfba9b34b0bf (diff)
downloadservo-71d49fc73dd0f3fe42757d87cb60b98c9454d5fa.tar.gz
servo-71d49fc73dd0f3fe42757d87cb60b98c9454d5fa.zip
Auto merge of #9428 - pcwalton:incorporeal-shadows, r=mbrubeck
Make hit tests against box shadows always fail. Closes #9268. r? @mbrubeck <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9428) <!-- Reviewable:end -->
Diffstat (limited to 'components')
-rw-r--r--components/gfx/display_list/mod.rs39
1 files changed, 23 insertions, 16 deletions
diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs
index e7d24843f25..b6565753f36 100644
--- a/components/gfx/display_list/mod.rs
+++ b/components/gfx/display_list/mod.rs
@@ -390,23 +390,30 @@ impl DisplayList {
return;
}
- if let DisplayItem::BorderClass(ref border) = *item {
- // 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.border_widths.top +
- border.border_widths.bottom)));
- if interior_rect.contains(&point) {
- return;
+ match *item {
+ 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.border_widths.top +
+ border.border_widths.bottom)));
+ if interior_rect.contains(&point) {
+ return;
+ }
}
+ DisplayItem::BoxShadowClass(_) => {
+ // Box shadows can never be hit.
+ return
+ }
+ _ => {}
}
// We found a hit!