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

Unified Diff: Source/core/dom/TreeScope.cpp

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove validity rect as per Elliott's request Created 5 years, 6 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/dom/TreeScope.h ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/TreeScope.cpp
diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp
index 801eafbc6ec8c056517e19f50aa3d1c0749c8d40..4cc620ec2a208536511296b07cf240815b5baa36 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -262,13 +262,12 @@ static bool pointWithScrollAndZoomIfPossible(const Document& document, IntPoint&
return true;
}
-HitTestResult hitTestInDocument(const Document* document, int x, int y)
+HitTestResult hitTestInDocument(const Document* document, int x, int y, const HitTestRequest& request)
{
IntPoint hitPoint(x, y);
if (!pointWithScrollAndZoomIfPossible(*document, hitPoint))
return HitTestResult();
- HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
HitTestResult result(request, hitPoint);
document->layoutView()->hitTest(result);
return result;
@@ -276,7 +275,12 @@ HitTestResult hitTestInDocument(const Document* document, int x, int y)
Element* TreeScope::elementFromPoint(int x, int y) const
{
- HitTestResult result = hitTestInDocument(&rootNode().document(), x, y);
+ return hitTestPoint(x, y, HitTestRequest::ReadOnly | HitTestRequest::Active);
+}
+
+Element* TreeScope::hitTestPoint(int x, int y, const HitTestRequest& request) const
+{
+ HitTestResult result = hitTestInDocument(&rootNode().document(), x, y, request);
Node* node = result.innerNode();
if (!node || node->isDocumentNode())
return 0;
« no previous file with comments | « Source/core/dom/TreeScope.h ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698