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 |