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

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

Issue 369893006: Allow HTMLPlugInElement to host UA shadow DOM. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 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
« no previous file with comments | « Source/core/html/HTMLPlugInElement.h ('k') | Source/core/rendering/RenderReplaced.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 bd5a5716d80bc7a3179017b09d8941eae844d460..9a43dc5111dc62b5c39011df9d2a45702ca16d12 100644
--- a/Source/core/html/HTMLPlugInElement.cpp
+++ b/Source/core/html/HTMLPlugInElement.cpp
@@ -42,6 +42,7 @@
#include "core/page/EventHandler.h"
#include "core/page/Page.h"
#include "core/plugins/PluginView.h"
+#include "core/rendering/RenderBlockFlow.h"
#include "core/rendering/RenderEmbeddedObject.h"
#include "core/rendering/RenderImage.h"
#include "core/rendering/RenderWidget.h"
@@ -66,6 +67,7 @@ HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document& doc
// the same codepath in this class.
, m_needsWidgetUpdate(!createdByParser)
, m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPreferPlugInsForImages)
+ , m_usePlaceholderContent(false)
{
setHasCustomStyleCallbacks();
}
@@ -236,13 +238,16 @@ RenderObject* HTMLPlugInElement::createRenderer(RenderStyle* style)
return image;
}
+ if (usePlaceholderContent())
+ return new RenderBlockFlow(this);
+
return new RenderEmbeddedObject(this);
}
void HTMLPlugInElement::willRecalcStyle(StyleRecalcChange)
{
// FIXME: Why is this necessary? Manual re-attach is almost always wrong.
- if (!useFallbackContent() && needsWidgetUpdate() && renderer() && !isImageType())
+ if (!useFallbackContent() && !usePlaceholderContent() && needsWidgetUpdate() && renderer() && !isImageType())
reattach();
}
@@ -579,4 +584,12 @@ bool HTMLPlugInElement::useFallbackContent() const
return hasAuthorShadowRoot();
}
+void HTMLPlugInElement::setUsePlaceholderContent(bool use)
+{
+ if (use != m_usePlaceholderContent) {
+ m_usePlaceholderContent = use;
+ lazyReattachIfAttached();
+ }
+}
+
}
« no previous file with comments | « Source/core/html/HTMLPlugInElement.h ('k') | Source/core/rendering/RenderReplaced.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698