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

Unified Diff: lib/dom/templates/html/impl/impl_Element.darttemplate

Issue 10854208: Adding Element.AddHTML and Element.addText methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporating review feedback 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:
View side-by-side diff with in-line comments
Download patch
Index: lib/dom/templates/html/impl/impl_Element.darttemplate
diff --git a/lib/dom/templates/html/impl/impl_Element.darttemplate b/lib/dom/templates/html/impl/impl_Element.darttemplate
index fc2842d02aec158e2ee99ab902f5c8115768eec6..5979e4b80c0fd585b396205afcc38be7a643b884 100644
--- a/lib/dom/templates/html/impl/impl_Element.darttemplate
+++ b/lib/dom/templates/html/impl/impl_Element.darttemplate
@@ -624,14 +624,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,
@@ -720,6 +720,14 @@ class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
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;

Powered by Google App Engine
This is Rietveld 408576698