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

Unified Diff: third_party/WebKit/Source/core/exported/WebNode.cpp

Issue 2951053005: Add Mojo API for Blink hit testing (Closed)
Patch Set: Address Rob's comments Created 3 years, 4 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/exported/WebNode.cpp
diff --git a/third_party/WebKit/Source/core/exported/WebNode.cpp b/third_party/WebKit/Source/core/exported/WebNode.cpp
index a9cb9678f2e2564efe084943da15cf72f23b31da..17a6c066a3f6401beead4aa2a88d6ac22a07a26a 100644
--- a/third_party/WebKit/Source/core/exported/WebNode.cpp
+++ b/third_party/WebKit/Source/core/exported/WebNode.cpp
@@ -45,6 +45,7 @@
#include "core/exported/WebPluginContainerImpl.h"
#include "core/html/HTMLCollection.h"
#include "core/html/HTMLElement.h"
+#include "core/html/HTMLFrameOwnerElement.h"
#include "core/layout/LayoutEmbeddedContent.h"
#include "core/layout/LayoutObject.h"
#include "platform/wtf/PtrUtil.h"
@@ -99,6 +100,15 @@ WebDocument WebNode::GetDocument() const {
return WebDocument(&private_->GetDocument());
}
+WebFrame* WebNode::ContentFrame() const {
+ Frame* target_frame = nullptr;
+ if (private_->IsFrameOwnerElement())
+ target_frame = ToHTMLFrameOwnerElement(private_.Get())->ContentFrame();
+ else
+ target_frame = private_->GetDocument().GetFrame();
+ return WebFrame::FromFrame(target_frame);
+}
+
WebNode WebNode::FirstChild() const {
return WebNode(private_->firstChild());
}

Powered by Google App Engine
This is Rietveld 408576698