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

Unified Diff: Source/core/layout/LayoutPart.cpp

Issue 1032823003: Refactor HitTestResult to store the HitTestRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 9 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 | « Source/core/layout/LayoutPart.h ('k') | Source/core/layout/LayoutTable.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutPart.cpp
diff --git a/Source/core/layout/LayoutPart.cpp b/Source/core/layout/LayoutPart.cpp
index 82d0f043e6add6f6386f8720648a6c4f401210cf..0e9f3c708ae1435efd686d148e593cd550d00f60 100644
--- a/Source/core/layout/LayoutPart.cpp
+++ b/Source/core/layout/LayoutPart.cpp
@@ -135,10 +135,10 @@ bool LayoutPart::needsPreferredWidthsRecalculation() const
return embeddedContentBox();
}
-bool LayoutPart::nodeAtPointOverWidget(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action)
+bool LayoutPart::nodeAtPointOverWidget(HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action)
{
bool hadResult = result.innerNode();
- bool inside = LayoutReplaced::nodeAtPoint(request, result, locationInContainer, accumulatedOffset, action);
+ bool inside = LayoutReplaced::nodeAtPoint(result, locationInContainer, accumulatedOffset, action);
// Check to see if we are really over the widget itself (and not just in the border/padding area).
if ((inside || result.isRectBasedTest()) && !hadResult && result.innerNode() == node())
@@ -146,25 +146,25 @@ bool LayoutPart::nodeAtPointOverWidget(const HitTestRequest& request, HitTestRes
return inside;
}
-bool LayoutPart::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action)
+bool LayoutPart::nodeAtPoint(HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action)
{
- if (!widget() || !widget()->isFrameView() || !request.allowsChildFrameContent())
- return nodeAtPointOverWidget(request, result, locationInContainer, accumulatedOffset, action);
+ if (!widget() || !widget()->isFrameView() || !result.hitTestRequest().allowsChildFrameContent())
+ return nodeAtPointOverWidget(result, locationInContainer, accumulatedOffset, action);
FrameView* childFrameView = toFrameView(widget());
LayoutView* childRoot = childFrameView->layoutView();
- if (visibleToHitTestRequest(request) && childRoot) {
+ if (visibleToHitTestRequest(result.hitTestRequest()) && childRoot) {
LayoutPoint adjustedLocation = accumulatedOffset + location();
LayoutPoint contentOffset = LayoutPoint(borderLeft() + paddingLeft(), borderTop() + paddingTop()) - LayoutSize(childFrameView->scrollOffset());
HitTestLocation newHitTestLocation(locationInContainer, -adjustedLocation - contentOffset);
- HitTestRequest newHitTestRequest(request.type() | HitTestRequest::ChildFrameHitTest);
- HitTestResult childFrameResult(newHitTestLocation);
+ HitTestRequest newHitTestRequest(result.hitTestRequest().type() | HitTestRequest::ChildFrameHitTest);
+ HitTestResult childFrameResult(newHitTestRequest, newHitTestLocation);
bool isInsideChildFrame = childRoot->hitTest(newHitTestRequest, newHitTestLocation, childFrameResult);
- if (request.listBased())
- result.append(childFrameResult, request);
+ if (result.hitTestRequest().listBased())
+ result.append(childFrameResult);
else if (isInsideChildFrame)
result = childFrameResult;
@@ -172,7 +172,7 @@ bool LayoutPart::nodeAtPoint(const HitTestRequest& request, HitTestResult& resul
return true;
}
- return nodeAtPointOverWidget(request, result, locationInContainer, accumulatedOffset, action);
+ return nodeAtPointOverWidget(result, locationInContainer, accumulatedOffset, action);
}
CompositingReasons LayoutPart::additionalCompositingReasons() const
« no previous file with comments | « Source/core/layout/LayoutPart.h ('k') | Source/core/layout/LayoutTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698