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

Side by Side 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, 8 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
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Prevent polyfilled JS Shadow DOM in Dartium 1 // Prevent polyfilled JS Shadow DOM in Dartium
2 // We need this if we want Dart code to be able to interoperate with Polymer.js 2 // We need this if we want Dart code to be able to interoperate with Polymer.js
3 // code that also uses Shadow DOM. 3 // code that also uses Shadow DOM.
4 // TODO(jmesserly): we can remove this code once platform.js is correctly 4 // TODO(jmesserly): we can remove this code once platform.js is correctly
5 // feature detecting Shadow DOM in Dartium. 5 // feature detecting Shadow DOM in Dartium.
6 if (navigator.userAgent.indexOf('(Dart)') !== -1) { 6 if (navigator.userAgent.indexOf('(Dart)') !== -1) {
7 window.Platform = window.Platform || {}; 7 window.Platform = window.Platform || {};
8 Platform.flags = Platform.flags || {}; 8 Platform.flags = Platform.flags || {};
9 Platform.flags.shadow = 'native'; 9 Platform.flags.shadow = 'native';
10
11 // Note: Dartium 34 hasn't turned on the unprefixed Shadow DOM
12 // (this happens in Chrome 35), so unless "enable experimental platform
13 // features" is enabled, things will break. So we expose them as unprefixed
14 // names instead.
15 var proto = Element.prototype;
Jennifer Messerly 2014/04/02 23:43:50 this is the new change. it makes polymer.js code i
16 if (!proto.createShadowRoot) {
17 proto.createShadowRoot = proto.webkitCreateShadowRoot;
18
19 Object.defineProperty(proto, 'shadowRoot', {
20 get: function() {
21 return this.webkitShadowRoot;
22 },
23 set: function(value) {
24 this.webkitShadowRoot = value;
25 },
26 configurable: true
27 });
28 }
10 } 29 }
OLDNEW
« 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