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

Unified Diff: client/html/src/XMLElementWrappingImplementation.dart

Issue 9513015: Fix XML tests on Safari and IE. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 8 years, 10 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 | « client/html/release/htmlimpl.dart ('k') | client/tests/client/client.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/html/src/XMLElementWrappingImplementation.dart
diff --git a/client/html/src/XMLElementWrappingImplementation.dart b/client/html/src/XMLElementWrappingImplementation.dart
index 94aa3536961701e73ba25a98749bfc2b1dd23015..161cdbf7c5e11b4cca5ad0c6aecd4bf1d5ca0659 100644
--- a/client/html/src/XMLElementWrappingImplementation.dart
+++ b/client/html/src/XMLElementWrappingImplementation.dart
@@ -52,19 +52,25 @@ class XMLElementWrappingImplementation extends ElementWrappingImplementation
String get outerHTML() {
final container = new Element.tag("div");
- container.elements.add(this.clone(true));
+ // Safari requires that the clone be removed from its owner document before
+ // being inserted into the HTML document.
+ container.elements.add(this.clone(true).remove());
return container.innerHTML;
}
String get innerHTML() {
final container = new Element.tag("div");
- container.nodes.addAll(this.clone(true).nodes);
+ // Safari requires that the clone be removed from its owner document before
+ // being inserted into the HTML document.
+ container.nodes.addAll(this.clone(true).remove().nodes);
return container.innerHTML;
}
void set innerHTML(String xml) {
final xmlDoc = new XMLDocument.xml('<xml>$xml</xml>');
- this.nodes = xmlDoc.nodes;
+ // Safari requires that the root node be removed from the document before
+ // being inserted into the HTML document.
+ this.nodes = xmlDoc.remove().nodes;
}
Node _insertAdjacentNode(String where, Node node) {
« no previous file with comments | « client/html/release/htmlimpl.dart ('k') | client/tests/client/client.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698