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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 19590007: [mdv] template.ref must recursive to find the original source template (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: revert file generated by dom.py Created 7 years, 5 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: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 2870931c48a5e8e8b2d82acc62f5573727bfa9d1..9e4bc063cd9d2dec6ec9fbe10b1cd176d7d4001a 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -8582,7 +8582,7 @@ abstract class Element extends Node implements ElementTraversal native "Element"
Element get ref {
_ensureTemplate();
- Element ref = null;
+ Element result = null;
var refId = attributes['ref'];
if (refId != null) {
var treeScope = this;
@@ -8596,11 +8596,17 @@ abstract class Element extends Node implements ElementTraversal native "Element"
treeScope is ShadowRoot ||
treeScope is svg.SvgSvgElement) {
- ref = treeScope.getElementById(refId);
+ result = treeScope.getElementById(refId);
}
}
- return ref != null ? ref : _templateInstanceRef;
+ if (result == null) {
+ result = _templateInstanceRef;
+ if (result == null) return this;
+ }
+
+ var nextRef = result.ref;
+ return nextRef != null ? nextRef : result;
}
/**

Powered by Google App Engine
This is Rietveld 408576698