| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of polymer; | 5 part of polymer; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * **Warning**: this class is experiental and subject to change. | 8 * **Warning**: this class is experiental and subject to change. |
| 9 * | 9 * |
| 10 * The implementation for the `polymer-element` element. | 10 * The implementation for the `polymer-element` element. |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // Potentially remove when spec bug is addressed. | 215 // Potentially remove when spec bug is addressed. |
| 216 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=21407 | 216 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=21407 |
| 217 // TODO(jmesserly): resolvePath not ported, see first comment in this class. | 217 // TODO(jmesserly): resolvePath not ported, see first comment in this class. |
| 218 | 218 |
| 219 // under ShadowDOMPolyfill, transforms to approximate missing CSS features | 219 // under ShadowDOMPolyfill, transforms to approximate missing CSS features |
| 220 _shimShadowDomStyling(templateContent, name, extendee); | 220 _shimShadowDomStyling(templateContent, name, extendee); |
| 221 | 221 |
| 222 var cls = reflectClass(type); | 222 var cls = reflectClass(type); |
| 223 // TODO(jmesserly): this feels unnatrual in Dart. Since we have convenient | 223 // TODO(jmesserly): this feels unnatrual in Dart. Since we have convenient |
| 224 // lazy static initialization, can we get by without it? | 224 // lazy static initialization, can we get by without it? |
| 225 var registered = cls.declarations[#registerCallback]; | 225 var registered = cls.methods[#registerCallback]; |
| 226 if (registered != null && | 226 if (registered != null && registered.isStatic && |
| 227 registered is MethodMirror && | |
| 228 registered.isStatic && | |
| 229 registered.isRegularMethod) { | 227 registered.isRegularMethod) { |
| 230 cls.invoke(#registerCallback, [this]); | 228 cls.invoke(#registerCallback, [this]); |
| 231 } | 229 } |
| 232 } | 230 } |
| 233 | 231 |
| 234 void registerType(String name) { | 232 void registerType(String name) { |
| 235 var baseTag; | 233 var baseTag; |
| 236 var decl = this; | 234 var decl = this; |
| 237 while (decl != null) { | 235 while (decl != null) { |
| 238 baseTag = decl.attributes['extends']; | 236 baseTag = decl.attributes['extends']; |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 return map; | 609 return map; |
| 612 }(); | 610 }(); |
| 613 | 611 |
| 614 // Dart note: we need this function because we have additional renames JS does | 612 // Dart note: we need this function because we have additional renames JS does |
| 615 // not have. The JS renames are simply case differences, whereas we have ones | 613 // not have. The JS renames are simply case differences, whereas we have ones |
| 616 // like doubleclick -> dblclick and stripping the webkit prefix. | 614 // like doubleclick -> dblclick and stripping the webkit prefix. |
| 617 String _eventNameFromType(String eventType) { | 615 String _eventNameFromType(String eventType) { |
| 618 final result = _reverseEventTranslations[eventType]; | 616 final result = _reverseEventTranslations[eventType]; |
| 619 return result != null ? result : eventType; | 617 return result != null ? result : eventType; |
| 620 } | 618 } |
| OLD | NEW |