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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/ChildNode/after.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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/ChildNode/before.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script> 2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script> 3 <script src="../../../resources/testharnessreport.js"></script>
4 <script> 4 <script>
5 5
6 test(function () { 6 test(function () {
7 var child = document.createElement('p'); 7 var child = document.createElement('p');
8 assert_true('after' in child); 8 assert_true('after' in child);
9 var after = 'mine'; 9 var after = 'mine';
10 var getAttribute = 'mine'; 10 var getAttribute = 'mine';
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 var expected = innerHTML + '<x></x>21<y></y>'; 132 var expected = innerHTML + '<x></x>21<y></y>';
133 assert_equals(parent.innerHTML, expected); 133 assert_equals(parent.innerHTML, expected);
134 }, nodeName + '.after() with one sibling of child and text as arguments.'); 134 }, nodeName + '.after() with one sibling of child and text as arguments.');
135 135
136 test(function() { 136 test(function() {
137 var x = document.createElement('x'); 137 var x = document.createElement('x');
138 var y = document.createElement('y'); 138 var y = document.createElement('y');
139 x.after(y); 139 x.after(y);
140 assert_equals(x.nextSibling, null); 140 assert_equals(x.nextSibling, null);
141 }, nodeName + '.after() on a child without any parent.'); 141 }, nodeName + '.after() on a child without any parent.');
142
143 test(function() {
144 var parent = document.createElement('div');
145 parent.appendChild(child);
146 var doc2 = document.implementation.createDocument("http://www.w3.org/199 9/xhtml", "html");
147 assert_throws('HierarchyRequestError', () => { child.after(doc2, "foo") });
148 assert_equals(parent.firstChild, child);
149 }, nodeName + '.after() with a Document as an argument should throw.');
142 } 150 }
143 151
144 test_after('Comment'); 152 test_after('Comment');
145 test_after('Element'); 153 test_after('Element');
146 test_after('Text'); 154 test_after('Text');
147 155
148 </script> 156 </script>
149 </html> 157 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/ChildNode/before.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698