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

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

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: rebase and rewrite 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.js
diff --git a/Source/core/html/shadow/PluginPlaceholderElement.js b/Source/core/html/shadow/PluginPlaceholderElement.js
index 9d3ef2b37aa6d94de92edf79cf46ab0b0f2843c1..bbd83a7e8ec8b3951478826c5fc23855c280d2dd 100644
--- a/Source/core/html/shadow/PluginPlaceholderElement.js
+++ b/Source/core/html/shadow/PluginPlaceholderElement.js
@@ -6,16 +6,10 @@
installClass('PluginPlaceholderElement', function(PluginPlaceholderElementPrototype) {
PluginPlaceholderElementPrototype.createdCallback = function() {
- // FIXME: Move style out of script and into CSS.
-
this.id = 'plugin-placeholder';
- this.style.width = '100%';
- this.style.height = '100%';
- this.style.overflow = 'hidden';
- this.style.display = 'flex';
- this.style.alignItems = 'center';
- this.style.backgroundColor = 'gray';
- this.style.font = '12px -webkit-control';
+
+ var styleElement = document.createElement('style');
+ styleElement.textContent = loadPlatformResource('PluginPlaceholderElement.css');
haraken 2014/10/04 00:56:20 Just to confirm: loadPlatformResource takes a rela
jbroman 2014/10/04 03:36:06 At the moment, it passes the path to Platform::loa
var contentElement = document.createElement('div');
contentElement.id = 'plugin-placeholder-content';
@@ -26,6 +20,7 @@ installClass('PluginPlaceholderElement', function(PluginPlaceholderElementProtot
messageElement.id = 'plugin-placeholder-message';
contentElement.appendChild(messageElement);
+ this.appendChild(styleElement);
this.appendChild(contentElement);
this.messageElement = messageElement;

Powered by Google App Engine
This is Rietveld 408576698