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

Unified Diff: lib/html/dart2js/html_dart2js.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 11055009: Converting NodeList to List<Node>. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « no previous file | lib/html/dartium/html_dartium.dart » ('j') | lib/html/scripts/systemhtml.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/dart2js/html_dart2js.dart
diff --git a/lib/html/dart2js/html_dart2js.dart b/lib/html/dart2js/html_dart2js.dart
index 0e09f21b16158ba8f12e9f027c0961ad89f726f9..cb15b7f86da21451b4e7fb38a550b8c0a401f61d 100644
--- a/lib/html/dart2js/html_dart2js.dart
+++ b/lib/html/dart2js/html_dart2js.dart
@@ -1658,7 +1658,7 @@ abstract class ButtonElement implements Element {
String formTarget;
/** @domName HTMLButtonElement.labels */
- abstract NodeList get labels;
+ abstract List<Node> get labels;
/** @domName HTMLButtonElement.name */
String name;
@@ -1703,7 +1703,7 @@ class _ButtonElementImpl extends _ElementImpl implements ButtonElement native "*
String formTarget;
- final _NodeListImpl labels;
+ final List<Node> labels;
String name;
@@ -10247,13 +10247,13 @@ abstract class Document extends HtmlElement {
Element $dom_getElementById(String elementId);
/** @domName Document.getElementsByClassName */
- NodeList $dom_getElementsByClassName(String tagname);
+ List<Node> $dom_getElementsByClassName(String tagname);
/** @domName Document.getElementsByName */
- NodeList $dom_getElementsByName(String elementName);
+ List<Node> $dom_getElementsByName(String elementName);
/** @domName Document.getElementsByTagName */
- NodeList $dom_getElementsByTagName(String tagname);
+ List<Node> $dom_getElementsByTagName(String tagname);
/** @domName Document.queryCommandEnabled */
bool queryCommandEnabled(String command);
@@ -10274,7 +10274,7 @@ abstract class Document extends HtmlElement {
Element $dom_querySelector(String selectors);
/** @domName Document.querySelectorAll */
- NodeList $dom_querySelectorAll(String selectors);
+ List<Node> $dom_querySelectorAll(String selectors);
/** @domName Document.webkitCancelFullScreen */
void webkitCancelFullScreen();
@@ -10418,7 +10418,7 @@ abstract class DocumentFragment extends Element {
Element $dom_querySelector(String selectors);
/** @domName DocumentFragment.querySelectorAll */
- NodeList $dom_querySelectorAll(String selectors);
+ List<Node> $dom_querySelectorAll(String selectors);
}
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
@@ -10427,7 +10427,7 @@ abstract class DocumentFragment extends Element {
class _FilteredElementList implements List {
final Node _node;
- final NodeList _childNodes;
+ final List<Node> _childNodes;
_FilteredElementList(Node node): _childNodes = node.nodes, _node = node;
@@ -10782,7 +10782,7 @@ class _DocumentFragmentImpl extends _NodeImpl implements DocumentFragment native
_ElementImpl $dom_querySelector(String selectors) native "querySelector";
- _NodeListImpl $dom_querySelectorAll(String selectors) native "querySelectorAll";
+ List<Node> $dom_querySelectorAll(String selectors) native "querySelectorAll";
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
@@ -10873,11 +10873,11 @@ class _DocumentImpl extends _NodeImpl implements Document
_ElementImpl $dom_getElementById(String elementId) native "getElementById";
- _NodeListImpl $dom_getElementsByClassName(String tagname) native "getElementsByClassName";
+ List<Node> $dom_getElementsByClassName(String tagname) native "getElementsByClassName";
- _NodeListImpl $dom_getElementsByName(String elementName) native "getElementsByName";
+ List<Node> $dom_getElementsByName(String elementName) native "getElementsByName";
- _NodeListImpl $dom_getElementsByTagName(String tagname) native "getElementsByTagName";
+ List<Node> $dom_getElementsByTagName(String tagname) native "getElementsByTagName";
bool queryCommandEnabled(String command) native;
@@ -10891,7 +10891,7 @@ class _DocumentImpl extends _NodeImpl implements Document
_ElementImpl $dom_querySelector(String selectors) native "querySelector";
- _NodeListImpl $dom_querySelectorAll(String selectors) native "querySelectorAll";
+ List<Node> $dom_querySelectorAll(String selectors) native "querySelectorAll";
void webkitCancelFullScreen() native;
@@ -11405,10 +11405,10 @@ abstract class Element implements Node, NodeSelector {
List<ClientRect> $dom_getClientRects();
/** @domName Element.getElementsByClassName */
- NodeList $dom_getElementsByClassName(String name);
+ List<Node> $dom_getElementsByClassName(String name);
/** @domName Element.getElementsByTagName */
- NodeList $dom_getElementsByTagName(String name);
+ List<Node> $dom_getElementsByTagName(String name);
/** @domName Element.hasAttribute */
bool $dom_hasAttribute(String name);
@@ -11417,7 +11417,7 @@ abstract class Element implements Node, NodeSelector {
Element $dom_querySelector(String selectors);
/** @domName Element.querySelectorAll */
- NodeList $dom_querySelectorAll(String selectors);
+ List<Node> $dom_querySelectorAll(String selectors);
/** @domName Element.remove */
void remove();
@@ -12436,15 +12436,15 @@ class _ElementImpl extends _NodeImpl implements Element native "*Element" {
_ClientRectListImpl $dom_getClientRects() native "getClientRects";
- _NodeListImpl $dom_getElementsByClassName(String name) native "getElementsByClassName";
+ List<Node> $dom_getElementsByClassName(String name) native "getElementsByClassName";
- _NodeListImpl $dom_getElementsByTagName(String name) native "getElementsByTagName";
+ List<Node> $dom_getElementsByTagName(String name) native "getElementsByTagName";
bool $dom_hasAttribute(String name) native "hasAttribute";
_ElementImpl $dom_querySelector(String selectors) native "querySelector";
- _NodeListImpl $dom_querySelectorAll(String selectors) native "querySelectorAll";
+ List<Node> $dom_querySelectorAll(String selectors) native "querySelectorAll";
void $dom_removeAttribute(String name) native "removeAttribute";
@@ -15001,7 +15001,7 @@ abstract class HTMLAllCollection implements List<Node> {
Node namedItem(String name);
/** @domName HTMLAllCollection.tags */
- NodeList tags(String name);
+ List<Node> tags(String name);
}
class _HTMLAllCollectionImpl implements HTMLAllCollection, JavaScriptIndexingBehavior native "*HTMLAllCollection" {
@@ -15093,7 +15093,7 @@ class _HTMLAllCollectionImpl implements HTMLAllCollection, JavaScriptIndexingBeh
_NodeImpl namedItem(String name) native;
- _NodeListImpl tags(String name) native;
+ List<Node> tags(String name) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -17256,7 +17256,7 @@ abstract class InputElement implements Element {
bool indeterminate;
/** @domName HTMLInputElement.labels */
- abstract NodeList get labels;
+ abstract List<Node> get labels;
/** @domName HTMLInputElement.list */
abstract Element get list;
@@ -17412,7 +17412,7 @@ class _InputElementImpl extends _ElementImpl implements InputElement native "*HT
bool indeterminate;
- final _NodeListImpl labels;
+ final List<Node> labels;
final _ElementImpl list;
@@ -18057,7 +18057,7 @@ abstract class KeygenElement implements Element {
String keytype;
/** @domName HTMLKeygenElement.labels */
- abstract NodeList get labels;
+ abstract List<Node> get labels;
/** @domName HTMLKeygenElement.name */
String name;
@@ -18093,7 +18093,7 @@ class _KeygenElementImpl extends _ElementImpl implements KeygenElement native "*
String keytype;
- final _NodeListImpl labels;
+ final List<Node> labels;
String name;
@@ -19827,7 +19827,7 @@ abstract class MeterElement implements Element {
num high;
/** @domName HTMLMeterElement.labels */
- abstract NodeList get labels;
+ abstract List<Node> get labels;
/** @domName HTMLMeterElement.low */
num low;
@@ -19849,7 +19849,7 @@ class _MeterElementImpl extends _ElementImpl implements MeterElement native "*HT
num high;
- final _NodeListImpl labels;
+ final List<Node> labels;
num low;
@@ -20214,7 +20214,7 @@ class _MutationObserverImpl implements MutationObserver native "*MutationObserve
abstract class MutationRecord {
/** @domName MutationRecord.addedNodes */
- abstract NodeList get addedNodes;
+ abstract List<Node> get addedNodes;
/** @domName MutationRecord.attributeName */
abstract String get attributeName;
@@ -20232,7 +20232,7 @@ abstract class MutationRecord {
abstract Node get previousSibling;
/** @domName MutationRecord.removedNodes */
- abstract NodeList get removedNodes;
+ abstract List<Node> get removedNodes;
/** @domName MutationRecord.target */
abstract Node get target;
@@ -20243,7 +20243,7 @@ abstract class MutationRecord {
class _MutationRecordImpl implements MutationRecord native "*MutationRecord" {
- final _NodeListImpl addedNodes;
+ final List<Node> addedNodes;
final String attributeName;
@@ -20255,7 +20255,7 @@ class _MutationRecordImpl implements MutationRecord native "*MutationRecord" {
final _NodeImpl previousSibling;
- final _NodeListImpl removedNodes;
+ final List<Node> removedNodes;
final _NodeImpl target;
@@ -20560,7 +20560,7 @@ typedef bool NavigatorUserMediaSuccessCallback(LocalMediaStream stream);
/// @domName Node
abstract class Node implements EventTarget {
- NodeList get nodes;
+ List<Node> get nodes;
void set nodes(Collection<Node> value);
@@ -20617,7 +20617,7 @@ abstract class Node implements EventTarget {
abstract NamedNodeMap get $dom_attributes;
/** @domName Node.childNodes */
- abstract NodeList get $dom_childNodes;
+ abstract List<Node> get $dom_childNodes;
/** @domName Node.firstChild */
abstract Node get $dom_firstChild;
@@ -20764,7 +20764,7 @@ class _NodeFilterImpl implements NodeFilter native "*NodeFilter" {
* the actual child nodes of an element until strictly necessary greatly
* improving performance for the typical cases where it is not required.
*/
-class _ChildNodeListLazy implements NodeList {
+class _ChildNodeListLazy implements List {
final _NodeImpl _this;
_ChildNodeListLazy(this._this);
@@ -20848,7 +20848,7 @@ class _ChildNodeListLazy implements NodeList {
throw new UnsupportedOperationException(
"Cannot insertRange on immutable List.");
}
- NodeList getRange(int start, int rangeLength) =>
+ List<Node> getRange(int start, int rangeLength) =>
new _NodeListWrapper(_Lists.getRange(this, start, rangeLength, <Node>[]));
// -- end List<Node> mixins.
@@ -20933,7 +20933,7 @@ class _NodeImpl extends _EventTargetImpl implements Node native "*Node" {
_NamedNodeMapImpl get $dom_attributes() native "return this.attributes;";
- _NodeListImpl get $dom_childNodes() native "return this.childNodes;";
+ List<Node> get $dom_childNodes() native "return this.childNodes;";
_NodeImpl get $dom_firstChild() native "return this.firstChild;";
@@ -21040,9 +21040,9 @@ class _NodeIteratorImpl implements NodeIterator native "*NodeIterator" {
/// @domName NodeList
abstract class NodeList implements List<Node> {
- NodeList filter(bool f(Node element));
+ List<Node> filter(bool f(Node element));
- NodeList getRange(int start, int length);
+ List<Node> getRange(int start, int length);
Node get first;
@@ -21122,7 +21122,7 @@ class _ListWrapper<E> implements List<E> {
* This class is used to insure the results of list operations are NodeLists
* instead of lists.
*/
-class _NodeListWrapper extends _ListWrapper<Node> implements NodeList {
+class _NodeListWrapper extends _ListWrapper<Node> implements List {
_NodeListWrapper(List list) : super(list);
List<Node> filter(bool f(Node element)) =>
@@ -21835,7 +21835,7 @@ abstract class OutputElement implements Element {
DOMSettableTokenList htmlFor;
/** @domName HTMLOutputElement.labels */
- abstract NodeList get labels;
+ abstract List<Node> get labels;
/** @domName HTMLOutputElement.name */
String name;
@@ -21870,7 +21870,7 @@ class _OutputElementImpl extends _ElementImpl implements OutputElement native "*
_DOMSettableTokenListImpl htmlFor;
- final _NodeListImpl labels;
+ final List<Node> labels;
String name;
@@ -22589,7 +22589,7 @@ abstract class ProgressElement implements Element {
factory ProgressElement() => _Elements.createProgressElement();
/** @domName HTMLProgressElement.labels */
- abstract NodeList get labels;
+ abstract List<Node> get labels;
/** @domName HTMLProgressElement.max */
num max;
@@ -22603,7 +22603,7 @@ abstract class ProgressElement implements Element {
class _ProgressElementImpl extends _ElementImpl implements ProgressElement native "*HTMLProgressElement" {
- final _NodeListImpl labels;
+ final List<Node> labels;
num max;
@@ -22946,96 +22946,15 @@ class _RTCSessionDescriptionImpl implements RTCSessionDescription native "*RTCSe
// WARNING: Do not edit - generated code.
/// @domName RadioNodeList
-abstract class RadioNodeList implements NodeList, List<Node> {
+abstract class RadioNodeList implements List<Node> {
/** @domName RadioNodeList.value */
String value;
}
-class _RadioNodeListImpl extends _NodeListImpl implements RadioNodeList, JavaScriptIndexingBehavior native "*RadioNodeList" {
+class _RadioNodeListImpl extends _NodeListImpl implements RadioNodeList native "*RadioNodeList" {
String value;
-
- _NodeImpl operator[](int index) native "return this[index];";
-
- void operator[]=(int index, _NodeImpl value) {
- throw new UnsupportedOperationException("Cannot assign element of immutable List.");
- }
- // -- start List<Node> mixins.
- // Node is the element type.
-
- // From Iterable<Node>:
-
- Iterator<Node> iterator() {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new _FixedSizeListIterator<Node>(this);
- }
-
- // From Collection<Node>:
-
- void add(Node value) {
- throw const UnsupportedOperationException("Cannot add to immutable List.");
- }
-
- void addLast(Node value) {
- throw const UnsupportedOperationException("Cannot add to immutable List.");
- }
-
- void addAll(Collection<Node> collection) {
- throw const UnsupportedOperationException("Cannot add to immutable List.");
- }
-
- void forEach(void f(Node element)) => _Collections.forEach(this, f);
-
- Collection map(f(Node element)) => _Collections.map(this, [], f);
-
- Collection<Node> filter(bool f(Node element)) =>
- _Collections.filter(this, <Node>[], f);
-
- bool every(bool f(Node element)) => _Collections.every(this, f);
-
- bool some(bool f(Node element)) => _Collections.some(this, f);
-
- bool isEmpty() => this.length == 0;
-
- // From List<Node>:
-
- void sort(int compare(Node a, Node b)) {
- throw const UnsupportedOperationException("Cannot sort immutable List.");
- }
-
- int indexOf(Node element, [int start = 0]) =>
- _Lists.indexOf(this, element, start, this.length);
-
- int lastIndexOf(Node element, [int start]) {
- if (start === null) start = length - 1;
- return _Lists.lastIndexOf(this, element, start);
- }
-
- Node last() => this[length - 1];
-
- Node removeLast() {
- throw const UnsupportedOperationException("Cannot removeLast on immutable List.");
- }
-
- void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
- throw const UnsupportedOperationException("Cannot setRange on immutable List.");
- }
-
- void removeRange(int start, int rangeLength) {
- throw const UnsupportedOperationException("Cannot removeRange on immutable List.");
- }
-
- void insertRange(int start, int rangeLength, [Node initialValue]) {
- throw const UnsupportedOperationException("Cannot insertRange on immutable List.");
- }
-
- List<Node> getRange(int start, int rangeLength) =>
- _Lists.getRange(this, start, rangeLength, <Node>[]);
-
- // -- end List<Node> mixins.
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -29645,10 +29564,10 @@ abstract class SVGSVGElement extends SVGElement implements SVGTests, SVGLangSpac
Element getElementById(String elementId);
/** @domName SVGSVGElement.getEnclosureList */
- NodeList getEnclosureList(SVGRect rect, SVGElement referenceElement);
+ List<Node> getEnclosureList(SVGRect rect, SVGElement referenceElement);
/** @domName SVGSVGElement.getIntersectionList */
- NodeList getIntersectionList(SVGRect rect, SVGElement referenceElement);
+ List<Node> getIntersectionList(SVGRect rect, SVGElement referenceElement);
/** @domName SVGSVGElement.pauseAnimations */
void pauseAnimations();
@@ -29732,9 +29651,9 @@ class _SVGSVGElementImpl extends _SVGElementImpl implements SVGSVGElement native
_ElementImpl getElementById(String elementId) native;
- _NodeListImpl getEnclosureList(_SVGRectImpl rect, _SVGElementImpl referenceElement) native;
+ List<Node> getEnclosureList(_SVGRectImpl rect, _SVGElementImpl referenceElement) native;
- _NodeListImpl getIntersectionList(_SVGRectImpl rect, _SVGElementImpl referenceElement) native;
+ List<Node> getIntersectionList(_SVGRectImpl rect, _SVGElementImpl referenceElement) native;
void pauseAnimations() native;
@@ -31193,7 +31112,7 @@ abstract class SelectElement implements Element {
abstract FormElement get form;
/** @domName HTMLSelectElement.labels */
- abstract NodeList get labels;
+ abstract List<Node> get labels;
/** @domName HTMLSelectElement.length */
int length;
@@ -31255,7 +31174,7 @@ class _SelectElementImpl extends _ElementImpl implements SelectElement native "*
final _FormElementImpl form;
- final _NodeListImpl labels;
+ final List<Node> labels;
int length;
@@ -31357,10 +31276,10 @@ abstract class ShadowRoot implements DocumentFragment {
Element $dom_getElementById(String elementId);
/** @domName ShadowRoot.getElementsByClassName */
- NodeList $dom_getElementsByClassName(String className);
+ List<Node> $dom_getElementsByClassName(String className);
/** @domName ShadowRoot.getElementsByTagName */
- NodeList $dom_getElementsByTagName(String tagName);
+ List<Node> $dom_getElementsByTagName(String tagName);
/** @domName ShadowRoot.getSelection */
DOMSelection getSelection();
@@ -31387,9 +31306,9 @@ class _ShadowRootImpl extends _DocumentFragmentImpl implements ShadowRoot native
_ElementImpl $dom_getElementById(String elementId) native "getElementById";
- _NodeListImpl $dom_getElementsByClassName(String className) native "getElementsByClassName";
+ List<Node> $dom_getElementsByClassName(String className) native "getElementsByClassName";
- _NodeListImpl $dom_getElementsByTagName(String tagName) native "getElementsByTagName";
+ List<Node> $dom_getElementsByTagName(String tagName) native "getElementsByTagName";
_DOMSelectionImpl getSelection() native;
@@ -33109,7 +33028,7 @@ abstract class TextAreaElement implements Element {
abstract FormElement get form;
/** @domName HTMLTextAreaElement.labels */
- abstract NodeList get labels;
+ abstract List<Node> get labels;
/** @domName HTMLTextAreaElement.maxLength */
int maxLength;
@@ -33184,7 +33103,7 @@ class _TextAreaElementImpl extends _ElementImpl implements TextAreaElement nativ
final _FormElementImpl form;
- final _NodeListImpl labels;
+ final List<Node> labels;
int maxLength;
@@ -37209,13 +37128,13 @@ abstract class WebKitNamedFlow implements EventTarget {
bool $dom_dispatchEvent(Event event);
/** @domName WebKitNamedFlow.getContent */
- NodeList getContent();
+ List<Node> getContent();
/** @domName WebKitNamedFlow.getRegions */
- NodeList getRegions();
+ List<Node> getRegions();
/** @domName WebKitNamedFlow.getRegionsByContent */
- NodeList getRegionsByContent(Node contentNode);
+ List<Node> getRegionsByContent(Node contentNode);
/** @domName WebKitNamedFlow.removeEventListener */
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]);
@@ -37233,11 +37152,11 @@ class _WebKitNamedFlowImpl extends _EventTargetImpl implements WebKitNamedFlow n
bool $dom_dispatchEvent(_EventImpl event) native "dispatchEvent";
- _NodeListImpl getContent() native;
+ List<Node> getContent() native;
- _NodeListImpl getRegions() native;
+ List<Node> getRegions() native;
- _NodeListImpl getRegionsByContent(_NodeImpl contentNode) native;
+ List<Node> getRegionsByContent(_NodeImpl contentNode) native;
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "removeEventListener";
}
« no previous file with comments | « no previous file | lib/html/dartium/html_dartium.dart » ('j') | lib/html/scripts/systemhtml.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698