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

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

Issue 12596004: Replaced Element.append with Node.appendChild (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « samples/third_party/dromaeo/tests/dom-traverse-html.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fdd1df8b008e77ef5a4ea6cd91f3eab296d4a3ff..493a1a8cd9840045871fd53081200aef5d12a735 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -6987,7 +6987,7 @@ class DocumentFragment extends Node native "*DocumentFragment" {
String get innerHtml {
final e = new Element.tag("div");
- e.nodes.add(this.clone(true));
+ e.append(this.clone(true));
return e.innerHtml;
}
@@ -7005,19 +7005,11 @@ class DocumentFragment extends Node native "*DocumentFragment" {
}
/**
- * Adds the specified element after the last child of this
- * document fragment.
- */
- void append(Element element) {
- this.children.add(element);
- }
-
- /**
* Adds the specified text as a text node after the last child of this
* document fragment.
*/
void appendText(String text) {
- this.nodes.add(new Text(text));
+ this.append(new Text(text));
}
@@ -7026,7 +7018,7 @@ class DocumentFragment extends Node native "*DocumentFragment" {
* last child of this document fragment.
*/
void appendHtml(String text) {
- this.nodes.add(new DocumentFragment.html(text));
+ this.append(new DocumentFragment.html(text));
}
@@ -8173,7 +8165,7 @@ class _ChildrenElementList implements List {
}
Element add(Element value) {
- _element.$dom_appendChild(value);
+ _element.append(value);
return value;
}
@@ -8187,7 +8179,7 @@ class _ChildrenElementList implements List {
}
for (Element element in iterable) {
- _element.$dom_appendChild(element);
+ _element.append(element);
}
}
@@ -8805,13 +8797,6 @@ abstract class Element extends Node implements ElementTraversal native "*Element
$dom_offsetHeight);
/**
- * Adds the specified element to after the last child of this element.
- */
- void append(Element e) {
- this.children.add(e);
- }
-
- /**
* Adds the specified text as a text node after the last child of this
* element.
*/
@@ -9011,7 +8996,7 @@ abstract class Element extends Node implements ElementTraversal native "*Element
this.insertBefore(node, first);
break;
case 'beforeend':
- this.nodes.add(node);
+ this.append(node);
break;
case 'afterend':
this.parentNode.insertBefore(node, this.nextNode);
@@ -17418,11 +17403,11 @@ class _ChildNodeListLazy implements List {
}
void add(Node value) {
- _this.$dom_appendChild(value);
+ _this.append(value);
}
void addLast(Node value) {
- _this.$dom_appendChild(value);
+ _this.append(value);
}
@@ -17432,13 +17417,13 @@ class _ChildNodeListLazy implements List {
// Optimized route for copying between nodes.
for (var i = 0, len = iterable.length; i < len; ++i) {
// Should use $dom_firstChild, Bug 8886.
- _this.$dom_appendChild(iterable[0]);
+ _this.append(iterable[0]);
}
}
return;
}
for (Node node in iterable) {
- _this.$dom_appendChild(node);
+ _this.append(node);
}
}
@@ -17622,7 +17607,7 @@ class Node extends EventTarget native "*Node" {
List copy = new List.from(value);
text = '';
for (Node node in copy) {
- $dom_appendChild(node);
+ append(node);
}
}
@@ -17751,7 +17736,7 @@ class Node extends EventTarget native "*Node" {
@JSName('appendChild')
@DomName('Node.appendChild')
@DocsEditable
- Node $dom_appendChild(Node newChild) native;
+ Node append(Node newChild) native;
@JSName('cloneNode')
@DomName('Node.cloneNode')
« no previous file with comments | « samples/third_party/dromaeo/tests/dom-traverse-html.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698