Chromium Code Reviews| 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 // 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 class FrozenElementList implements ElementList { | 148 class FrozenElementList implements ElementList { |
| 149 final _ptr; | 149 final _ptr; |
| 150 | 150 |
| 151 FrozenElementList._wrap(this._ptr); | 151 FrozenElementList._wrap(this._ptr); |
| 152 | 152 |
| 153 Element get first() { | 153 Element get first() { |
| 154 return this[0]; | 154 return this[0]; |
| 155 } | 155 } |
| 156 | 156 |
| 157 void forEach(void f(Element element)) { | 157 void forEach(void f(Element element)) { |
| 158 for (var element in _ptr) { | 158 final length = _ptr.length; |
| 159 f(LevelDom.wrapElement(element)); | 159 for (var i = 0; i < length; i++) { |
|
Jacob
2012/01/10 00:46:19
var ==> int
nweiz
2012/01/10 01:32:51
That seems redundant...
| |
| 160 f(LevelDom.wrapElement(_ptr[i])); | |
| 160 } | 161 } |
| 161 } | 162 } |
| 162 | 163 |
| 163 Collection<Element> filter(bool f(Element element)) { | 164 Collection<Element> filter(bool f(Element element)) { |
| 164 throw 'Not impl yet. todo(jacobr)'; | 165 throw 'Not impl yet. todo(jacobr)'; |
| 165 } | 166 } |
| 166 | 167 |
| 167 bool every(bool f(Element element)) { | 168 bool every(bool f(Element element)) { |
| 168 throw 'Not impl yet. todo(jacobr)'; | 169 throw 'Not impl yet. todo(jacobr)'; |
| 169 } | 170 } |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 760 | 761 |
| 761 ElementEvents get on() { | 762 ElementEvents get on() { |
| 762 if (_on === null) { | 763 if (_on === null) { |
| 763 _on = new ElementEventsImplementation._wrap(_ptr); | 764 _on = new ElementEventsImplementation._wrap(_ptr); |
| 764 } | 765 } |
| 765 return _on; | 766 return _on; |
| 766 } | 767 } |
| 767 | 768 |
| 768 Element clone(bool deep) => super.clone(deep); | 769 Element clone(bool deep) => super.clone(deep); |
| 769 } | 770 } |
| OLD | NEW |