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

Unified Diff: Source/core/testing/Internals.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/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index 837b199d1ee7865d9a6cdeeac4b9e23cea8f2cd7..1eeeb991af9c0813ae1dda1a6cddd7897b0e45fd 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -77,6 +77,7 @@
#include "core/html/HTMLIFrameElement.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLMediaElement.h"
+#include "core/html/HTMLPlugInElement.h"
#include "core/html/HTMLSelectElement.h"
#include "core/html/HTMLTextAreaElement.h"
#include "core/html/canvas/CanvasRenderingContext2D.h"
@@ -2226,4 +2227,18 @@ void Internals::hideAllTransitionElements()
frame()->document()->hideTransitionElements(AtomicString(iter->selector));
}
+void Internals::forcePluginPlaceholder(HTMLElement* element, const String& htmlSource, ExceptionState& exceptionState)
+{
+ if (!element) {
+ exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::argumentNullOrIncorrectType(1, "HTMLElement"));
+ return;
+ }
+ if (!element->isPluginElement()) {
+ exceptionState.throwDOMException(InvalidNodeTypeError, "The element provided is not a plugin.");
+ return;
+ }
+ element->ensureUserAgentShadowRoot().setInnerHTML(htmlSource, exceptionState);
+ toHTMLPlugInElement(element)->setUsePlaceholderContent(true);
+}
+
} // namespace blink
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698