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

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

Issue 22803008: setAttributeNode() does not properly normalize case. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: submitting patch with small name changes. Created 7 years, 4 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 | LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../js/resources/js-test-pre.js"></script>
5 <script>
6 function runTest()
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.");
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 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
46 }
47 </script>
48 </head>
49 <body onload="runTest()">
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>
51 <div id="test" style="background-color: red">&nbsp;</div>
52 <div id="description"></div>
53 <div id="console"></div>
54 </body>
55 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698