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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlock.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
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 c1ca7b349a786a4a06a70ee3040e14aee94a76b5..ee0dff75c6af77844975bba480aea2f011692ee0 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -1520,45 +1520,19 @@ bool LayoutBlock::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca
bool LayoutBlock::hitTestChildren(HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction)
{
- // TODO(pdr): We should also check for css clip in the !isSelfPaintingLayer
- // case, similar to overflow clip below.
- if (hasOverflowClip() && !hasSelfPaintingLayer()) {
- if (!locationInContainer.intersects(overflowClipRect(accumulatedOffset, ExcludeOverlayScrollbarSizeForHitTesting)))
- return false;
- if (style()->hasBorderRadius()) {
- LayoutRect borderRect = borderBoxRect();
- borderRect.moveBy(accumulatedOffset);
- if (!locationInContainer.intersects(style()->getRoundedInnerBorderFor(borderRect)))
- return false;
- }
- }
-
- // A control clip can also clip out child hit testing.
- if (hasControlClip() && !locationInContainer.intersects(controlClipRect(accumulatedOffset)))
- return false;
-
+ ASSERT(!childrenInline());
LayoutPoint scrolledOffset(hasOverflowClip() ? accumulatedOffset - scrolledContentOffset() : accumulatedOffset);
- if (childrenInline() && !isTable()) {
- if (m_lineBoxes.hitTest(LineLayoutBoxModel(this), result, locationInContainer, scrolledOffset, hitTestAction)) {
+ HitTestAction childHitTest = hitTestAction;
+ if (hitTestAction == HitTestChildBlockBackgrounds)
+ childHitTest = HitTestChildBlockBackground;
+ for (LayoutBox* child = lastChildBox(); child; child = child->previousSiblingBox()) {
+ LayoutPoint childPoint = flipForWritingModeForChild(child, scrolledOffset);
+ if (!child->hasSelfPaintingLayer() && !child->isFloating() && !child->isColumnSpanAll() && child->nodeAtPoint(result, locationInContainer, childPoint, childHitTest)) {
updateHitTestResult(result, flipForWritingMode(toLayoutPoint(locationInContainer.point() - accumulatedOffset)));
return true;
}
- } else {
- HitTestAction childHitTest = hitTestAction;
- if (hitTestAction == HitTestChildBlockBackgrounds)
- childHitTest = HitTestChildBlockBackground;
- for (LayoutBox* child = lastChildBox(); child; child = child->previousSiblingBox()) {
- LayoutPoint childPoint = flipForWritingModeForChild(child, scrolledOffset);
- if (!child->hasSelfPaintingLayer() && !child->isFloating() && !child->isColumnSpanAll() && child->nodeAtPoint(result, locationInContainer, childPoint, childHitTest)) {
- updateHitTestResult(result, flipForWritingMode(toLayoutPoint(locationInContainer.point() - accumulatedOffset)));
- return true;
- }
- }
}
- if (hitTestAction == HitTestFloat && hitTestFloats(result, locationInContainer, scrolledOffset))
- return true;
-
return false;
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698