Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 if ((!HTMLElement.prototype.createShadowRoot && | 1 if ((!HTMLElement.prototype.createShadowRoot) || |
| 2 !HTMLElement.prototype.webkitCreateShadowRoot) || | |
| 3 window.__forceShadowDomPolyfill) { | 2 window.__forceShadowDomPolyfill) { |
| 4 | 3 |
| 5 /* | 4 /* |
| 6 * Copyright 2013 The Polymer Authors. All rights reserved. | 5 * Copyright 2013 The Polymer Authors. All rights reserved. |
| 7 * Use of this source code is governed by a BSD-style | 6 * Use of this source code is governed by a BSD-style |
| 8 * license that can be found in the LICENSE file. | 7 * license that can be found in the LICENSE file. |
| 9 */ | 8 */ |
| 10 (function() { | 9 (function() { |
| 11 // TODO(jmesserly): fix dart:html to use unprefixed name | 10 // TODO(jmesserly): fix dart:html to use unprefixed name |
| 12 if (Element.prototype.webkitCreateShadowRoot) { | 11 if (Element.prototype.webkitCreateShadowRoot) { |
| (...skipping 5115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5128 | 5127 |
| 5129 // TODO(jmesserly): we need to wrap document somehow (a dart:html hook?) | 5128 // TODO(jmesserly): we need to wrap document somehow (a dart:html hook?) |
| 5130 window.dartExperimentalFixupGetTag = function(originalGetTag) { | 5129 window.dartExperimentalFixupGetTag = function(originalGetTag) { |
| 5131 var NodeList = ShadowDOMPolyfill.wrappers.NodeList; | 5130 var NodeList = ShadowDOMPolyfill.wrappers.NodeList; |
| 5132 var ShadowRoot = ShadowDOMPolyfill.wrappers.ShadowRoot; | 5131 var ShadowRoot = ShadowDOMPolyfill.wrappers.ShadowRoot; |
| 5133 var unwrapIfNeeded = ShadowDOMPolyfill.unwrapIfNeeded; | 5132 var unwrapIfNeeded = ShadowDOMPolyfill.unwrapIfNeeded; |
| 5134 function getTag(obj) { | 5133 function getTag(obj) { |
| 5135 // TODO(jmesserly): do we still need these? | 5134 // TODO(jmesserly): do we still need these? |
| 5136 if (obj instanceof NodeList) return 'NodeList'; | 5135 if (obj instanceof NodeList) return 'NodeList'; |
| 5137 if (obj instanceof ShadowRoot) return 'ShadowRoot'; | 5136 if (obj instanceof ShadowRoot) return 'ShadowRoot'; |
| 5138 if (obj instanceof MutationRecord) return 'MutationRecord'; | 5137 if (window.MutationRecord && (obj instanceof MutationRecord)) |
|
blois
2013/09/20 23:27:36
Note that I can't get the build tool to run (can't
| |
| 5139 if (obj instanceof MutationObserver) return 'MutationObserver'; | 5138 return 'MutationRecord'; |
| 5139 if (window.MutationObserver && (obj instanceof MutationObserver)) | |
| 5140 return 'MutationObserver'; | |
| 5140 | 5141 |
| 5141 var unwrapped = unwrapIfNeeded(obj); | 5142 var unwrapped = unwrapIfNeeded(obj); |
| 5142 if (obj !== unwrapped) { | 5143 if (obj !== unwrapped) { |
| 5143 // Fix up class names for Firefox. | 5144 // Fix up class names for Firefox. |
| 5144 // For some of them (like HTMLFormElement and HTMLInputElement), | 5145 // For some of them (like HTMLFormElement and HTMLInputElement), |
| 5145 // the "constructor" property of the unwrapped nodes points at the | 5146 // the "constructor" property of the unwrapped nodes points at the |
| 5146 // same constructor as the wrapper. | 5147 // same constructor as the wrapper. |
| 5147 var ctor = obj.constructor | 5148 var ctor = obj.constructor |
| 5148 if (ctor === unwrapped.constructor) { | 5149 if (ctor === unwrapped.constructor) { |
| 5149 var name = ctor._ShadowDOMPolyfill$cacheTag_; | 5150 var name = ctor._ShadowDOMPolyfill$cacheTag_; |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5681 for (var i=0, css=[]; i < cssRules.length; i++) { | 5682 for (var i=0, css=[]; i < cssRules.length; i++) { |
| 5682 css.push(cssRules[i].cssText); | 5683 css.push(cssRules[i].cssText); |
| 5683 } | 5684 } |
| 5684 return css.join('\n\n'); | 5685 return css.join('\n\n'); |
| 5685 } | 5686 } |
| 5686 | 5687 |
| 5687 // exports | 5688 // exports |
| 5688 scope.ShadowCSS.shimShadowDOMStyling2 = shimShadowDOMStyling2; | 5689 scope.ShadowCSS.shimShadowDOMStyling2 = shimShadowDOMStyling2; |
| 5689 })(window.Platform); | 5690 })(window.Platform); |
| 5690 | 5691 |
| 5691 } | 5692 } |
| OLD | NEW |