Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: pkg/polymer/lib/src/declaration.dart

Issue 44573005: Update polymer to commit b7200854b2441a22ce89f6563963f36c50f5150d (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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('/');

Powered by Google App Engine
This is Rietveld 408576698