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

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

Side-by-side diff isn't available for this file because of its large size.
Issue 46433003: Exposing raw DOM lists from wrappers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Covering FilteredElementList Created 7 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:
Download patch
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index ead17afde323d0f72016ee7e5dcbd52d18e7978e..6ef98dd4e5545e87a8596d87ae754e127d4f48c7 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -7890,7 +7890,8 @@ class DomTokenList extends Interceptor native "DOMTokenList" {
// BSD-style license that can be found in the LICENSE file.
-class _ChildrenElementList extends ListBase<Element> {
+class _ChildrenElementList extends ListBase<Element>
+ implements NodeListWrapper {
// Raw Element.
final Element _element;
final HtmlCollection _childElements;
@@ -8043,6 +8044,8 @@ class _ChildrenElementList extends ListBase<Element> {
if (length > 1) throw new StateError("More than one element");
return first;
}
+
+ List<Node> get rawList => _childElements;
}
/**
@@ -8368,7 +8371,8 @@ abstract class ElementList<T extends Element> extends ListBase<T> {
// a better option given that we cannot quite force NodeList to be an
// ElementList as there are valid cases where a NodeList JavaScript object
// contains Node objects that are not Elements.
-class _FrozenElementList<T extends Element> extends ListBase<T> implements ElementList {
+class _FrozenElementList<T extends Element> extends ListBase<T>
+ implements ElementList, NodeListWrapper {
final List<Node> _nodeList;
// The subset of _nodeList that are Elements.
List<Element> _elementList;
@@ -8420,6 +8424,9 @@ class _FrozenElementList<T extends Element> extends ListBase<T> implements Eleme
CssRect get marginEdge => _elementList.first.marginEdge;
+ List<Node> get rawList => _nodeList;
+
+
@DomName('Element.onabort')
@DocsEditable()
ElementStream<Event> get onAbort => Element.abortEvent._forElementList(this);
@@ -17308,7 +17315,7 @@ typedef void _NavigatorUserMediaSuccessCallback(MediaStream stream);
* the actual child nodes of an element until strictly necessary greatly
* improving performance for the typical cases where it is not required.
*/
-class _ChildNodeListLazy extends ListBase<Node> {
+class _ChildNodeListLazy extends ListBase<Node> implements NodeListWrapper {
final Node _this;
_ChildNodeListLazy(this._this);
@@ -17460,6 +17467,8 @@ class _ChildNodeListLazy extends ListBase<Node> {
}
Node operator[](int index) => _this.childNodes[index];
+
+ List<Node> get rawList => _this.childNodes;
}
@@ -29202,8 +29211,6 @@ class _JsDeserializer extends _Deserializer {
}
}
-class SendPortSync {}
-
// The receiver is JS.
class _JsSendPortSync implements SendPortSync {
@@ -31294,7 +31301,8 @@ class _WrappedEvent implements Event {
* A list which just wraps another list, for either intercepting list calls or
* retyping the list (for example, from List<A> to List<B> where B extends A).
*/
-class _WrappedList<E> extends ListBase<E> {
+class _WrappedList<E extends Node> extends ListBase<E>
+ implements NodeListWrapper {
final List _list;
_WrappedList(this._list);
@@ -31344,6 +31352,8 @@ class _WrappedList<E> extends ListBase<E> {
void fillRange(int start, int end, [E fillValue]) {
_list.fillRange(start, end, fillValue);
}
+
+ List<Node> get rawList => _list;
}
/**
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | sdk/lib/html/html_common/filtered_element_list.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698