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

Side by Side Diff: sdk/lib/html/templates/html/impl/impl_DocumentFragment.darttemplate

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of html; 5 part of html;
6 6
7 Future<CSSStyleDeclaration> _emptyStyleFuture() { 7 Future<CSSStyleDeclaration> _emptyStyleFuture() {
8 return _createMeasurementFuture(() => new Element.tag('div').style, 8 return _createMeasurementFuture(() => new Element.tag('div').style,
9 new Completer<CSSStyleDeclaration>()); 9 new Completer<CSSStyleDeclaration>());
10 } 10 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 => this._insertAdjacentNode(where, element); 103 => this._insertAdjacentNode(where, element);
104 104
105 void insertAdjacentText(String where, String text) { 105 void insertAdjacentText(String where, String text) {
106 this._insertAdjacentNode(where, new Text(text)); 106 this._insertAdjacentNode(where, new Text(text));
107 } 107 }
108 108
109 void insertAdjacentHTML(String where, String text) { 109 void insertAdjacentHTML(String where, String text) {
110 this._insertAdjacentNode(where, new DocumentFragment.html(text)); 110 this._insertAdjacentNode(where, new DocumentFragment.html(text));
111 } 111 }
112 112
113 void addText(String text) { 113 void append(Element element) {
114 this.children.add(element);
115 }
116
117 void appendText(String text) {
114 this.insertAdjacentText('beforeend', text); 118 this.insertAdjacentText('beforeend', text);
115 } 119 }
116 120
117 void addHtml(String text) { 121 void appendHtml(String text) {
118 this.insertAdjacentHTML('beforeend', text); 122 this.insertAdjacentHTML('beforeend', text);
119 } 123 }
120 124
121 // If we can come up with a semi-reasonable default value for an Element 125 // If we can come up with a semi-reasonable default value for an Element
122 // getter, we'll use it. In general, these return the same values as an 126 // getter, we'll use it. In general, these return the same values as an
123 // element that has no parent. 127 // element that has no parent.
124 String get contentEditable => "false"; 128 String get contentEditable => "false";
125 bool get isContentEditable => false; 129 bool get isContentEditable => false;
126 bool get draggable => false; 130 bool get draggable => false;
127 bool get hidden => false; 131 bool get hidden => false;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 "WebKit drop zone can't be set for document fragments."); 261 "WebKit drop zone can't be set for document fragments.");
258 } 262 }
259 263
260 void set webkitRegionOverflow(String value) { 264 void set webkitRegionOverflow(String value) {
261 throw new UnsupportedError( 265 throw new UnsupportedError(
262 "WebKit region overflow can't be set for document fragments."); 266 "WebKit region overflow can't be set for document fragments.");
263 } 267 }
264 268
265 $!MEMBERS 269 $!MEMBERS
266 } 270 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/html/templates/html/impl/impl_Element.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698