Index: lib/dom/templates/html/dartium/html_dartium.darttemplate |
diff --git a/lib/dom/templates/html/dartium/html_dartium.darttemplate b/lib/dom/templates/html/dartium/html_dartium.darttemplate |
index f099dd8aef46ed501c5714b3940f344bbd270a90..e1dfa063d2e632ac42b1bee21f3f8b1ef9f5efba 100644 |
--- a/lib/dom/templates/html/dartium/html_dartium.darttemplate |
+++ b/lib/dom/templates/html/dartium/html_dartium.darttemplate |
@@ -32,7 +32,7 @@ _DocumentImpl __document; |
void _initialize() { |
__window = _wrap(dom.window); |
- __document = _wrap(dom.document.documentElement); |
+ __document = _wrap(dom.document); |
} |
Window get window() { |
@@ -74,13 +74,11 @@ _wrap(raw) { |
if (domObject.dartObjectLocalStorage != null) |
return domObject.dartObjectLocalStorage; |
switch(domObject.typeName) { |
- case 'HTMLDocument': |
- throw 'A document should never be wrapped directly. TODO(jacobr) XXX'; |
- case 'HTMLHtmlElement': |
- return new _DocumentImpl._wrap(domObject); |
case 'HTMLElement': |
return new _UnknownElementImpl._wrap(domObject); |
$WRAPCASES |
+ case 'HTMLDocument': |
+ return new _DocumentImpl._wrap(domObject); |
default: |
throw 'Unrecognized object $domObject. Name=${domObject.typeName}'; |
} |