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

Side by Side Diff: LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity.html

Issue 740223003: Revive tests for Document.createAttributeNS() and Element.setAttributeNodeNS() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: deprecation messages Created 6 years, 1 month 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 <script> 5 <script>
6 function runTest() 6 function runTest()
7 { 7 {
8 description("This test verifies that the setAttributeNode() API checks for e xisting attributes case-insensitively. Thus the value of an existing attribute w ith the same name but in a different case should get replaced by the new value s pecified via the setAttributeNode() method."); 8 description("This test verifies that the setAttributeNode() API checks for e xisting attributes case-insensitively. Thus the value of an existing attribute w ith the same name but in a different case should get replaced by the new value s pecified via the setAttributeNode() method.");
9 9
10 var test = document.getElementById("test"); 10 var test = document.getElementById("test");
11 var newStyleAttr = document.createAttribute("STYLE"); 11 var newStyleAttr = document.createAttribute("STYLE");
12 newStyleAttr.value = "background-color: green"; 12 newStyleAttr.value = "background-color: green";
13 test.setAttributeNode(newStyleAttr); 13 test.setAttributeNode(newStyleAttr);
14 if (window.testRunner) { 14 if (window.testRunner) {
15 shouldBe("test.getAttribute('style')", "test.getAttribute('STYLE')"); 15 shouldBe("test.getAttribute('style')", "test.getAttribute('STYLE')");
16 shouldBe("test.getAttributeNode('style').value", "test.getAttributeNode( 'STYLE').value"); 16 shouldBe("test.getAttributeNode('style').value", "test.getAttributeNode( 'STYLE').value");
17 } 17 }
18
19 debug("Verifying that attributes with the same name but different namespaces are treated as unique entities. For the following test two different attribute values should be returned.");
20 var newAttr1 = document.createAttributeNS("ns1", "newattr");
21 newAttr1.prefix = "prefix1";
22 newAttr1.value = "newattr1";
23 test.setAttributeNode(newAttr1);
24 var newAttr2 = document.createAttributeNS("ns2", "newattr");
25 newAttr2.prefix = "prefix2";
26 newAttr2.value = "newattr2";
27 test.setAttributeNode(newAttr2);
28 if (window.testRunner) {
29 shouldBe("test.getAttributeNodeNS('ns1', 'newattr').value", "'newattr1'" );
30 shouldBe("test.getAttributeNodeNS('ns2', 'newattr').value", "'newattr2'" );
31 }
32
33 debug("Verifying that attributes with same name but different case and havin g same namespaces are treated as same. In the following test the new attribute s hould overwrite the value of the existing one.");
34 var newAttr3 = document.createAttributeNS("ns1", "NEWATTR");
35 newAttr3.prefix = "prefix2";
36 newAttr3.value = "newattr3";
37 test.setAttributeNode(newAttr3);
38
39 if (window.testRunner) {
40 shouldBe("test.getAttributeNodeNS('ns1', 'newattr').value", "'newattr3'" );
41
42 isSuccessfullyParsed();
43 test.style.display = 'none';
44 }
45
18 } 46 }
19 </script> 47 </script>
20 </head> 48 </head>
21 <body onload="runTest()"> 49 <body onload="runTest()">
22 <div>Test for Bugzilla bug:<a href="https://bugs.webkit.org/show_bug.cgi?id=9034 1"> 90341:</a> createAttribute/setAttributeNode does not properly normalize cas e.</div> 50 <div>Test for Bugzilla bug:<a href="https://bugs.webkit.org/show_bug.cgi?id=9034 1"> 90341:</a> createAttribute/setAttributeNode does not properly normalize cas e.</div>
23 <div id="test" style="background-color: red">&nbsp;</div> 51 <div id="test" style="background-color: red">&nbsp;</div>
24 <div id="description"></div> 52 <div id="description"></div>
25 <div id="console"></div> 53 <div id="console"></div>
26 </body> 54 </body>
27 </html> 55 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698