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

Unified Diff: client/dom/templates/html/impl/impl_Node.darttemplate

Issue 9537001: Generate dart:html bindings for Dartium as well as Frog. All unittests now pass (or are disabled fo… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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:
View side-by-side diff with in-line comments
Download patch
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
+}

Powered by Google App Engine
This is Rietveld 408576698