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

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

Issue 11316121: Changes to make it easier to add elements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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 027cd6785c516c37ea2c73e42908fac87ae1ecfe..2421183bb89b1f126bed6b6f029c5431e73f437b 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -6869,11 +6869,15 @@ class DocumentFragment extends Node native "*DocumentFragment" {
this._insertAdjacentNode(where, new DocumentFragment.html(text));
}
- void addText(String text) {
+ void append(Element element) {
+ this.children.add(element);
+ }
+
+ void appendText(String text) {
this.insertAdjacentText('beforeend', text);
}
- void addHtml(String text) {
+ void appendHtml(String text) {
this.insertAdjacentHTML('beforeend', text);
}
@@ -7695,9 +7699,16 @@ abstract class Element extends Node implements ElementTraversal native "*Element
}
/**
+ * Adds the specified element to after the last child of this.
+ */
+ void append(Element e) {
+ this.children.add(e);
+ }
+
+ /**
* Adds the specified text as a text node after the last child of this.
*/
- void addText(String text) {
+ void appendText(String text) {
this.insertAdjacentText('beforeend', text);
}
@@ -7705,7 +7716,7 @@ abstract class Element extends Node implements ElementTraversal native "*Element
* Parses the specified text as HTML and adds the resulting node after the
* last child of this.
*/
- void addHtml(String text) {
+ void appendHtml(String text) {
this.insertAdjacentHTML('beforeend', text);
}
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698