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

Side by Side Diff: client/html/src/ElementWrappingImplementation.dart

Issue 8424012: Add optional arguments to our indexOf/lastIndexOf methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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
OLDNEW
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 // TODO(jacobr): use Lists.dart to remove some of the duplicated functionality. 5 // TODO(jacobr): use Lists.dart to remove some of the duplicated functionality.
6 class _ChildrenElementList implements ElementList { 6 class _ChildrenElementList implements ElementList {
7 // Raw Element. 7 // Raw Element.
8 final _element; 8 final _element;
9 final _childElements; 9 final _childElements;
10 10
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 void insertRange(int start, int length, [initialValue = null]) { 113 void insertRange(int start, int length, [initialValue = null]) {
114 throw const NotImplementedException(); 114 throw const NotImplementedException();
115 } 115 }
116 116
117 List getRange(int start, int length) { 117 List getRange(int start, int length) {
118 throw const NotImplementedException(); 118 throw const NotImplementedException();
119 } 119 }
120 120
121 int indexOf(Element element, int startIndex) { 121 int indexOf(Element element, [int start = 0]) {
122 return _Lists.indexOf(this, element, startIndex, this.length); 122 return _Lists.indexOf(this, element, start, this.length);
123 } 123 }
124 124
125 int lastIndexOf(Element element, int startIndex) { 125 int lastIndexOf(Element element, [int start = null]) {
126 return _Lists.lastIndexOf(this, element, startIndex); 126 if (start === null) start = length - 1;
127 return _Lists.lastIndexOf(this, element, start);
127 } 128 }
128 129
129 void clear() { 130 void clear() {
130 // It is unclear if we want to keep non element nodes? 131 // It is unclear if we want to keep non element nodes?
131 _element.textContent = ''; 132 _element.textContent = '';
132 } 133 }
133 134
134 Element removeLast() { 135 Element removeLast() {
135 final last = this.last(); 136 final last = this.last();
136 if (last != null) { 137 if (last != null) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 224 }
224 225
225 void insertRange(int start, int length, [initialValue = null]) { 226 void insertRange(int start, int length, [initialValue = null]) {
226 throw const NotImplementedException(); 227 throw const NotImplementedException();
227 } 228 }
228 229
229 List getRange(int start, int length) { 230 List getRange(int start, int length) {
230 throw const NotImplementedException(); 231 throw const NotImplementedException();
231 } 232 }
232 233
233 int indexOf(Element element, int startIndex) { 234 int indexOf(Element element, [int start = 0]) {
234 throw 'Not impl yet. todo(jacobr)'; 235 throw 'Not impl yet. todo(jacobr)';
235 } 236 }
236 237
237 int lastIndexOf(Element element, int startIndex) { 238 int lastIndexOf(Element element, [int start = null]) {
238 throw 'Not impl yet. todo(jacobr)'; 239 throw 'Not impl yet. todo(jacobr)';
239 } 240 }
240 241
241 void clear() { 242 void clear() {
242 throw 'Not impl yet. todo(jacobr)'; 243 throw 'Not impl yet. todo(jacobr)';
243 } 244 }
244 245
245 Element removeLast() { 246 Element removeLast() {
246 throw 'Not impl yet. todo(jacobr)'; 247 throw 'Not impl yet. todo(jacobr)';
247 } 248 }
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 return _ptr.webkitMatchesSelector(selectors); 650 return _ptr.webkitMatchesSelector(selectors);
650 } 651 }
651 652
652 ElementEvents get on() { 653 ElementEvents get on() {
653 if (_on === null) { 654 if (_on === null) {
654 _on = new ElementEventsImplementation._wrap(_ptr); 655 _on = new ElementEventsImplementation._wrap(_ptr);
655 } 656 }
656 return _on; 657 return _on;
657 } 658 }
658 } 659 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698