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

Side by Side Diff: Source/core/html/shadow/PluginPlaceholderElement.js

Issue 522783002: Add a custom element to own structure of shadow DOM plugin placeholders. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase 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
(Empty)
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
3 // found in the LICENSE file.
4
5 'use strict';
6
7 installClass('PluginPlaceholderElement', function(PluginPlaceholderElementProtot ype) {
8 PluginPlaceholderElementPrototype.createCallback = function() {
esprehn 2014/09/09 04:13:30 createdCallback, this should be like a custom elem
jbroman 2014/09/09 14:05:23 Done.
9 // Produces DOM roughly equivalent to the following HTML:
10 //
11 // <div id="plugin-placeholder">
12 // <div id="plugin-placeholder-content">
13 // <div id="plugin-placeholder-message"></div>
14 // </div>
15 // </div>
esprehn 2014/09/09 04:13:30 I'd remove this comment, the test shows the struct
jbroman 2014/09/09 14:05:23 Done.
16 //
17 // FIXME: Move style out of script and into CSS.
18
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
28 var contentElement = document.createElement('div');
29 contentElement.id = 'plugin-placeholder-content';
30 contentElement.style.textAlign = 'center';
31 contentElement.style.margin = 'auto';
32
33 var messageElement = document.createElement('div');
34 messageElement.id = 'plugin-placeholder-message';
35
36 contentElement.appendChild(messageElement);
37 this.appendChild(contentElement);
38
39 this.messageElement = messageElement;
40 };
41
42 Object.defineProperty(PluginPlaceholderElementPrototype, 'message', {
43 get: function() { return this.messageElement.textContent; },
44 set: function(message) { this.messageElement.textContent = message; },
45 });
46 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698