| 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;
|
| }
|
|
|
| /**
|
|
|