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

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: 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 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.createCallback = function() { 8 PluginPlaceholderElementPrototype.createCallback = function() {
9 // Produces DOM roughly equivalent to the following HTML: 9 // Produces DOM roughly equivalent to the following HTML:
10 // 10 //
11 // <div id="plugin-placeholder"> 11 // <div id="plugin-placeholder">
12 // <div id="plugin-placeholder-content"> 12 // <div id="plugin-placeholder-content">
13 // <div id="plugin-placeholder-message"></div> 13 // <div id="plugin-placeholder-message"></div>
14 // </div> 14 // </div>
15 // </div> 15 // </div>
16 // 16
17 // FIXME: Move style out of script and into CSS. 17 this.appendChild(this.createStyleElement());
18 18
19 this.id = 'plugin-placeholder'; 19 this.id = 'plugin-placeholder';
20 this.style.width = '100%';
21 this.style.height = '100%';
22 this.style.overflow = 'hidden';
23 this.style.display = 'flex';
24 this.style.alignItems = 'center';
25 this.style.backgroundColor = 'gray';
26 this.style.font = '12px -webkit-control';
27 20
28 var contentElement = document.createElement('div'); 21 var contentElement = document.createElement('div');
29 contentElement.id = 'plugin-placeholder-content'; 22 contentElement.id = 'plugin-placeholder-content';
30 contentElement.style.textAlign = 'center';
31 contentElement.style.margin = 'auto';
32 23
33 var messageElement = document.createElement('div'); 24 var messageElement = document.createElement('div');
34 messageElement.id = 'plugin-placeholder-message'; 25 messageElement.id = 'plugin-placeholder-message';
35 26
36 contentElement.appendChild(messageElement); 27 contentElement.appendChild(messageElement);
37 this.appendChild(contentElement); 28 this.appendChild(contentElement);
38 29
39 this.messageElement = messageElement; 30 this.messageElement = messageElement;
40 }; 31 };
41 32
42 Object.defineProperty(PluginPlaceholderElementPrototype, 'message', { 33 Object.defineProperty(PluginPlaceholderElementPrototype, 'message', {
43 get: function() { return this.messageElement.innerHTML; }, 34 get: function() { return this.messageElement.innerHTML; },
44 set: function(html) { this.messageElement.innerHTML = html; }, 35 set: function(html) { this.messageElement.innerHTML = html; },
45 }); 36 });
46 }); 37 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698