Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Unified Diff: lib/dom/templates/html/frog/html_frog.darttemplate

Issue 9732019: dart:html perf optimization based on runing Dromaeo benchmarks (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698