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

Unified Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

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: tools/dom/templates/html/impl/impl_Element.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index 305d5f2af341c748ea9f57842856cecff93c9be6..d319e0bb4cce45776157f85bc81fc6fa3b761e32 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -830,7 +830,7 @@ $endif
Element get ref {
_ensureTemplate();
- Element ref = null;
+ Element result = null;
var refId = attributes['ref'];
if (refId != null) {
var treeScope = this;
@@ -844,11 +844,17 @@ $endif
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;
}
/**
« pkg/mdv/test/template_element_test.dart ('K') | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698