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

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

Issue 23646003: Fixing createFragment on IE9 Table elements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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: tools/dom/templates/html/impl/impl_HTMLTableRowElement.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_HTMLTableRowElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLTableRowElement.darttemplate
index 7716e37b0d9a9ca1776ff064a2fbd1c21e57f2f0..d2dbc9ef5e651103d1d4ea311466322859454d56 100644
--- a/tools/dom/templates/html/impl/impl_HTMLTableRowElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLTableRowElement.darttemplate
@@ -17,4 +17,21 @@ $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
TableCellElement insertCell(int index) => _insertCell(index);
+$if DART2JS
+ DocumentFragment createFragment(String html,
+ {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
+ if (Range.supportsCreateContextualFragment) {
+ return super.createFragment(
+ html, validator: validator, treeSanitizer: treeSanitizer);
+ }
+ // IE9 workaround which does not support innerHTML on Table elements.
+ var fragment = new DocumentFragment();
+ var section = new TableElement().createFragment(
+ html, validator: validator, treeSanitizer: treeSanitizer).nodes.single;
+ var row = section.nodes.single;
+ fragment.nodes.addAll(row.nodes);
+ return fragment;
+ }
+$endif
+
$!MEMBERS}

Powered by Google App Engine
This is Rietveld 408576698