Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1956033002: Move hit testing of lines and floats to LayoutBlockFlow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 9f361e89ca897b60d587cf28ee33581c78777269..f969265058047602e7714cd942389e2975a3d858 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1202,12 +1202,25 @@ bool LayoutBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& locati
}
// TODO(pdr): We should also check for css clip in the !isSelfPaintingLayer
- // case, similar to overflow clip in LayoutBlock::nodeAtPoint.
+ // case, similar to overflow clip below.
+ bool skipChildren = false;
+ if (hasOverflowClip() && !hasSelfPaintingLayer()) {
+ if (!locationInContainer.intersects(overflowClipRect(adjustedLocation, ExcludeOverlayScrollbarSizeForHitTesting))) {
+ skipChildren = true;
+ } else if (style()->hasBorderRadius()) {
+ LayoutRect boundsRect(adjustedLocation, size());
+ skipChildren = !locationInContainer.intersects(style()->getRoundedInnerBorderFor(boundsRect));
+ }
+ }
+
+ // A control clip can also clip out child hit testing.
+ if (!skipChildren && hasControlClip() && !locationInContainer.intersects(controlClipRect(adjustedLocation)))
+ skipChildren = true;
// TODO(pdr): We should also include checks for hit testing border radius at
// the layer level (see: crbug.com/568904).
- if (hitTestChildren(result, locationInContainer, adjustedLocation, action))
+ if (!skipChildren && hitTestChildren(result, locationInContainer, adjustedLocation, action))
return true;
if (hitTestClippedOutByRoundedBorder(locationInContainer, adjustedLocation))
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698