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

Side by Side Diff: pkg/shadow_dom/lib/src/platform/patches-shadowdom-polyfill.js

Issue 140853005: update custom elements and shadow dom (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 /* 1 /*
2 * Copyright 2013 The Polymer Authors. All rights reserved. 2 * Copyright 2013 The Polymer Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style 3 * Use of this source code is governed by a BSD-style
4 * license that can be found in the LICENSE file. 4 * license that can be found in the LICENSE file.
5 */ 5 */
6 (function() { 6 (function() {
7 var ShadowDOMPolyfill = window.ShadowDOMPolyfill; 7 var ShadowDOMPolyfill = window.ShadowDOMPolyfill;
8 var wrap = ShadowDOMPolyfill.wrap; 8 var wrap = ShadowDOMPolyfill.wrap;
9 9
10 // patch in prefixed name 10 // patch in prefixed name
11 Object.defineProperties(HTMLElement.prototype, { 11 Object.defineProperties(HTMLElement.prototype, {
12 //TODO(sjmiles): review accessor alias with Arv 12 //TODO(sjmiles): review accessor alias with Arv
13 webkitShadowRoot: { 13 webkitShadowRoot: {
14 get: function() { 14 get: function() {
15 return this.shadowRoot; 15 return this.shadowRoot;
16 } 16 }
17 } 17 }
18 }); 18 });
19 19
20 // ShadowCSS needs this:
21 window.wrap = window.ShadowDOMPolyfill.wrap;
22 window.unwrap = window.ShadowDOMPolyfill.unwrap;
23
20 //TODO(sjmiles): review method alias with Arv 24 //TODO(sjmiles): review method alias with Arv
21 HTMLElement.prototype.webkitCreateShadowRoot = 25 HTMLElement.prototype.webkitCreateShadowRoot =
22 HTMLElement.prototype.createShadowRoot; 26 HTMLElement.prototype.createShadowRoot;
23 27
24 // TODO(jmesserly): we need to wrap document somehow (a dart:html hook?) 28 // TODO(jmesserly): we need to wrap document somehow (a dart:html hook?)
25 window.dartExperimentalFixupGetTag = function(originalGetTag) { 29 window.dartExperimentalFixupGetTag = function(originalGetTag) {
26 var NodeList = ShadowDOMPolyfill.wrappers.NodeList; 30 var NodeList = ShadowDOMPolyfill.wrappers.NodeList;
27 var ShadowRoot = ShadowDOMPolyfill.wrappers.ShadowRoot; 31 var ShadowRoot = ShadowDOMPolyfill.wrappers.ShadowRoot;
28 var unwrapIfNeeded = ShadowDOMPolyfill.unwrapIfNeeded; 32 var unwrapIfNeeded = ShadowDOMPolyfill.unwrapIfNeeded;
29 function getTag(obj) { 33 function getTag(obj) {
(...skipping 30 matching lines...) Expand all
60 } 64 }
61 65
62 obj = unwrapped; 66 obj = unwrapped;
63 } 67 }
64 return originalGetTag(obj); 68 return originalGetTag(obj);
65 } 69 }
66 70
67 return getTag; 71 return getTag;
68 }; 72 };
69 })(); 73 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698