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

Unified Diff: client/html/release/htmlimpl.dart

Side-by-side diff isn't available for this file because of its large size.
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, 9 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:
Download patch
« no previous file with comments | « no previous file | client/html/src/XMLElementWrappingImplementation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/html/release/htmlimpl.dart
diff --git a/client/html/release/htmlimpl.dart b/client/html/release/htmlimpl.dart
index fb74c06aa8a8dcf7e7db4b4fc8bba22754bd6874..c5ea3fd57ebfc8c449f3eb49e03c71a3bbee648a 100644
--- a/client/html/release/htmlimpl.dart
+++ b/client/html/release/htmlimpl.dart
@@ -25985,19 +25985,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 | « no previous file | client/html/src/XMLElementWrappingImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698