Index: client/html/src/DocumentFragmentWrappingImplementation.dart |
diff --git a/client/html/src/DocumentFragmentWrappingImplementation.dart b/client/html/src/DocumentFragmentWrappingImplementation.dart |
index 612c3f1a9a953a7b362d7ca7c2626473388dc904..b50ea2aeaf9fa11b70d1412d108e56d71742e3f4 100644 |
--- a/client/html/src/DocumentFragmentWrappingImplementation.dart |
+++ b/client/html/src/DocumentFragmentWrappingImplementation.dart |
@@ -164,6 +164,28 @@ class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation |
return fragment; |
} |
+ factory DocumentFragmentWrappingImplementation.xml(String xml) { |
+ var fragment = new DocumentFragment(); |
+ var e = new XMLElement.tag("xml"); |
+ e.innerHTML = xml; |
+ |
+ // Copy list first since we don't want liveness during iteration. |
+ List nodes = new List.from(e.nodes); |
+ fragment.nodes.addAll(nodes); |
+ return fragment; |
+ } |
+ |
+ factory DocumentFragmentWrappingImplementation.svg(String svg) { |
+ var fragment = new DocumentFragment(); |
+ var e = new SVGSVGElement(); |
+ e.innerHTML = svg; |
+ |
+ // Copy list first since we don't want liveness during iteration. |
+ List nodes = new List.from(e.nodes); |
+ fragment.nodes.addAll(nodes); |
+ return fragment; |
+ } |
+ |
ElementList get elements() { |
if (_elements == null) { |
_elements = new FilteredElementList(this); |
@@ -188,6 +210,8 @@ class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation |
String get outerHTML() => innerHTML; |
+ // TODO(nweiz): Do we want to support some variant of innerHTML for XML and/or |
+ // SVG strings? |
void set innerHTML(String value) { |
this.nodes.clear(); |