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..f4222107741e9255065a109e5c43b260f6686ec7 |
--- /dev/null |
+++ b/LayoutTests/fast/dom/Element/setAttributeNode-for-existing-attribute.html |
@@ -0,0 +1,24 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<style> |
+#test { width: 100px; height: 100px; } |
+</style> |
+<script src="../../js/resources/js-test-pre.js"></script> |
+</head> |
+<body> |
+<div id="test" style="background-color: red;"/></div> |
arv (Not doing code reviews)
2013/08/29 15:46:37
Still invalid HTML.
<div id="test" style="backgro
|
+<script> |
+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); |
+ |
+shouldBeEqualToString('testElement.attributes.length.toString()', '2'); |
arv (Not doing code reviews)
2013/08/29 15:46:37
No need to use a string comparison.
shouldBe('tes
|
+shouldBeEqualToString('testElement.style.background', 'green'); |
arv (Not doing code reviews)
2013/08/29 15:46:37
Should be backgroundColor
|
+</script> |
+<script src="../../js/resources/js-test-post.js"></script> |
+</body> |
+</html> |