Index: lib/dom/templates/html/frog/html_frog.darttemplate |
diff --git a/lib/dom/templates/html/frog/html_frog.darttemplate b/lib/dom/templates/html/frog/html_frog.darttemplate |
index fae451174cb6e2b24554cc995eabdc7be475ebeb..0318677a7425b92dda756003dcb9caff61af45ca 100644 |
--- a/lib/dom/templates/html/frog/html_frog.darttemplate |
+++ b/lib/dom/templates/html/frog/html_frog.darttemplate |
@@ -24,45 +24,13 @@ $!GENERATED_DART_FILES |
#source('../../dom/src/_ListIterators.dart'); |
#source('../../dom/src/_Lists.dart'); |
-_WindowImpl _cachedWindow; |
-_DocumentImpl _cachedDocument; |
- |
-void _init() { |
- _cachedDocument = _document; |
- _cachedWindow = _window; |
- // Feature detect that dart:dom and dart:html are not both loaded by |
- // checking for the presence of a bug that manifests itself when both |
- // libraries are loaded. |
- // TODO(jacobr): remove this code once b/1911 is fixed and the frog compiler |
- // is changed to generate compile time errors if two libraries that define |
- // the same native types in conflicting ways are imported. |
- var element = new Element.tag('body'); |
- element.innerHTML = 'f'; |
- if (element.text == '') { |
- _cachedWindow.console.error( |
- 'Cannot import dart:html and dart:dom within the same application.'); |
- throw new UnsupportedOperationException( |
- 'Cannot import dart:html and dart:dom within the same application.'); |
- } |
-} |
- |
-Window get window() { |
- if (_cachedWindow == null) { |
- _init(); |
- } |
- return _cachedWindow; |
-} |
+Window get window() native "return window;"; |
_WindowImpl get _window() native "return window;"; |
-Document get document() { |
- if (_cachedDocument == null) { |
- _init(); |
- } |
- return _cachedDocument; |
-} |
+Document get document() native "return document;"; |
-_DocumentImpl get _document() native "return window.document.documentElement;"; |
+_DocumentImpl get _document() native "return document;"; |
// Workaround for tags like <cite> that lack their own Element subclass -- |
// Dart issue 1990. |