OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../js/resources/js-test-pre.js"></script> |
| 5 <script> |
| 6 description('Testcase for bug <a href="http://crbug.com/279193">279193</a>:
setAttributeNode() does not set the new value to an existing attribute if specif
ied attribute is in a different case.\nThis testcase verifies that attributes wi
th the same name but in different case are overwritten for HTML documents.'); |
| 7 |
| 8 var doc = document.implementation.createHTMLDocument(''); |
| 9 doc.documentElement.setAttribute('x', 'x'); |
| 10 |
| 11 var attr = doc.createAttribute('X'); |
| 12 attr.value = 'X'; |
| 13 doc.documentElement.setAttributeNode(attr); |
| 14 |
| 15 shouldBe('doc.documentElement.attributes.length', '1'); |
| 16 shouldBeEqualToString('doc.documentElement.getAttribute("x")', 'X'); |
| 17 shouldBeEqualToString('doc.documentElement.getAttribute("X")', 'X'); |
| 18 |
| 19 var attr2 = doc.createAttribute('X'); |
| 20 attr2.value = 'Y'; |
| 21 doc.documentElement.setAttributeNode(attr2); |
| 22 |
| 23 shouldBe('doc.documentElement.attributes.length', '1'); |
| 24 shouldBeEqualToString('doc.documentElement.getAttribute("x")', 'Y'); |
| 25 shouldBeEqualToString('doc.documentElement.getAttribute("X")', 'Y'); |
| 26 </script> |
| 27 </head> |
| 28 <body> |
| 29 <script src="../../js/resources/js-test-post.js"></script> |
| 30 </body> |
| 31 </html> |
OLD | NEW |