| 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 extends ListBase<Element> { | 9 class _ChildrenElementList extends ListBase<Element> { |
| 10 // Raw Element. | 10 // Raw Element. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 dynamic fold(dynamic initialValue, | 164 dynamic fold(dynamic initialValue, |
| 165 dynamic combine(dynamic previousValue, Element element)) { | 165 dynamic combine(dynamic previousValue, Element element)) { |
| 166 return _childElements.fold(initialValue, combine); | 166 return _childElements.fold(initialValue, combine); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void setRange(int start, int end, Iterable<Element> iterable, | 169 void setRange(int start, int end, Iterable<Element> iterable, |
| 170 [int skipCount = 0]) { | 170 [int skipCount = 0]) { |
| 171 throw new UnimplementedError(); | 171 throw new UnimplementedError(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void replaceRange(int start, int end, Iterable<Element> iterable) { |
| 175 throw new UnimplementedError(); |
| 176 } |
| 177 |
| 178 void fillRange(int start, int end, [Element fillValue]) { |
| 179 throw new UnimplementedError(); |
| 180 } |
| 181 |
| 174 void remove(Object object) { | 182 void remove(Object object) { |
| 175 if (object is Element) { | 183 if (object is Element) { |
| 176 Element element = object; | 184 Element element = object; |
| 177 if (identical(element.parentNode, _element)) { | 185 if (identical(element.parentNode, _element)) { |
| 178 _element.$dom_removeChild(element); | 186 _element.$dom_removeChild(element); |
| 179 } | 187 } |
| 180 } | 188 } |
| 181 } | 189 } |
| 182 | 190 |
| 183 void removeWhere(bool test(Element element)) { | 191 void removeWhere(bool test(Element element)) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 214 if (index < 0 || index > length) { | 222 if (index < 0 || index > length) { |
| 215 throw new RangeError.range(index, 0, length); | 223 throw new RangeError.range(index, 0, length); |
| 216 } | 224 } |
| 217 if (index == length) { | 225 if (index == length) { |
| 218 _element.append(element); | 226 _element.append(element); |
| 219 } else { | 227 } else { |
| 220 _element.insertBefore(element, this[index]); | 228 _element.insertBefore(element, this[index]); |
| 221 } | 229 } |
| 222 } | 230 } |
| 223 | 231 |
| 232 void insertAll(int index, Iterable<Element> iterable) { |
| 233 throw new UnimplementedError(); |
| 234 } |
| 235 |
| 236 void setAll(int index, Iterable<Element> iterable) { |
| 237 throw new UnimplementedError(); |
| 238 } |
| 239 |
| 224 void clear() { | 240 void clear() { |
| 225 // It is unclear if we want to keep non element nodes? | 241 // It is unclear if we want to keep non element nodes? |
| 226 _element.text = ''; | 242 _element.text = ''; |
| 227 } | 243 } |
| 228 | 244 |
| 229 Element removeAt(int index) { | 245 Element removeAt(int index) { |
| 230 final result = this[index]; | 246 final result = this[index]; |
| 231 if (result != null) { | 247 if (result != null) { |
| 232 _element.$dom_removeChild(result); | 248 _element.$dom_removeChild(result); |
| 233 } | 249 } |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 const ScrollAlignment._internal(this._value); | 977 const ScrollAlignment._internal(this._value); |
| 962 toString() => 'ScrollAlignment.$_value'; | 978 toString() => 'ScrollAlignment.$_value'; |
| 963 | 979 |
| 964 /// Attempt to align the element to the top of the scrollable area. | 980 /// Attempt to align the element to the top of the scrollable area. |
| 965 static const TOP = const ScrollAlignment._internal('TOP'); | 981 static const TOP = const ScrollAlignment._internal('TOP'); |
| 966 /// Attempt to center the element in the scrollable area. | 982 /// Attempt to center the element in the scrollable area. |
| 967 static const CENTER = const ScrollAlignment._internal('CENTER'); | 983 static const CENTER = const ScrollAlignment._internal('CENTER'); |
| 968 /// Attempt to align the element to the bottom of the scrollable area. | 984 /// Attempt to align the element to the bottom of the scrollable area. |
| 969 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 985 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
| 970 } | 986 } |
| OLD | NEW |