| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 class _ChildrenNodeList implements NodeList { | 5 class _ChildrenNodeList implements NodeList { |
| 6 // Raw node. | 6 // Raw node. |
| 7 final _node; | 7 final _node; |
| 8 final _childNodes; | 8 final _childNodes; |
| 9 | 9 |
| 10 _ChildrenNodeList._wrap(var node) | 10 _ChildrenNodeList._wrap(var node) |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 114 } |
| 115 | 115 |
| 116 void insertRange(int start, int length, [initialValue = null]) { | 116 void insertRange(int start, int length, [initialValue = null]) { |
| 117 throw const NotImplementedException(); | 117 throw const NotImplementedException(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 List getRange(int start, int length) { | 120 List getRange(int start, int length) { |
| 121 throw const NotImplementedException(); | 121 throw const NotImplementedException(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 int indexOf(Node element, int startIndex) { | 124 int indexOf(Node element, [int start = 0]) { |
| 125 return _Lists.indexOf(this, element, startIndex, this.length); | 125 return _Lists.indexOf(this, element, start, this.length); |
| 126 } | 126 } |
| 127 | 127 |
| 128 int lastIndexOf(Node element, int startIndex) { | 128 int lastIndexOf(Node element, [int start = null]) { |
| 129 return _Lists.lastIndexOf(this, element, startIndex); | 129 if (start === null) start = length - 1; |
| 130 return _Lists.lastIndexOf(this, element, start); |
| 130 } | 131 } |
| 131 | 132 |
| 132 void clear() { | 133 void clear() { |
| 133 _node.textContent = ''; | 134 _node.textContent = ''; |
| 134 } | 135 } |
| 135 | 136 |
| 136 Node removeLast() { | 137 Node removeLast() { |
| 137 final last = this.last(); | 138 final last = this.last(); |
| 138 if (last != null) { | 139 if (last != null) { |
| 139 _node.removeChild(LevelDom.unwrap(last)); | 140 _node.removeChild(LevelDom.unwrap(last)); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // array. | 209 // array. |
| 209 Node insertBefore(Node newChild, Node refChild) { | 210 Node insertBefore(Node newChild, Node refChild) { |
| 210 return LevelDom.wrapNode(_ptr.insertBefore( | 211 return LevelDom.wrapNode(_ptr.insertBefore( |
| 211 LevelDom.unwrap(newChild), LevelDom.unwrap(refChild))); | 212 LevelDom.unwrap(newChild), LevelDom.unwrap(refChild))); |
| 212 } | 213 } |
| 213 | 214 |
| 214 Node clone(bool deep) { | 215 Node clone(bool deep) { |
| 215 return LevelDom.wrapNode(_ptr.cloneNode(deep)); | 216 return LevelDom.wrapNode(_ptr.cloneNode(deep)); |
| 216 } | 217 } |
| 217 } | 218 } |
| OLD | NEW |