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