Index: LayoutTests/fast/dom/Attr/update-attribute-node-no-crash.html |
diff --git a/LayoutTests/fast/dom/Attr/update-attribute-node-no-crash.html b/LayoutTests/fast/dom/Attr/update-attribute-node-no-crash.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..db9b7167be160ea525c0542c69546d37fb57618a |
--- /dev/null |
+++ b/LayoutTests/fast/dom/Attr/update-attribute-node-no-crash.html |
@@ -0,0 +1,26 @@ |
+<!DOCTYPE HTML> |
+<html> |
+<head> |
+<script src="../../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<iframe></iframe> |
+<div id="test" style="background-color: red"></div> |
+<script> |
+description("Updating value of replaced attribute node"); |
+var element = document.getElementById("test"); |
+var attr = document.createAttribute("STYLE"); |
+// This aligns with Trident rather than Gecko. |
+shouldBeEqualToString("replaced = element.setAttributeNode(attr); replaced.name", "STYLE"); |
+shouldBeEqualToString("replaced.value", "background-color: red"); |
+shouldBeEqualToString("attr.name", "STYLE"); |
+shouldBeEqualToString("attr.value", ""); |
+shouldBeEqualToString("element.getAttribute('style')", ""); |
+shouldBeEqualToString("element.getAttribute('StyLE')", ""); |
+// Setting the value must correctly locate attribute on the element and update it, |
+// even if the local name differs. PASS if no crash (crbug.com/376718) |
+shouldBeEqualToString("attr.value = 'background-color: green'; attr.value", "background-color: green"); |
+shouldBeEqualToString("element.getAttribute('stylE')", "background-color: green"); |
+</script> |
+</body> |
+</html> |