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

Unified Diff: tools/dom/templates/html/impl/impl_HTMLTableElement.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
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/templates/html/impl/impl_HTMLTableRowElement.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_HTMLTableElement.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_HTMLTableElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLTableElement.darttemplate
index 8548c597c9ad632cce1ce1e362a6a6370bcd039d..c7c32125d319314f896423d73f886d5855ae3798 100644
--- a/tools/dom/templates/html/impl/impl_HTMLTableElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLTableElement.darttemplate
@@ -37,6 +37,22 @@ $if DART2JS
@JSName('createTBody')
TableSectionElement _nativeCreateTBody() native;
+
+ 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 contextualHtml = '<table>$html</table>';
+ var table = new Element.html(contextualHtml, validator: validator,
+ treeSanitizer: treeSanitizer);
+ var fragment = new DocumentFragment();
+ fragment.nodes.addAll(table.nodes);
+
+ return fragment;
+ }
$endif
$!MEMBERS}
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/templates/html/impl/impl_HTMLTableRowElement.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698