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

Unified Diff: sky/tests/dom/document-child-mutations.sky

Issue 924203002: Morph the APIs for Node, ParentNode, and Element closer to the specs (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
Index: sky/tests/dom/document-child-mutations.sky
diff --git a/sky/tests/dom/document-child-mutations.sky b/sky/tests/dom/document-child-mutations.sky
index 7aecd2b9a27766eb33ff5e000226441d18121ad0..1ffe1eff5c93626c9a44f5b9e82433adb6717c5f 100644
--- a/sky/tests/dom/document-child-mutations.sky
+++ b/sky/tests/dom/document-child-mutations.sky
@@ -22,7 +22,7 @@ void main() {
var oldChild = doc.appendChild(doc.createElement("div"));
expect(childElementCount(doc), equals(1));
var newChild = doc.createElement("div");
- doc.replaceChild(newChild, oldChild);
+ oldChild.replaceWith([newChild]);
eseidel 2015/02/14 00:12:23 Feels like we're going to want a single vs. list v
abarth-chromium 2015/02/14 00:27:19 There's some discussion about this in the Sky chat
expect(childElementCount(doc), equals(1));
expect(newChild.parentNode, equals(doc));
expect(oldChild.parentNode, isNull);
@@ -33,7 +33,7 @@ void main() {
expect(childElementCount(doc), equals(0));
expect(childNodeCount(doc), equals(1));
var newChild = doc.createElement("div");
- doc.replaceChild(newChild, oldChild);
+ oldChild.replaceWith([newChild]);
expect(childElementCount(doc), equals(1));
expect(childNodeCount(doc), equals(1));
expect(newChild.parentNode, equals(doc));
@@ -44,7 +44,7 @@ void main() {
var oldChild = doc.appendChild(doc.createElement("div"));
expect(childElementCount(doc), equals(1));
var newChild = new Text(" text ");
- doc.replaceChild(newChild, oldChild);
+ oldChild.replaceWith([newChild]);
expect(childElementCount(doc), equals(0));
expect(childNodeCount(doc), equals(1));
expect(newChild.parentNode, equals(doc));
@@ -68,7 +68,7 @@ void main() {
fragment.appendChild(new Text(" text "));
var newChild = fragment.appendChild(doc.createElement("div"));
fragment.appendChild(new Text(" "));
- doc.replaceChild(fragment, oldChild);
+ oldChild.replaceWith([fragment]);
expect(childElementCount(doc), equals(1));
expect(childNodeCount(doc), equals(3));
expect(newChild.parentNode, equals(doc));

Powered by Google App Engine
This is Rietveld 408576698