Index: third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
index 0a7572f7a7f0e4aa2ec4a84f2e3f2b828c1c6118..4a7a469164698ab420b0d8199fbe58fa1ec4c122 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
@@ -1680,21 +1680,24 @@ bool LayoutBlock::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca |
} |
} |
- // If we have clipping, then we can't have any spillout. |
- bool useOverflowClip = hasOverflowClip() && !hasSelfPaintingLayer(); |
- bool useClip = (hasControlClip() || useOverflowClip); |
- bool checkChildren = !useClip; |
- if (!checkChildren) { |
- if (hasControlClip()) { |
- checkChildren = locationInContainer.intersects(controlClipRect(adjustedLocation)); |
+ bool checkChildren = true; |
+ |
+ // Self painting layers will handle overflow clip in most cases, but without one we need to |
+ // check if overflip clip will affect child hit testing. |
+ if (hasOverflowClip() && !hasSelfPaintingLayer()) { |
+ if (style()->hasBorderRadius()) { |
+ LayoutRect borderRect = borderBoxRect(); |
+ borderRect.moveBy(adjustedLocation); |
+ checkChildren = locationInContainer.intersects(style()->getRoundedInnerBorderFor(borderRect)); |
} else { |
- LayoutRect clipRect = overflowClipRect(adjustedLocation, IncludeOverlayScrollbarSize); |
- if (style()->hasBorderRadius()) |
- checkChildren = locationInContainer.intersects(style()->getRoundedBorderFor(clipRect)); |
- else |
- checkChildren = locationInContainer.intersects(clipRect); |
+ checkChildren = locationInContainer.intersects(overflowClipRect(adjustedLocation, IncludeOverlayScrollbarSize)); |
} |
} |
+ |
+ // A control clip can also clip out child hit testing. |
+ if (checkChildren && hasControlClip()) |
+ checkChildren = locationInContainer.intersects(controlClipRect(adjustedLocation)); |
+ |
if (checkChildren) { |
// Hit test descendants first. |
LayoutSize scrolledOffset(localOffset); |
@@ -1714,8 +1717,7 @@ bool LayoutBlock::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca |
if (style()->hasBorderRadius()) { |
LayoutRect borderRect = borderBoxRect(); |
borderRect.moveBy(adjustedLocation); |
- FloatRoundedRect border = style()->getRoundedBorderFor(borderRect); |
- if (!locationInContainer.intersects(border)) |
+ if (!locationInContainer.intersects(style()->getRoundedBorderFor(borderRect))) |
return false; |
} |