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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 installClass('PluginPlaceholderElement', function(PluginPlaceholderElementProtot ype) { 7 installClass('PluginPlaceholderElement', function(PluginPlaceholderElementProtot ype) {
8 PluginPlaceholderElementPrototype.createdCallback = function() { 8 PluginPlaceholderElementPrototype.createdCallback = function() {
9 // FIXME: Move style out of script and into CSS. 9 this.id = 'plugin-placeholder';
10 10
11 this.id = 'plugin-placeholder'; 11 var styleElement = document.createElement('style');
12 this.style.width = '100%'; 12 styleElement.textContent = loadPlatformResource('PluginPlaceholderElemen t.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
13 this.style.height = '100%';
14 this.style.overflow = 'hidden';
15 this.style.display = 'flex';
16 this.style.alignItems = 'center';
17 this.style.backgroundColor = 'gray';
18 this.style.font = '12px -webkit-control';
19 13
20 var contentElement = document.createElement('div'); 14 var contentElement = document.createElement('div');
21 contentElement.id = 'plugin-placeholder-content'; 15 contentElement.id = 'plugin-placeholder-content';
22 contentElement.style.textAlign = 'center'; 16 contentElement.style.textAlign = 'center';
23 contentElement.style.margin = 'auto'; 17 contentElement.style.margin = 'auto';
24 18
25 var messageElement = document.createElement('div'); 19 var messageElement = document.createElement('div');
26 messageElement.id = 'plugin-placeholder-message'; 20 messageElement.id = 'plugin-placeholder-message';
27 21
28 contentElement.appendChild(messageElement); 22 contentElement.appendChild(messageElement);
23 this.appendChild(styleElement);
29 this.appendChild(contentElement); 24 this.appendChild(contentElement);
30 25
31 this.messageElement = messageElement; 26 this.messageElement = messageElement;
32 }; 27 };
33 28
34 Object.defineProperty(PluginPlaceholderElementPrototype, 'message', { 29 Object.defineProperty(PluginPlaceholderElementPrototype, 'message', {
35 get: function() { return this.messageElement.textContent; }, 30 get: function() { return this.messageElement.textContent; },
36 set: function(message) { this.messageElement.textContent = message; }, 31 set: function(message) { this.messageElement.textContent = message; },
37 }); 32 });
38 }); 33 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698