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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/ChildNode/replace-with.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/replace-with.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/ChildNode/replace-with.html b/third_party/WebKit/LayoutTests/fast/dom/ChildNode/replace-with.html
index 87adf579771c594066cc0ae6a4c6762088265902..73f8b0a2d75a8ea5ca573b44d4b0cf6942dd0ad9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/ChildNode/replace-with.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/ChildNode/replace-with.html
@@ -124,6 +124,14 @@ function test_replaceWith(nodeName) {
child.replaceWith(x, y);
assert_equals(parent.innerHTML, '<x></x><y></y>');
}, nodeName + '.replaceWith() on a parenless child with two elements as arguments.');
+
+ 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.replaceWith(doc2, "foo") });
+ assert_equals(parent.firstChild, child);
+ }, nodeName + '.replaceWith() with a Document as an argument should throw.');
}
test_replaceWith('Comment');

Powered by Google App Engine
This is Rietveld 408576698