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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library html; 1 library html;
2 2
3 import 'dart:isolate'; 3 import 'dart:isolate';
4 import 'dart:json'; 4 import 'dart:json';
5 import 'dart:svg' as svg; 5 import 'dart:svg' as svg;
6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
7 // for details. All rights reserved. Use of this source code is governed by a 7 // for details. All rights reserved. Use of this source code is governed by a
8 // BSD-style license that can be found in the LICENSE file. 8 // BSD-style license that can be found in the LICENSE file.
9 9
10 // DO NOT EDIT 10 // DO NOT EDIT
(...skipping 6851 matching lines...) Expand 10 before | Expand all | Expand 10 after
6862 => this._insertAdjacentNode(where, element); 6862 => this._insertAdjacentNode(where, element);
6863 6863
6864 void insertAdjacentText(String where, String text) { 6864 void insertAdjacentText(String where, String text) {
6865 this._insertAdjacentNode(where, new Text(text)); 6865 this._insertAdjacentNode(where, new Text(text));
6866 } 6866 }
6867 6867
6868 void insertAdjacentHTML(String where, String text) { 6868 void insertAdjacentHTML(String where, String text) {
6869 this._insertAdjacentNode(where, new DocumentFragment.html(text)); 6869 this._insertAdjacentNode(where, new DocumentFragment.html(text));
6870 } 6870 }
6871 6871
6872 void addText(String text) { 6872 void append(Element element) {
6873 this.children.add(element);
6874 }
6875
6876 void appendText(String text) {
6873 this.insertAdjacentText('beforeend', text); 6877 this.insertAdjacentText('beforeend', text);
6874 } 6878 }
6875 6879
6876 void addHtml(String text) { 6880 void appendHtml(String text) {
6877 this.insertAdjacentHTML('beforeend', text); 6881 this.insertAdjacentHTML('beforeend', text);
6878 } 6882 }
6879 6883
6880 // If we can come up with a semi-reasonable default value for an Element 6884 // If we can come up with a semi-reasonable default value for an Element
6881 // getter, we'll use it. In general, these return the same values as an 6885 // getter, we'll use it. In general, these return the same values as an
6882 // element that has no parent. 6886 // element that has no parent.
6883 String get contentEditable => "false"; 6887 String get contentEditable => "false";
6884 bool get isContentEditable => false; 6888 bool get isContentEditable => false;
6885 bool get draggable => false; 6889 bool get draggable => false;
6886 bool get hidden => false; 6890 bool get hidden => false;
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
7688 } 7692 }
7689 7693
7690 /** @domName Window.getComputedStyle */ 7694 /** @domName Window.getComputedStyle */
7691 Future<CSSStyleDeclaration> getComputedStyle(String pseudoElement) { 7695 Future<CSSStyleDeclaration> getComputedStyle(String pseudoElement) {
7692 return _createMeasurementFuture( 7696 return _createMeasurementFuture(
7693 () => window.$dom_getComputedStyle(this, pseudoElement), 7697 () => window.$dom_getComputedStyle(this, pseudoElement),
7694 new Completer<CSSStyleDeclaration>()); 7698 new Completer<CSSStyleDeclaration>());
7695 } 7699 }
7696 7700
7697 /** 7701 /**
7702 * Adds the specified element to after the last child of this.
7703 */
7704 void append(Element e) {
7705 this.children.add(e);
7706 }
7707
7708 /**
7698 * Adds the specified text as a text node after the last child of this. 7709 * Adds the specified text as a text node after the last child of this.
7699 */ 7710 */
7700 void addText(String text) { 7711 void appendText(String text) {
7701 this.insertAdjacentText('beforeend', text); 7712 this.insertAdjacentText('beforeend', text);
7702 } 7713 }
7703 7714
7704 /** 7715 /**
7705 * Parses the specified text as HTML and adds the resulting node after the 7716 * Parses the specified text as HTML and adds the resulting node after the
7706 * last child of this. 7717 * last child of this.
7707 */ 7718 */
7708 void addHtml(String text) { 7719 void appendHtml(String text) {
7709 this.insertAdjacentHTML('beforeend', text); 7720 this.insertAdjacentHTML('beforeend', text);
7710 } 7721 }
7711 7722
7712 // Hooks to support custom WebComponents. 7723 // Hooks to support custom WebComponents.
7713 /** 7724 /**
7714 * Experimental support for [web components][wc]. This field stores a 7725 * Experimental support for [web components][wc]. This field stores a
7715 * reference to the component implementation. It was inspired by Mozilla's 7726 * reference to the component implementation. It was inspired by Mozilla's
7716 * [x-tags][] project. Please note: in the future it may be possible to 7727 * [x-tags][] project. Please note: in the future it may be possible to
7717 * `extend Element` from your class, in which case this field will be 7728 * `extend Element` from your class, in which case this field will be
7718 * deprecated and will simply return this [Element] object. 7729 * deprecated and will simply return this [Element] object.
(...skipping 17390 matching lines...) Expand 10 before | Expand all | Expand 10 after
25109 if (length < 0) throw new ArgumentError('length'); 25120 if (length < 0) throw new ArgumentError('length');
25110 if (start < 0) throw new RangeError.value(start); 25121 if (start < 0) throw new RangeError.value(start);
25111 int end = start + length; 25122 int end = start + length;
25112 if (end > a.length) throw new RangeError.value(end); 25123 if (end > a.length) throw new RangeError.value(end);
25113 for (int i = start; i < end; i++) { 25124 for (int i = start; i < end; i++) {
25114 accumulator.add(a[i]); 25125 accumulator.add(a[i]);
25115 } 25126 }
25116 return accumulator; 25127 return accumulator;
25117 } 25128 }
25118 } 25129 }
OLDNEW
« 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