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

Side by Side Diff: LayoutTests/fast/dom/Attr/change-id-via-attr-node-value.html

Issue 124643003: Remove Attr.isId and Attr.ownerElement. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bump unused use counter slot number due to conflict. Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body id="a"> 6 <body id="a">
7 <script> 7 <script>
8 8
9 description("Test that different ways of changing an element's id all work prope rly."); 9 description("Test that different ways of changing an element's id all work prope rly.");
10 10
11 debug("\n1. Check id after parsing."); 11 debug("\n1. Check id after parsing.");
12 shouldBe('document.getElementById("a")', 'document.body'); 12 shouldBe('document.getElementById("a")', 'document.body');
13 shouldBe('document.body.id', '"a"'); 13 shouldBe('document.body.id', '"a"');
14 shouldBe('document.body.getAttributeNode("id").isId', 'true');
15 shouldBe('document.body.getAttributeNode("id").textContent', '"a"'); 14 shouldBe('document.body.getAttributeNode("id").textContent', '"a"');
16 15
17 debug("\n2. Change Attr.value."); 16 debug("\n2. Change Attr.value.");
18 document.body.getAttributeNode("id").value = "b"; 17 document.body.getAttributeNode("id").value = "b";
19 shouldBe('document.getElementById("a")', 'null'); 18 shouldBe('document.getElementById("a")', 'null');
20 shouldBe('document.getElementById("b")', 'document.body'); 19 shouldBe('document.getElementById("b")', 'document.body');
21 shouldBe('document.body.getAttributeNode("id").textContent', '"b"'); 20 shouldBe('document.body.getAttributeNode("id").textContent', '"b"');
22 21
23 debug("\n3. Change HTMLElement.id."); 22 debug("\n3. Change HTMLElement.id.");
24 document.body.id = "c"; 23 document.body.id = "c";
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 var attrNode = document.createAttribute("id"); 207 var attrNode = document.createAttribute("id");
209 attrNode.value = "p"; 208 attrNode.value = "p";
210 document.body.setAttributeNode(attrNode); 209 document.body.setAttributeNode(attrNode);
211 shouldBe('document.getElementById("o")', 'null'); 210 shouldBe('document.getElementById("o")', 'null');
212 shouldBe('document.getElementById("p")', 'document.body'); 211 shouldBe('document.getElementById("p")', 'document.body');
213 shouldBe('document.body.id', '"p"'); 212 shouldBe('document.body.id', '"p"');
214 shouldBe('document.body.getAttribute("id")', '"p"'); 213 shouldBe('document.body.getAttribute("id")', '"p"');
215 </script> 214 </script>
216 </body> 215 </body>
217 </html> 216 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698