| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 234 |
| 235 } | 235 } |
| 236 | 236 |
| 237 void registerType(String name) { | 237 void registerType(String name) { |
| 238 var baseTag; | 238 var baseTag; |
| 239 var decl = this; | 239 var decl = this; |
| 240 while (decl != null) { | 240 while (decl != null) { |
| 241 baseTag = decl.attributes['extends']; | 241 baseTag = decl.attributes['extends']; |
| 242 decl = decl.superDeclaration; | 242 decl = decl.superDeclaration; |
| 243 } | 243 } |
| 244 // native element must be specified in extends | 244 document.register(name, type, extendsTag: baseTag); |
| 245 var nativeExtends = baseTag; | |
| 246 document.register(name, type, extendsTag: nativeExtends); | |
| 247 } | 245 } |
| 248 | 246 |
| 249 void publishAttributes(ClassMirror cls, PolymerDeclaration superDecl) { | 247 void publishAttributes(ClassMirror cls, PolymerDeclaration superDecl) { |
| 250 // get properties to publish | 248 // get properties to publish |
| 251 if (superDecl != null && superDecl._publish != null) { | 249 if (superDecl != null && superDecl._publish != null) { |
| 252 _publish = new Map.from(superDecl._publish); | 250 _publish = new Map.from(superDecl._publish); |
| 253 } | 251 } |
| 254 _publish = _getProperties(cls, _publish, (x) => x is PublishedProperty); | 252 _publish = _getProperties(cls, _publish, (x) => x is PublishedProperty); |
| 255 | 253 |
| 256 // merge names from 'attributes' attribute | 254 // merge names from 'attributes' attribute |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 return map; | 680 return map; |
| 683 }(); | 681 }(); |
| 684 | 682 |
| 685 // Dart note: we need this function because we have additional renames JS does | 683 // Dart note: we need this function because we have additional renames JS does |
| 686 // not have. The JS renames are simply case differences, whereas we have ones | 684 // not have. The JS renames are simply case differences, whereas we have ones |
| 687 // like doubleclick -> dblclick and stripping the webkit prefix. | 685 // like doubleclick -> dblclick and stripping the webkit prefix. |
| 688 String _eventNameFromType(String eventType) { | 686 String _eventNameFromType(String eventType) { |
| 689 final result = _reverseEventTranslations[eventType]; | 687 final result = _reverseEventTranslations[eventType]; |
| 690 return result != null ? result : eventType; | 688 return result != null ? result : eventType; |
| 691 } | 689 } |
| OLD | NEW |