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

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

Issue 1946343002: Move computeSelfHitTestRects() 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/LayoutBlockFlow.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/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index 86c89055bb7ce6623f6cc00e09fdd72669e442c7..9bf68fb78a1d4003c7c94356ce9444e671d4f3fa 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -1918,6 +1918,23 @@ void LayoutBlockFlow::computeOverflow(LayoutUnit oldClientAfterEdge, bool recomp
addOverflowFromFloats();
}
+void LayoutBlockFlow::computeSelfHitTestRects(Vector<LayoutRect>& rects, const LayoutPoint& layerOffset) const
+{
+ LayoutBlock::computeSelfHitTestRects(rects, layerOffset);
+
+ if (!hasHorizontalLayoutOverflow() && !hasVerticalLayoutOverflow())
+ return;
+
+ for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
+ LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top());
+ LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->top() + curr->height());
+ LayoutRect rect(layerOffset.x() + curr->x(), layerOffset.y() + top, curr->width(), bottom - top);
+ // It's common for this rect to be entirely contained in our box, so exclude that simple case.
+ if (!rect.isEmpty() && (rects.isEmpty() || !rects[0].contains(rect)))
+ rects.append(rect);
+ }
+}
+
RootInlineBox* LayoutBlockFlow::createAndAppendRootInlineBox()
{
RootInlineBox* rootBox = createRootInlineBox();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698