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

Side by Side Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 12088020: Fix bug in html element remove. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of html; 5 part of html;
6 6
7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated 7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated
8 // functionality. 8 // functionality.
9 class _ChildrenElementList implements List { 9 class _ChildrenElementList implements List {
10 // Raw Element. 10 // Raw Element.
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 return IterableMixinWorkaround.reduce(this, initialValue, combine); 146 return IterableMixinWorkaround.reduce(this, initialValue, combine);
147 } 147 }
148 148
149 void setRange(int start, int rangeLength, List from, [int startFrom = 0]) { 149 void setRange(int start, int rangeLength, List from, [int startFrom = 0]) {
150 throw new UnimplementedError(); 150 throw new UnimplementedError();
151 } 151 }
152 152
153 void remove(Object object) { 153 void remove(Object object) {
154 if (object is Element) { 154 if (object is Element) {
155 Element element = object; 155 Element element = object;
156 if (identical(element.parentNode, this)) { 156 if (identical(element.parentNode, _element)) {
157 _element.$dom_removeChild(element); 157 _element.$dom_removeChild(element);
158 } 158 }
159 } 159 }
160 } 160 }
161 161
162 void removeAll(Iterable elements) { 162 void removeAll(Iterable elements) {
163 IterableMixinWorkaround.removeAll(this, elements); 163 IterableMixinWorkaround.removeAll(this, elements);
164 } 164 }
165 165
166 void retainAll(Iterable elements) { 166 void retainAll(Iterable elements) {
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 $if DART2JS 1038 $if DART2JS
1039 // Optimization to improve performance until the dart2js compiler inlines this 1039 // Optimization to improve performance until the dart2js compiler inlines this
1040 // method. 1040 // method.
1041 static dynamic createElement_tag(String tag) => 1041 static dynamic createElement_tag(String tag) =>
1042 JS('Element', 'document.createElement(#)', tag); 1042 JS('Element', 'document.createElement(#)', tag);
1043 $else 1043 $else
1044 static Element createElement_tag(String tag) => 1044 static Element createElement_tag(String tag) =>
1045 document.$dom_createElement(tag); 1045 document.$dom_createElement(tag);
1046 $endif 1046 $endif
1047 } 1047 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698