Chromium Code Reviews| Index: pkg/polymer/lib/src/declaration.dart |
| diff --git a/pkg/polymer/lib/src/declaration.dart b/pkg/polymer/lib/src/declaration.dart |
| index 012a54ca79c55be796a9e35cc916b06c11528d37..70df78153c92a7ced61ff68a4de9c4dcc19f8031 100644 |
| --- a/pkg/polymer/lib/src/declaration.dart |
| +++ b/pkg/polymer/lib/src/declaration.dart |
| @@ -16,7 +16,7 @@ class PolymerDeclaration extends HtmlElement { |
| factory PolymerDeclaration() => new Element.tag(_TAG); |
| // Fully ported from revision: |
| - // https://github.com/Polymer/polymer/blob/00e2982c78fcd396adaebff3118e94029a2b9fb0 |
| + // https://github.com/Polymer/polymer/blob/b7200854b2441a22ce89f6563963f36c50f5150d |
| // |
| // src/declaration/attributes.js |
| // src/declaration/events.js |
| @@ -206,8 +206,6 @@ class PolymerDeclaration extends HtmlElement { |
| accumulateInstanceAttributes(); |
| // parse on-* delegates declared on `this` element |
| parseHostEvents(); |
| - // parse on-* delegates declared in templates |
| - parseLocalEvents(); |
| // install external stylesheets as if they are inline |
| installSheets(); |
| @@ -313,59 +311,12 @@ class PolymerDeclaration extends HtmlElement { |
| void addAttributeDelegates(Map<String, String> delegates) { |
| attributes.forEach((name, value) { |
| if (_hasEventPrefix(name)) { |
| - delegates[_removeEventPrefix(name)] = value; |
| + delegates[_removeEventPrefix(name)] = |
| + value.replaceAll('{{', '').replaceAll('}}', '').trim(); |
|
Jennifer Messerly
2013/10/25 22:00:41
in JavaScript they're just replacing the first occ
Siggi Cherem (dart-lang)
2013/10/26 00:02:35
Done.
|
| } |
| }); |
| } |
| - /** Extracts events under the element's <template>. */ |
| - void parseLocalEvents() { |
| - for (var t in this.queryAll('template')) { |
| - final events = new Set<String>(); |
| - // acquire delegates from entire subtree at t |
| - accumulateTemplatedEvents(t, events); |
| - if (events.isNotEmpty) { |
| - // store delegate information directly on template |
| - if (_templateDelegates == null) { |
| - _templateDelegates = new Expando<Set<String>>(); |
| - } |
| - _templateDelegates[t] = events; |
| - } |
| - } |
| - } |
| - |
| - void accumulateTemplatedEvents(Element node, Set<String> events) { |
| - if (node.localName == 'template') { |
| - accumulateChildEvents(templateBind(node).content, events); |
| - } |
| - } |
| - |
| - void accumulateChildEvents(node, Set<String> events) { |
| - assert(node is Element || node is DocumentFragment); |
| - for (var n in node.children) { |
| - accumulateEvents(n, events); |
| - } |
| - } |
| - |
| - void accumulateEvents(Element node, Set<String> events) { |
| - accumulateAttributeEvents(node, events); |
| - accumulateChildEvents(node, events); |
| - accumulateTemplatedEvents(node, events); |
| - } |
| - |
| - void accumulateAttributeEvents(Element node, Set<String> events) { |
| - for (var name in node.attributes.keys) { |
| - if (_hasEventPrefix(name)) { |
| - accumulateEvent(_removeEventPrefix(name), events); |
| - } |
| - } |
| - } |
| - |
| - void accumulateEvent(String name, Set<String> events) { |
| - var translated = _eventTranslations[name]; |
| - events.add(translated != null ? translated : name); |
| - } |
| - |
| String urlToPath(String url) { |
| if (url == null) return ''; |
| return (url.split('/')..removeLast()..add('')).join('/'); |