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 9ceaa5bfb8e4c12321459bca2bf97a6d1cecae88..dec8d31cfa4a78be2888e0b4a785225a6a517ef3 100644 |
--- a/sdk/lib/html/dart2js/html_dart2js.dart |
+++ b/sdk/lib/html/dart2js/html_dart2js.dart |
@@ -23608,7 +23608,7 @@ class TemplateElement extends HtmlElement native "HTMLTemplateElement" { |
} |
if (!isNative) { |
- var doc = _getTemplateContentsOwner(templateElement.document); |
+ var doc = _getTemplateContentsOwner(templateElement.ownerDocument); |
templateElement._templateContent = doc.createDocumentFragment(); |
} |
@@ -23657,7 +23657,7 @@ class TemplateElement extends HtmlElement native "HTMLTemplateElement" { |
// + <td>Bar</td> |
// |
static Element _extractTemplateFromAttributeTemplate(Element el) { |
- var template = el.document.createElement('template'); |
+ var template = el.ownerDocument.createElement('template'); |
el.parentNode.insertBefore(template, el); |
for (var name in el.attributes.keys.toList()) { |