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

Unified Diff: Source/core/html/shadow/PluginPlaceholderElement.cpp

Issue 516273002: Move plugin placeholder style to CSS, and allow it to bypass main world CSP. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: whitelist an explicit string Created 6 years, 3 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: Source/core/html/shadow/PluginPlaceholderElement.cpp
diff --git a/Source/core/html/shadow/PluginPlaceholderElement.cpp b/Source/core/html/shadow/PluginPlaceholderElement.cpp
index cf0116602c78cc02d4d9d0b9ffb6f3fbf137c576..cfbc9d5832672e0bafd2067de4c1572c3c4f29a0 100644
--- a/Source/core/html/shadow/PluginPlaceholderElement.cpp
+++ b/Source/core/html/shadow/PluginPlaceholderElement.cpp
@@ -7,7 +7,10 @@
#include "bindings/core/v8/V8PluginPlaceholderElement.h"
#include "core/dom/Document.h"
+#include "core/html/HTMLStyleElement.h"
+#include "public/platform/Platform.h"
#include "wtf/Assertions.h"
+#include "wtf/text/WTFString.h"
namespace blink {
@@ -31,4 +34,15 @@ void PluginPlaceholderElement::setMessage(const String& htmlMessage)
ASSERT_UNUSED(success, success);
}
+PassRefPtrWillBeRawPtr<HTMLStyleElement> PluginPlaceholderElement::createStyleElement()
+{
+ const WebData& styleData = Platform::current()->loadResource("PluginPlaceholderElement.css");
+ ASSERT(!styleData.isEmpty());
+ String styleSource(styleData.data(), styleData.size());
+ RefPtrWillBeRawPtr<HTMLStyleElement> styleElement = HTMLStyleElement::create(document(), false);
+ styleElement->setTextContent(styleSource);
+ styleElement->whitelistSource(styleSource);
+ return styleElement.release();
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698