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

Unified Diff: third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp

Issue 2166813005: Remove layoutObject() dependency from HTMLPlugInElement::layoutObjectIsFocusable(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/html/HTMLPlugInElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
index 1545f8481bdc52799053f6e65d49e2709c132ec3..13e5b9b233a78b9ee60ab432b5d55f3c25ba7ad4 100644
--- a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
@@ -260,7 +260,7 @@ LayoutObject* HTMLPlugInElement::createLayoutObject(const ComputedStyle& style)
return image;
}
-
+ m_pluginIsAvailable = true;
return new LayoutEmbeddedObject(this);
}
@@ -397,7 +397,7 @@ bool HTMLPlugInElement::layoutObjectIsFocusable() const
if (useFallbackContent() || !HTMLFrameOwnerElement::layoutObjectIsFocusable())
return false;
- return layoutObject() && layoutObject()->isEmbeddedObject() && !layoutEmbeddedItem().showsUnavailablePluginIndicator();
+ return m_pluginIsAvailable;
}
bool HTMLPlugInElement::isImageType()
@@ -493,8 +493,10 @@ bool HTMLPlugInElement::loadPlugin(const KURL& url, const String& mimeType, cons
FrameLoaderClient::DetachedPluginPolicy policy = requireLayoutObject ? FrameLoaderClient::FailOnDetachedPlugin : FrameLoaderClient::AllowDetachedPlugin;
Widget* widget = frame->loader().client()->createPlugin(this, url, paramNames, paramValues, mimeType, loadManually, policy);
if (!widget) {
- if (!layoutItem.isNull() && !layoutItem.showsUnavailablePluginIndicator())
+ if (!layoutItem.isNull() && !layoutItem.showsUnavailablePluginIndicator()) {
+ m_pluginIsAvailable = false;
layoutItem.setPluginUnavailabilityReason(LayoutEmbeddedObject::PluginMissing);
+ }
return false;
}
@@ -555,8 +557,10 @@ bool HTMLPlugInElement::allowedToLoadObject(const KURL& url, const String& mimeT
fastGetAttribute(HTMLNames::typeAttr);
if (!document().contentSecurityPolicy()->allowObjectFromSource(url)
|| !document().contentSecurityPolicy()->allowPluginTypeForDocument(document(), mimeType, declaredMimeType, url)) {
- if (LayoutEmbeddedItem layoutItem = layoutEmbeddedItem())
+ if (LayoutEmbeddedItem layoutItem = layoutEmbeddedItem()) {
+ m_pluginIsAvailable = false;
layoutItem.setPluginUnavailabilityReason(LayoutEmbeddedObject::PluginBlockedByContentSecurityPolicy);
+ }
return false;
}
// If the URL is empty, a plugin could still be instantiated if a MIME-type

Powered by Google App Engine
This is Rietveld 408576698