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

Unified Diff: pkg/polymer/lib/src/js/use_native_dartium_shadowdom.js

Issue 221813011: [web_components] update web_components and polymer.js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | « pkg/polymer/lib/src/js/polymer/polymer.js.map ('k') | pkg/web_components/lib/build.log » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/js/use_native_dartium_shadowdom.js
diff --git a/pkg/polymer/lib/src/js/use_native_dartium_shadowdom.js b/pkg/polymer/lib/src/js/use_native_dartium_shadowdom.js
index c2f51c1a60584267105f16d7f87e8b407273fb12..7b492b79bad1088d5d1cb7b95985064da95929f0 100644
--- a/pkg/polymer/lib/src/js/use_native_dartium_shadowdom.js
+++ b/pkg/polymer/lib/src/js/use_native_dartium_shadowdom.js
@@ -7,4 +7,23 @@ if (navigator.userAgent.indexOf('(Dart)') !== -1) {
window.Platform = window.Platform || {};
Platform.flags = Platform.flags || {};
Platform.flags.shadow = 'native';
+
+ // Note: Dartium 34 hasn't turned on the unprefixed Shadow DOM
+ // (this happens in Chrome 35), so unless "enable experimental platform
+ // features" is enabled, things will break. So we expose them as unprefixed
+ // names instead.
+ var proto = Element.prototype;
Jennifer Messerly 2014/04/02 23:43:50 this is the new change. it makes polymer.js code i
+ if (!proto.createShadowRoot) {
+ proto.createShadowRoot = proto.webkitCreateShadowRoot;
+
+ Object.defineProperty(proto, 'shadowRoot', {
+ get: function() {
+ return this.webkitShadowRoot;
+ },
+ set: function(value) {
+ this.webkitShadowRoot = value;
+ },
+ configurable: true
+ });
+ }
}
« no previous file with comments | « pkg/polymer/lib/src/js/polymer/polymer.js.map ('k') | pkg/web_components/lib/build.log » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698