Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 | 207 |
| 208 int indexOf(Element element, [int start = 0]) { | 208 int indexOf(Element element, [int start = 0]) { |
| 209 return Lists.indexOf(this, element, start, this.length); | 209 return Lists.indexOf(this, element, start, this.length); |
| 210 } | 210 } |
| 211 | 211 |
| 212 int lastIndexOf(Element element, [int start = null]) { | 212 int lastIndexOf(Element element, [int start = null]) { |
| 213 if (start == null) start = length - 1; | 213 if (start == null) start = length - 1; |
| 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) { | |
| 218 if (index < 0 || index > length) throw RangeError(index); | |
| 219 if (index == length) { | |
| 220 _element.$dom_appendChild(element); | |
| 221 } else { | |
| 222 throw new UnimplementedError("insert on ElementLists"); | |
|
Lasse Reichstein Nielsen
2013/03/07 09:57:53
Can you use:
_element.$dom_insertBefore(element,
floitsch
2013/03/07 12:53:53
No. doesn't exist in Dart yet. That's why I added
blois
2013/03/08 02:32:40
I would leave this as unsupported for now. I can i
| |
| 223 } | |
| 224 } | |
| 225 | |
| 217 void clear() { | 226 void clear() { |
| 218 // It is unclear if we want to keep non element nodes? | 227 // It is unclear if we want to keep non element nodes? |
| 219 _element.text = ''; | 228 _element.text = ''; |
| 220 } | 229 } |
| 221 | 230 |
| 222 Element removeAt(int index) { | 231 Element removeAt(int index) { |
| 223 final result = this[index]; | 232 final result = this[index]; |
| 224 if (result != null) { | 233 if (result != null) { |
| 225 _element.$dom_removeChild(result); | 234 _element.$dom_removeChild(result); |
| 226 } | 235 } |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1123 const ScrollAlignment._internal(this._value); | 1132 const ScrollAlignment._internal(this._value); |
| 1124 toString() => 'ScrollAlignment.$_value'; | 1133 toString() => 'ScrollAlignment.$_value'; |
| 1125 | 1134 |
| 1126 /// Attempt to align the element to the top of the scrollable area. | 1135 /// Attempt to align the element to the top of the scrollable area. |
| 1127 static const TOP = const ScrollAlignment._internal('TOP'); | 1136 static const TOP = const ScrollAlignment._internal('TOP'); |
| 1128 /// Attempt to center the element in the scrollable area. | 1137 /// Attempt to center the element in the scrollable area. |
| 1129 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1138 static const CENTER = const ScrollAlignment._internal('CENTER'); |
| 1130 /// Attempt to align the element to the bottom of the scrollable area. | 1139 /// Attempt to align the element to the bottom of the scrollable area. |
| 1131 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1140 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
| 1132 } | 1141 } |
| OLD | NEW |