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

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

Issue 23460019: Optimization for Element.innerHtml (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_Element.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index 4c1a75ac3fc024c516763035e5138a04addf92ff..1a556b29842d2ec756d87dd2cafeae81a9126e29 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -1189,6 +1189,7 @@ $endif
}
static HtmlDocument _parseDocument;
+ static Range _parseRange;
static NodeValidatorBuilder _defaultValidator;
static _ValidatingTreeSanitizer _defaultSanitizer;
@@ -1234,6 +1235,7 @@ $endif
if (_parseDocument == null) {
_parseDocument = document.implementation.createHtmlDocument('');
+ _parseRange = _parseDocument.createRange();
}
var contextElement;
if (this is BodyElement) {
@@ -1244,9 +1246,8 @@ $endif
}
var fragment;
if (Range.supportsCreateContextualFragment) {
- var range = _parseDocument.createRange();
- range.selectNodeContents(contextElement);
- fragment = range.createContextualFragment(html);
+ _parseRange.selectNodeContents(contextElement);
+ fragment = _parseRange.createContextualFragment(html);
} else {
contextElement._innerHtml = html;
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698