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

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

Issue 138833005: Replace RenderFullScreen with top layer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: protect only for top layer changes Created 6 years, 10 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/html/HTMLPlugInElement.h ('k') | Source/core/rendering/RenderFullScreen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLPlugInElement.cpp
diff --git a/Source/core/html/HTMLPlugInElement.cpp b/Source/core/html/HTMLPlugInElement.cpp
index 353d141f13eb4682265a372628dfcaba56e24c0f..fb1d11341f710734c7f7082f2456f3d2c3c9542b 100644
--- a/Source/core/html/HTMLPlugInElement.cpp
+++ b/Source/core/html/HTMLPlugInElement.cpp
@@ -68,6 +68,7 @@ HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document& doc
, m_needsWidgetUpdate(!createdByParser)
, m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPreferPlugInsForImages)
, m_displayState(Playing)
+ , m_protectWidgetDuringReattach(0)
{
setHasCustomStyleCallbacks();
}
@@ -116,8 +117,19 @@ void HTMLPlugInElement::attach(const AttachContext& context)
{
HTMLFrameOwnerElement::attach(context);
+ if (m_protectWidgetDuringReattach) {
+ RenderEmbeddedObject* object = renderEmbeddedObject();
+ if (object && !needsWidgetUpdate()) {
+ object->setWidget(m_protectWidgetDuringReattach.get());
+ m_protectWidgetDuringReattach.clear();
+ return;
+ }
+ m_protectWidgetDuringReattach.clear();
+ }
+
if (!renderer() || useFallbackContent())
return;
+
if (isImageType()) {
if (!m_imageLoader)
m_imageLoader = adoptPtr(new HTMLImageLoader(this));
@@ -146,8 +158,9 @@ void HTMLPlugInElement::detach(const AttachContext& context)
{
// Update the widget the next time we attach (detaching destroys the plugin).
// FIXME: None of this "needsWidgetUpdate" related code looks right.
- if (renderer() && !useFallbackContent())
+ if (renderer() && !useFallbackContent() && !(context.performingReattach && m_protectWidgetDuringReattach))
setNeedsWidgetUpdate(true);
+
if (m_isDelayingLoadEvent) {
m_isDelayingLoadEvent = false;
document().decrementLoadEventDelayCount();
@@ -278,6 +291,18 @@ void HTMLPlugInElement::collectStyleForPresentationAttribute(const QualifiedName
}
}
+// FIXME: Hack to prevent the plugin from reloading when entering/exiting
+// fullscreen. When plugins are moved out of render objects, this function won't
+// be needed.
+void HTMLPlugInElement::setIsInTopLayer(bool inTopLayer)
+{
+ if (isInTopLayer() == inTopLayer)
+ return;
+ if (renderEmbeddedObject() && !needsWidgetUpdate() && existingRenderWidget())
+ m_protectWidgetDuringReattach = existingRenderWidget()->widget();
esprehn 2014/02/11 00:25:16 This doesn't seem right, what if you have <div><ob
falken 2014/02/11 14:39:58 Ah, good point. How about adding "topLayerChanged"
+ HTMLFrameOwnerElement::setIsInTopLayer(inTopLayer);
+}
+
void HTMLPlugInElement::defaultEventHandler(Event* event)
{
// Firefox seems to use a fake event listener to dispatch events to plug-in
« no previous file with comments | « Source/core/html/HTMLPlugInElement.h ('k') | Source/core/rendering/RenderFullScreen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698