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

Side by Side Diff: lib/dom/templates/html/frog/impl_Document.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, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 class $CLASSNAME extends _ElementImpl
6 implements Document
7 native "*HTMLHtmlElement" {
8 $!MEMBERS
9
10 // For efficiency and simplicity, we always use the HtmlElement as the
11 // Document but sometimes internally we need the real JS document object.
12 _NodeImpl get _jsDocument() native "return this.parentNode;";
13
14 // The document doesn't have a parent element.
15 _ElementImpl get parent() => null;
16 }
17
18 // This class should not be externally visible. If a user ever gets access to
19 // a _SecretHtmlDocumentImpl object that is a bug. This object is hidden by
20 // adding checks to all methods that could an HTMLDocument. We believe that
21 // list is limited to Event.target, and HTMLHtmlElement.parent.
22 class _SecretHtmlDocumentImpl extends _NodeImpl implements Node
23 native "*HTMLDocument" {
24 _DocumentImpl get _documentElement() native "return this.documentElement;";
25 }
26
27 EventTarget _FixHtmlDocumentReference(EventTarget eventTarget) {
28 if (eventTarget is _SecretHtmlDocumentImpl) {
29 _SecretHtmlDocumentImpl secretDocument = eventTarget;
30 return secretDocument._documentElement;
31 } else {
32 return eventTarget;
33 }
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698