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

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

Issue 12407005: Adding tests for Element & Node lists insert method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/html/node_test.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | 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 $LIBRARYNAME; 5 part of $LIBRARYNAME;
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 return Lists.lastIndexOf(this, element, start); 214 return Lists.lastIndexOf(this, element, start);
215 } 215 }
216 216
217 void insert(int index, Element element) { 217 void insert(int index, Element element) {
218 if (index < 0 || index > length) { 218 if (index < 0 || index > length) {
219 throw new RangeError.range(index, 0, length); 219 throw new RangeError.range(index, 0, length);
220 } 220 }
221 if (index == length) { 221 if (index == length) {
222 _element.append(element); 222 _element.append(element);
223 } else { 223 } else {
224 throw new UnimplementedError("insert on ElementLists"); 224 _element.insertBefore(element, this[index]);
225 } 225 }
226 } 226 }
227 227
228 void clear() { 228 void clear() {
229 // It is unclear if we want to keep non element nodes? 229 // It is unclear if we want to keep non element nodes?
230 _element.text = ''; 230 _element.text = '';
231 } 231 }
232 232
233 Element removeAt(int index) { 233 Element removeAt(int index) {
234 final result = this[index]; 234 final result = this[index];
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 const ScrollAlignment._internal(this._value); 1141 const ScrollAlignment._internal(this._value);
1142 toString() => 'ScrollAlignment.$_value'; 1142 toString() => 'ScrollAlignment.$_value';
1143 1143
1144 /// Attempt to align the element to the top of the scrollable area. 1144 /// Attempt to align the element to the top of the scrollable area.
1145 static const TOP = const ScrollAlignment._internal('TOP'); 1145 static const TOP = const ScrollAlignment._internal('TOP');
1146 /// Attempt to center the element in the scrollable area. 1146 /// Attempt to center the element in the scrollable area.
1147 static const CENTER = const ScrollAlignment._internal('CENTER'); 1147 static const CENTER = const ScrollAlignment._internal('CENTER');
1148 /// Attempt to align the element to the bottom of the scrollable area. 1148 /// Attempt to align the element to the bottom of the scrollable area.
1149 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1149 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1150 } 1150 }
OLDNEW
« no previous file with comments | « tests/html/node_test.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698