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

Unified 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: fix due to binding changes 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
« no previous file with comments | « Source/core/html/shadow/PluginPlaceholderElement.idl ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/shadow/PluginPlaceholderElement.js
diff --git a/Source/core/html/shadow/PluginPlaceholderElement.js b/Source/core/html/shadow/PluginPlaceholderElement.js
new file mode 100644
index 0000000000000000000000000000000000000000..70067ca35468f31b3d0042ca44708663e63eac56
--- /dev/null
+++ b/Source/core/html/shadow/PluginPlaceholderElement.js
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+'use strict';
+
+installClass('PluginPlaceholderElement', function(PluginPlaceholderElementPrototype) {
+ PluginPlaceholderElementPrototype.createCallback = function() {
+ // Produces DOM roughly equivalent to the following HTML:
+ //
+ // <div id="plugin-placeholder">
+ // <div id="plugin-placeholder-content">
+ // <div id="plugin-placeholder-message"></div>
+ // </div>
+ // </div>
+ //
+ // 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 contentElement = document.createElement('div');
+ contentElement.id = 'plugin-placeholder-content';
+ contentElement.style.textAlign = 'center';
+ contentElement.style.margin = 'auto';
+
+ var messageElement = document.createElement('div');
+ messageElement.id = 'plugin-placeholder-message';
+
+ contentElement.appendChild(messageElement);
+ this.appendChild(contentElement);
+
+ this.messageElement = messageElement;
+ };
+
+ Object.defineProperty(PluginPlaceholderElementPrototype, 'message', {
+ get: function() { return this.messageElement.innerHTML; },
esprehn 2014/09/02 23:12:00 no innerHTML should be exposed like this.
+ set: function(html) { this.messageElement.innerHTML = html; },
+ });
+});
« no previous file with comments | « Source/core/html/shadow/PluginPlaceholderElement.idl ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698