Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /// The Dart HTML library. | 1 /// The Dart HTML library. |
| 2 library dart.dom.html; | 2 library dart.dom.html; |
| 3 | 3 |
| 4 import 'dart:async'; | 4 import 'dart:async'; |
| 5 import 'dart:collection'; | 5 import 'dart:collection'; |
| 6 import 'dart:_collection-dev'; | 6 import 'dart:_collection-dev'; |
| 7 import 'dart:html_common'; | 7 import 'dart:html_common'; |
| 8 import 'dart:indexed_db'; | 8 import 'dart:indexed_db'; |
| 9 import 'dart:isolate'; | 9 import 'dart:isolate'; |
| 10 import 'dart:json' as json; | 10 import 'dart:json' as json; |
| (...skipping 7911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7922 Element get single { | 7922 Element get single { |
| 7923 if (length > 1) throw new StateError("More than one element"); | 7923 if (length > 1) throw new StateError("More than one element"); |
| 7924 return first; | 7924 return first; |
| 7925 } | 7925 } |
| 7926 } | 7926 } |
| 7927 | 7927 |
| 7928 // TODO(jacobr): this is an inefficient implementation but it is hard to see | 7928 // TODO(jacobr): this is an inefficient implementation but it is hard to see |
| 7929 // a better option given that we cannot quite force NodeList to be an | 7929 // a better option given that we cannot quite force NodeList to be an |
| 7930 // ElementList as there are valid cases where a NodeList JavaScript object | 7930 // ElementList as there are valid cases where a NodeList JavaScript object |
| 7931 // contains Node objects that are not Elements. | 7931 // contains Node objects that are not Elements. |
| 7932 class _FrozenElementList extends ListBase<Element> { | 7932 class _FrozenElementList<T extends Element> extends ListBase<T> { |
|
Jennifer Messerly
2013/04/27 01:06:58
this was auto-regenerated when I ran ./go.sh
| |
| 7933 final List<Node> _nodeList; | 7933 final List<Node> _nodeList; |
| 7934 | 7934 |
| 7935 _FrozenElementList._wrap(this._nodeList); | 7935 _FrozenElementList._wrap(this._nodeList); |
| 7936 | 7936 |
| 7937 int get length => _nodeList.length; | 7937 int get length => _nodeList.length; |
| 7938 | 7938 |
| 7939 Element operator [](int index) => _nodeList[index]; | 7939 Element operator [](int index) => _nodeList[index]; |
| 7940 | 7940 |
| 7941 void operator []=(int index, Element value) { | 7941 void operator []=(int index, Element value) { |
| 7942 throw new UnsupportedError('Cannot modify list'); | 7942 throw new UnsupportedError('Cannot modify list'); |
| (...skipping 10591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 18534 | 18534 |
| 18535 @DomName('HTMLSelectElement.setCustomValidity') | 18535 @DomName('HTMLSelectElement.setCustomValidity') |
| 18536 @DocsEditable | 18536 @DocsEditable |
| 18537 void setCustomValidity(String error) native; | 18537 void setCustomValidity(String error) native; |
| 18538 | 18538 |
| 18539 | 18539 |
| 18540 // Override default options, since IE returns SelectElement itself and it | 18540 // Override default options, since IE returns SelectElement itself and it |
| 18541 // does not operate as a List. | 18541 // does not operate as a List. |
| 18542 List<OptionElement> get options { | 18542 List<OptionElement> get options { |
| 18543 var options = this.children.where((e) => e is OptionElement).toList(); | 18543 var options = this.children.where((e) => e is OptionElement).toList(); |
| 18544 return new UnmodifiableListView<OptionElement>(options); | 18544 return new UnmodifiableListView(options); |
| 18545 } | 18545 } |
| 18546 | 18546 |
| 18547 List<OptionElement> get selectedOptions { | 18547 List<OptionElement> get selectedOptions { |
| 18548 // IE does not change the selected flag for single-selection items. | 18548 // IE does not change the selected flag for single-selection items. |
| 18549 if (this.multiple) { | 18549 if (this.multiple) { |
| 18550 var options = this.options.where((o) => o.selected).toList(); | 18550 var options = this.options.where((o) => o.selected).toList(); |
| 18551 return new UnmodifiableListView<OptionElement>(options); | 18551 return new UnmodifiableListView(options); |
| 18552 } else { | 18552 } else { |
| 18553 return [this.options[this.selectedIndex]]; | 18553 return [this.options[this.selectedIndex]]; |
| 18554 } | 18554 } |
| 18555 } | 18555 } |
| 18556 } | 18556 } |
| 18557 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 18557 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 18558 // for details. All rights reserved. Use of this source code is governed by a | 18558 // for details. All rights reserved. Use of this source code is governed by a |
| 18559 // BSD-style license that can be found in the LICENSE file. | 18559 // BSD-style license that can be found in the LICENSE file. |
| 18560 | 18560 |
| 18561 | 18561 |
| (...skipping 11030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 29592 _position = nextPosition; | 29592 _position = nextPosition; |
| 29593 return true; | 29593 return true; |
| 29594 } | 29594 } |
| 29595 _current = null; | 29595 _current = null; |
| 29596 _position = _array.length; | 29596 _position = _array.length; |
| 29597 return false; | 29597 return false; |
| 29598 } | 29598 } |
| 29599 | 29599 |
| 29600 T get current => _current; | 29600 T get current => _current; |
| 29601 } | 29601 } |
| OLD | NEW |