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

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

Side-by-side diff isn't available for this file because of its large size.
Issue 11044023: Finish Listifying html classes. (Closed) Base URL: http://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/idl/dart/dart.idl » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/dart2js/html_dart2js.dart
===================================================================
--- lib/html/dart2js/html_dart2js.dart (revision 13197)
+++ lib/html/dart2js/html_dart2js.dart (working copy)
@@ -322,28 +322,6 @@
// WARNING: Do not edit - generated code.
-/// @domName WebKitAnimationList
-abstract class AnimationList {
-
- /** @domName WebKitAnimationList.length */
- abstract int get length;
-
- /** @domName WebKitAnimationList.item */
- Animation item(int index);
-}
-
-class _AnimationListImpl implements AnimationList native "*WebKitAnimationList" {
-
- final int length;
-
- _AnimationImpl item(int index) 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
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
/// @domName HTMLAppletElement
abstract class AppletElement implements Element {
@@ -22779,7 +22757,7 @@
// WARNING: Do not edit - generated code.
/// @domName SQLResultSetRowList
-abstract class SQLResultSetRowList {
+abstract class SQLResultSetRowList implements List<Map> {
/** @domName SQLResultSetRowList.length */
abstract int get length;
@@ -22788,10 +22766,91 @@
Map item(int index);
}
-class _SQLResultSetRowListImpl implements SQLResultSetRowList native "*SQLResultSetRowList" {
+class _SQLResultSetRowListImpl implements SQLResultSetRowList, JavaScriptIndexingBehavior native "*SQLResultSetRowList" {
final int length;
+ Map operator[](int index) native "return this[index];";
+
+ void operator[]=(int index, Map value) {
+ throw new UnsupportedOperationException("Cannot assign element of immutable List.");
+ }
+ // -- start List<Map> mixins.
+ // Map is the element type.
+
+ // From Iterable<Map>:
+
+ Iterator<Map> 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<Map>(this);
+ }
+
+ // From Collection<Map>:
+
+ void add(Map value) {
+ throw const UnsupportedOperationException("Cannot add to immutable List.");
+ }
+
+ void addLast(Map value) {
+ throw const UnsupportedOperationException("Cannot add to immutable List.");
+ }
+
+ void addAll(Collection<Map> collection) {
+ throw const UnsupportedOperationException("Cannot add to immutable List.");
+ }
+
+ void forEach(void f(Map element)) => _Collections.forEach(this, f);
+
+ Collection map(f(Map element)) => _Collections.map(this, [], f);
+
+ Collection<Map> filter(bool f(Map element)) =>
+ _Collections.filter(this, <Map>[], f);
+
+ bool every(bool f(Map element)) => _Collections.every(this, f);
+
+ bool some(bool f(Map element)) => _Collections.some(this, f);
+
+ bool isEmpty() => this.length == 0;
+
+ // From List<Map>:
+
+ void sort(int compare(Map a, Map b)) {
+ throw const UnsupportedOperationException("Cannot sort immutable List.");
+ }
+
+ int indexOf(Map element, [int start = 0]) =>
+ _Lists.indexOf(this, element, start, this.length);
+
+ int lastIndexOf(Map element, [int start]) {
+ if (start === null) start = length - 1;
+ return _Lists.lastIndexOf(this, element, start);
+ }
+
+ Map last() => this[length - 1];
+
+ Map removeLast() {
+ throw const UnsupportedOperationException("Cannot removeLast on immutable List.");
+ }
+
+ void setRange(int start, int rangeLength, List<Map> 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, [Map initialValue]) {
+ throw const UnsupportedOperationException("Cannot insertRange on immutable List.");
+ }
+
+ List<Map> getRange(int start, int rangeLength) =>
+ _Lists.getRange(this, start, rangeLength, <Map>[]);
+
+ // -- end List<Map> mixins.
+
Map item(int index) {
return _convertNativeToDart_Dictionary(_item_1(index));
}
@@ -35461,6 +35520,94 @@
class _WebGLVertexArrayObjectOESImpl implements WebGLVertexArrayObjectOES native "*WebGLVertexArrayObjectOES" {
}
+
+class _WebKitAnimationListImpl implements List<Animation>, JavaScriptIndexingBehavior native "*WebKitAnimationList" {
+
+ final int length;
+
+ _AnimationImpl operator[](int index) native "return this[index];";
+
+ void operator[]=(int index, _AnimationImpl value) {
+ throw new UnsupportedOperationException("Cannot assign element of immutable List.");
+ }
+ // -- start List<Animation> mixins.
+ // Animation is the element type.
+
+ // From Iterable<Animation>:
+
+ Iterator<Animation> 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<Animation>(this);
+ }
+
+ // From Collection<Animation>:
+
+ void add(Animation value) {
+ throw const UnsupportedOperationException("Cannot add to immutable List.");
+ }
+
+ void addLast(Animation value) {
+ throw const UnsupportedOperationException("Cannot add to immutable List.");
+ }
+
+ void addAll(Collection<Animation> collection) {
+ throw const UnsupportedOperationException("Cannot add to immutable List.");
+ }
+
+ void forEach(void f(Animation element)) => _Collections.forEach(this, f);
+
+ Collection map(f(Animation element)) => _Collections.map(this, [], f);
+
+ Collection<Animation> filter(bool f(Animation element)) =>
+ _Collections.filter(this, <Animation>[], f);
+
+ bool every(bool f(Animation element)) => _Collections.every(this, f);
+
+ bool some(bool f(Animation element)) => _Collections.some(this, f);
+
+ bool isEmpty() => this.length == 0;
+
+ // From List<Animation>:
+
+ void sort(int compare(Animation a, Animation b)) {
+ throw const UnsupportedOperationException("Cannot sort immutable List.");
+ }
+
+ int indexOf(Animation element, [int start = 0]) =>
+ _Lists.indexOf(this, element, start, this.length);
+
+ int lastIndexOf(Animation element, [int start]) {
+ if (start === null) start = length - 1;
+ return _Lists.lastIndexOf(this, element, start);
+ }
+
+ Animation last() => this[length - 1];
+
+ Animation removeLast() {
+ throw const UnsupportedOperationException("Cannot removeLast on immutable List.");
+ }
+
+ void setRange(int start, int rangeLength, List<Animation> 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, [Animation initialValue]) {
+ throw const UnsupportedOperationException("Cannot insertRange on immutable List.");
+ }
+
+ List<Animation> getRange(int start, int rangeLength) =>
+ _Lists.getRange(this, start, rangeLength, <Animation>[]);
+
+ // -- end List<Animation> mixins.
+
+ _AnimationImpl item(int index) 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
// BSD-style license that can be found in the LICENSE file.
« no previous file with comments | « no previous file | lib/html/dartium/html_dartium.dart » ('j') | lib/html/idl/dart/dart.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698