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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/ChildNode/before.html

Issue 2305903003: DOM append(), prepend(), after(), before(), and replaceWith() should throw an exception if a Docume… (Closed)
Patch Set: Created 4 years, 3 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: third_party/WebKit/LayoutTests/fast/dom/ChildNode/before.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/ChildNode/before.html b/third_party/WebKit/LayoutTests/fast/dom/ChildNode/before.html
index ea4b82776b416c29e950a8500cf14ce945c4150c..c1c01dd9050fc9272a1b7b6344bf9f68d90bac3a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/ChildNode/before.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/ChildNode/before.html
@@ -139,6 +139,14 @@ function test_before(nodeName) {
x.before(y);
assert_equals(x.previousSibling, null);
}, nodeName + '.before() on a child without any parent.');
+
+ test(function() {
+ var parent = document.createElement('div');
+ parent.appendChild(child);
+ var doc2 = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html");
+ assert_throws('HierarchyRequestError', () => { child.before(doc2, "foo") });
+ assert_equals(parent.firstChild, child);
+ }, nodeName + '.before() with a Document as an argument should throw.');
}
test_before('Comment');

Powered by Google App Engine
This is Rietveld 408576698