Chromium Code Reviews| Index: LayoutTests/fast/dom/Element/setAttributeNode-for-existing-attribute.html |
| diff --git a/LayoutTests/fast/dom/Element/setAttributeNode-for-existing-attribute.html b/LayoutTests/fast/dom/Element/setAttributeNode-for-existing-attribute.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8e954b8ec752e7f1e2f3add528a355d0cf8bbc86 |
| --- /dev/null |
| +++ b/LayoutTests/fast/dom/Element/setAttributeNode-for-existing-attribute.html |
| @@ -0,0 +1,33 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script src="../../js/resources/js-test-pre.js"></script> |
| +<script> |
| +function getBackgroundStyle(id) { |
| + return document.getElementById(id).style.background; |
| +} |
| +function getAttributesLength(id) { |
| + return document.getElementById(id).attributes.length; |
| +} |
| +function runTest() { |
| + description('Testcase for bug <a href="http://crbug.com/279193">279193</a>: setAttributeNode() does not set the new value to an existing attribute if specified attribute is in a different case.\nThe issue can be manually verified by ascertaining that a green colored block is displayed instead of a red one.'); |
| + |
| + var testElement = document.getElementById('test'); |
| + var newAttr = document.createAttribute("STYLE"); |
| + newAttr.value = "background-color: green;"; |
| + testElement.setAttributeNode(newAttr); |
| + |
| + shouldBe("getAttributesLength('test')", '2'); |
|
arv (Not doing code reviews)
2013/08/29 13:45:21
Why not?
shouldBe('testElement.attributes.length'
arpitab_
2013/08/29 14:11:01
Done.
|
| + shouldBe("getBackgroundStyle('test')", "'green'"); |
| + |
| + testElement.style.display = 'none'; |
| + isSuccessfullyParsed(); |
|
arv (Not doing code reviews)
2013/08/29 13:45:21
remove
arpitab_
2013/08/29 14:11:01
Done.
|
| +} |
| +</script> |
| +</head> |
| +<body onload="runTest();"> |
|
arv (Not doing code reviews)
2013/08/29 13:45:21
remove onload and move the script block to after t
arpitab_
2013/08/29 14:11:01
Done.
|
| +<div id="description"></div> |
|
arv (Not doing code reviews)
2013/08/29 13:45:21
remove
arpitab_
2013/08/29 14:11:01
Done.
|
| +<div id="test" style="background-color: red;"/> </div> |
| +<div id="console"></div> |
|
arv (Not doing code reviews)
2013/08/29 13:45:21
remove
arpitab_
2013/08/29 14:11:01
Done.
|
| +</body> |
|
arv (Not doing code reviews)
2013/08/29 13:45:21
Missing
<script src="../../js/resources/js-test-
arpitab_
2013/08/29 14:11:01
Done.
|
| +</html> |