Index: third_party/WebKit/Source/core/dom/Document.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp |
index 4b13bb38c904c0136d401125492162169f56e062..df9bd443de1c9b43274f3ba0515113b1b307329a 100644 |
--- a/third_party/WebKit/Source/core/dom/Document.cpp |
+++ b/third_party/WebKit/Source/core/dom/Document.cpp |
@@ -165,6 +165,7 @@ |
#include "core/html/HTMLInputElement.h" |
#include "core/html/HTMLLinkElement.h" |
#include "core/html/HTMLMetaElement.h" |
+#include "core/html/HTMLPlugInElement.h" |
#include "core/html/HTMLScriptElement.h" |
#include "core/html/HTMLTemplateElement.h" |
#include "core/html/HTMLTitleElement.h" |
@@ -369,9 +370,17 @@ static inline bool isValidNamePart(UChar32 c) { |
} |
static FrameViewBase* frameViewBaseForElement(const Element& focusedElement) { |
+ // Check if we have a plugin. |
dcheng
2017/03/27 22:30:42
Nit: I think this comment could be reworded to be
joelhockey
2017/03/28 22:56:23
Slightly changed wording. I didn't want this CL t
|
+ // TODO(joelhockey): FrameViewBase class will soon be removed. It will be |
+ // replaced with Focusable ABC that FrameView and PluginView will implement. |
+ if (focusedElement.isHTMLElement() && |
+ toHTMLElement(focusedElement).isPluginElement()) |
+ return toHTMLPlugInElement(focusedElement).plugin(); |
+ |
LayoutObject* layoutObject = focusedElement.layoutObject(); |
if (!layoutObject || !layoutObject->isLayoutPart()) |
return 0; |
+ |
return toLayoutPart(layoutObject)->frameViewBase(); |
} |