Index: client/dom/templates/html/impl/impl_Node.darttemplate |
diff --git a/client/dom/templates/html/impl/impl_Node.darttemplate b/client/dom/templates/html/impl/impl_Node.darttemplate |
new file mode 100644 |
index 0000000000000000000000000000000000000000..893b877649bd1e55eb4bda52f196e6d76d9b03dc |
--- /dev/null |
+++ b/client/dom/templates/html/impl/impl_Node.darttemplate |
@@ -0,0 +1,38 @@ |
+// 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. |
+ |
+class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
+ _NodeListImpl get nodes() { |
+ final list = _childNodes; |
+ list._parent = this; |
+ return list; |
+ } |
+ |
+ void set nodes(Collection<Node> value) { |
+ // Copy list first since we don't want liveness during iteration. |
+ // TODO(jacobr): there is a better way to do this. |
+ List copy = new List.from(value); |
+ nodes.clear(); |
+ nodes.addAll(copy); |
+ } |
+ |
+ // TODO(jacobr): should we throw an exception if parent is already null? |
+ _NodeImpl remove() { |
+ if (this.parent != null) { |
+ this.parent._removeChild(this); |
+ } |
+ return this; |
+ } |
+ |
+ _NodeImpl replaceWith(Node otherNode) { |
+ try { |
+ this.parent._replaceChild(otherNode, this); |
+ } catch(var e) { |
+ |
+ }; |
+ return this; |
+ } |
+ |
+$!MEMBERS |
+} |