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

Side by Side Diff: lib/html/templates/html/impl/impl_Node.darttemplate

Issue 10993053: Roll IDL to multivm@910, Take #2 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix for indexeddb Created 8 years, 2 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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Lazy implementation of the child nodes of an element that does not request 6 * Lazy implementation of the child nodes of an element that does not request
7 * the actual child nodes of an element until strictly necessary greatly 7 * the actual child nodes of an element until strictly necessary greatly
8 * improving performance for the typical cases where it is not required. 8 * improving performance for the typical cases where it is not required.
9 */ 9 */
10 class _ChildNodeListLazy implements NodeList { 10 class _ChildNodeListLazy implements NodeList {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Copy list first since we don't want liveness during iteration. 117 // Copy list first since we don't want liveness during iteration.
118 // TODO(jacobr): there is a better way to do this. 118 // TODO(jacobr): there is a better way to do this.
119 List copy = new List.from(value); 119 List copy = new List.from(value);
120 text = ''; 120 text = '';
121 for (Node node in copy) { 121 for (Node node in copy) {
122 $dom_appendChild(node); 122 $dom_appendChild(node);
123 } 123 }
124 } 124 }
125 125
126 // TODO(jacobr): should we throw an exception if parent is already null? 126 // TODO(jacobr): should we throw an exception if parent is already null?
127 _NodeImpl remove() { 127 // TODO(vsm): Use the native remove when available.
128 void remove() {
128 if (this.parent != null) { 129 if (this.parent != null) {
129 final _NodeImpl parent = this.parent; 130 final _NodeImpl parent = this.parent;
130 parent.$dom_removeChild(this); 131 parent.$dom_removeChild(this);
131 } 132 }
132 return this;
133 } 133 }
134 134
135 _NodeImpl replaceWith(Node otherNode) { 135 _NodeImpl replaceWith(Node otherNode) {
136 try { 136 try {
137 final _NodeImpl parent = this.parent; 137 final _NodeImpl parent = this.parent;
138 parent.$dom_replaceChild(otherNode, this); 138 parent.$dom_replaceChild(otherNode, this);
139 } catch (e) { 139 } catch (e) {
140 140
141 }; 141 };
142 return this; 142 return this;
143 } 143 }
144 144
145 $!MEMBERS 145 $!MEMBERS
146 } 146 }
OLDNEW
« no previous file with comments | « lib/html/scripts/systemhtml.py ('k') | lib/html/templates/html/interface/interface_Node.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698