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 /// *Warning* this class is experimental and subject to change. | 7 /// *Warning* this class is experimental and subject to change. |
8 /// | 8 /// |
9 /// The data associated with a polymer-element declaration, if it is backed | 9 /// The data associated with a polymer-element declaration, if it is backed |
10 /// by a Dart class instead of a JavaScript prototype. | 10 /// by a Dart class instead of a JavaScript prototype. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 Element fetchTemplate() => element.querySelector('template'); | 152 Element fetchTemplate() => element.querySelector('template'); |
153 | 153 |
154 void installBindingDelegate(Element template) { | 154 void installBindingDelegate(Element template) { |
155 if (template != null) { | 155 if (template != null) { |
156 templateBind(template).bindingDelegate = this.syntax; | 156 templateBind(template).bindingDelegate = this.syntax; |
157 } | 157 } |
158 } | 158 } |
159 | 159 |
160 // from declaration/path.js | 160 // from declaration/path.js |
161 void resolveElementPaths(Node node) { | 161 void resolveElementPaths(Node node) { |
162 if (_Platform == null) return; | 162 if (_Polymer == null) return; |
163 _Platform['urlResolver'].callMethod('resolveDom', [node]); | 163 _Polymer['urlResolver'].callMethod('resolveDom', [node]); |
164 } | 164 } |
165 | 165 |
166 // Dart note: renamed from "addResolvePathApi". | 166 // Dart note: renamed from "addResolvePathApi". |
167 void initResolvePath() { | 167 void initResolvePath() { |
168 // let assetpath attribute modify the resolve path | 168 // let assetpath attribute modify the resolve path |
169 var assetPath = element.attributes['assetpath']; | 169 var assetPath = element.attributes['assetpath']; |
170 if (assetPath == null) assetPath = ''; | 170 if (assetPath == null) assetPath = ''; |
171 var base = Uri.parse(element.ownerDocument.baseUri); | 171 var base = Uri.parse(element.ownerDocument.baseUri); |
172 _rootUri = base.resolve(assetPath); | 172 _rootUri = base.resolve(assetPath); |
173 } | 173 } |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 bool _isObserverMethod(Symbol symbol) { | 546 bool _isObserverMethod(Symbol symbol) { |
547 String name = smoke.symbolToName(symbol); | 547 String name = smoke.symbolToName(symbol); |
548 if (name == null) return false; | 548 if (name == null) return false; |
549 return name.endsWith('Changed') && name != 'attributeChanged'; | 549 return name.endsWith('Changed') && name != 'attributeChanged'; |
550 } | 550 } |
551 | 551 |
552 | 552 |
553 final _ATTRIBUTES_REGEX = new RegExp(r'\s|,'); | 553 final _ATTRIBUTES_REGEX = new RegExp(r'\s|,'); |
554 | 554 |
555 final JsObject _Platform = js.context['Platform']; | 555 final JsObject _Platform = js.context['Platform']; |
| 556 final JsObject _Polymer = js.context['Polymer']; |
OLD | NEW |