Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / dom / Element / setAttributeNode-case-insensitivity.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script>
6 function runTest()
7 {
8     description("This test verifies that the setAttributeNode() API checks for existing attributes case-insensitively. Thus the value of an existing attribute with the same name but in a different case should get replaced by the new value specified via the setAttributeNode() method.");
9     
10     var test = document.getElementById("test");
11     var newStyleAttr = document.createAttribute("STYLE");
12     newStyleAttr.value = "background-color: green";
13     test.setAttributeNode(newStyleAttr);
14     if (window.testRunner) {
15         shouldBe("test.getAttribute('style')", "test.getAttribute('STYLE')");
16         shouldBe("test.getAttributeNode('style').value", "test.getAttributeNode('STYLE').value");
17     }
18 }
19 </script>
20 </head>
21 <body onload="runTest()">
22 <div>Test for Bugzilla bug:<a href="https://bugs.webkit.org/show_bug.cgi?id=90341"> 90341:</a>  createAttribute/setAttributeNode does not properly normalize case.</div>
23 <div id="test" style="background-color: red">&nbsp;</div>
24 <div id="description"></div>
25 <div id="console"></div>
26 </body>
27 </html>