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

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

Issue 869813003: Implement elementsFromPoint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix typeo Created 5 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: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index c03d58941f1ad1279c7ad74b8881fd7ea3139834..bcc496cc7cf158ea2abc1e367e6375413eb2e030 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -1248,11 +1248,20 @@ Element* Document::elementFromPoint(int x, int y) const
return TreeScope::elementFromPoint(x, y);
}
+Vector<Element*> Document::elementsFromPoint(int x, int y) const
+{
+ if (!renderView())
+ return Vector<Element*>();
+
+ return TreeScope::elementsFromPoint(x, y);
+}
+
PassRefPtrWillBeRawPtr<Range> Document::caretRangeFromPoint(int x, int y)
{
if (!renderView())
return nullptr;
- HitTestResult result = hitTestInDocument(this, x, y);
+ HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
+ HitTestResult result = hitTestInDocument(this, x, y, request);
RenderObject* renderer = result.renderer();
if (!renderer)
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698