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

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

Issue 2642193011: Unify all types of overflow-related clips for paint and hit testing. (Closed)
Patch Set: none Created 3 years, 11 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
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 f8eec36954260aa67f8b21b2f906b1a6295df3f7..5c3b3afe4736616028e2b3511b10810084656d4f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1399,7 +1399,7 @@ bool LayoutBox::nodeAtPoint(HitTestResult& result,
// TODO(pdr): We should also check for css clip in the !isSelfPaintingLayer
// case, similar to overflow clip below.
bool skipChildren = false;
- if (hasOverflowClip() && !hasSelfPaintingLayer()) {
+ if (shouldClipOverflow() && !hasSelfPaintingLayer()) {
if (!locationInContainer.intersects(overflowClipRect(
adjustedLocation, ExcludeOverlayScrollbarSizeForHitTesting))) {
skipChildren = true;
@@ -1410,11 +1410,6 @@ bool LayoutBox::nodeAtPoint(HitTestResult& result,
}
}
- // 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).
@@ -1799,6 +1794,10 @@ LayoutRect LayoutBox::overflowClipRect(
if (hasOverflowClip())
excludeScrollbars(clipRect, overlayScrollbarClipBehavior);
+
+ if (hasControlClip())
+ clipRect.intersect(controlClipRect(location));
+
return clipRect;
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/paint/BlockPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698