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

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

Issue 10854208: Adding Element.AddHTML and Element.addText methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updating CL to the latest committed version. Created 8 years, 4 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
Index: lib/html/dart2js/html_dart2js.dart
diff --git a/lib/html/dart2js/html_dart2js.dart b/lib/html/dart2js/html_dart2js.dart
index 8dea02e5bc2ef041a587e7f8ecb16ca6676b336b..ecb288b5a64f2de95906ba243feda4d91f868735 100644
--- a/lib/html/dart2js/html_dart2js.dart
+++ b/lib/html/dart2js/html_dart2js.dart
@@ -5146,6 +5146,14 @@ class _DocumentFragmentImpl extends _NodeImpl implements DocumentFragment native
this._insertAdjacentNode(where, new DocumentFragment.html(text));
}
+ void addText(String text) {
+ this.insertAdjacentText('beforeend', text);
+ }
+
+ void addHTML(String text) {
+ this.insertAdjacentHTML('beforeend', text);
+ }
+
Future<ElementRect> get rect() {
return _createMeasurementFuture(() => const EmptyElementRect(),
new Completer<ElementRect>());
@@ -5963,14 +5971,14 @@ class _ElementRectImpl implements ElementRect {
// TODO(jacobr): should we move these outside of ElementRect to avoid the
// overhead of computing them every time even though they are rarely used.
- final _ClientRectImpl _boundingClientRect;
+ final _ClientRectImpl _boundingClientRect;
final _ClientRectListImpl _clientRects;
_ElementRectImpl(_ElementImpl element) :
client = new _SimpleClientRect(element.$dom_clientLeft,
element.$dom_clientTop,
- element.$dom_clientWidth,
- element.$dom_clientHeight),
+ element.$dom_clientWidth,
+ element.$dom_clientHeight),
offset = new _SimpleClientRect(element.$dom_offsetLeft,
element.$dom_offsetTop,
element.$dom_offsetWidth,
@@ -6059,6 +6067,14 @@ class _ElementImpl extends _NodeImpl implements Element native "*Element" {
new Completer<CSSStyleDeclaration>());
}
+ void addText(String text) {
+ this.insertAdjacentText('beforeend', text);
+ }
+
+ void addHTML(String text) {
+ this.insertAdjacentHTML('beforeend', text);
+ }
+
// Hooks to support custom WebComponents.
var xtag;
@@ -23225,6 +23241,9 @@ interface Element extends Node, NodeSelector default _ElementFactoryProvider {
AttributeMap get dataAttributes();
void set dataAttributes(Map<String, String> value);
+ void addText(String text);
+ void addHTML(String html);
+
/**
* @domName getClientRects, getBoundingClientRect, clientHeight, clientWidth,
* clientTop, clientLeft, offsetHeight, offsetWidth, offsetTop, offsetLeft,

Powered by Google App Engine
This is Rietveld 408576698