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

Unified Diff: LayoutTests/fast/dom/Element/setAttributeNode-for-existing-attribute-html.html

Issue 22842013: setAttributeNode() does not set the new value to an existing attribute if specified attribute is in… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: modifying the layout testcase 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/dom/Element/setAttributeNode-for-existing-attribute-html.html
diff --git a/LayoutTests/fast/dom/Element/setAttributeNode-for-existing-attribute-html.html b/LayoutTests/fast/dom/Element/setAttributeNode-for-existing-attribute-html.html
new file mode 100644
index 0000000000000000000000000000000000000000..02a85c995850af592f9d9b7ad548e886651503a4
--- /dev/null
+++ b/LayoutTests/fast/dom/Element/setAttributeNode-for-existing-attribute-html.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../js/resources/js-test-pre.js"></script>
+<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.\nThis testcase verifies that attributes with the same name but in different case are overwritten for HTML documents.');
+
+ var doc = document.implementation.createHTMLDocument('');
+ doc.documentElement.setAttribute('x', 'x');
+
+ var attr = doc.createAttribute('X');
+ attr.value = 'X';
+ doc.documentElement.setAttributeNode(attr);
+
+ shouldBe('doc.documentElement.attributes.length', '1');
+ shouldBeEqualToString('doc.documentElement.getAttribute("x")', 'X');
+ shouldBeEqualToString('doc.documentElement.getAttribute("X")', 'X');
+
+ var attr2 = doc.createAttribute('X');
+ attr2.value = 'Y';
+ doc.documentElement.setAttributeNode(attr2);
+
+ shouldBe('doc.documentElement.attributes.length', '1');
+ shouldBeEqualToString('doc.documentElement.getAttribute("x")', 'Y');
+ shouldBeEqualToString('doc.documentElement.getAttribute("X")', 'Y');
+</script>
+</head>
+<body>
arv (Not doing code reviews) 2013/08/29 14:18:16 This should also have a js-test-post
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698