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

Unified Diff: LayoutTests/fast/dom/Attr/change-id-via-attr-node-value.html

Issue 1158433004: Remove Attr child nodes (making Attr a Node, not a ContainerNode) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address feedback Created 5 years, 7 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/Attr/change-id-via-attr-node-value.html
diff --git a/LayoutTests/fast/dom/Attr/change-id-via-attr-node-value.html b/LayoutTests/fast/dom/Attr/change-id-via-attr-node-value.html
index a3d7f84acb3cc02fa50cd0bcc11ba35e266a283c..1669653be9009f82f8744bcdae5f2f833143a1e8 100644
--- a/LayoutTests/fast/dom/Attr/change-id-via-attr-node-value.html
+++ b/LayoutTests/fast/dom/Attr/change-id-via-attr-node-value.html
@@ -46,67 +46,6 @@ shouldBe('document.getElementById("f")', 'document.body');
shouldBe('document.body.id', '"f"');
shouldBe('document.body.getAttribute("id")', '"f"');
shouldBe('attrNode.value', '"f"');
-shouldBe('attrNode.childNodes.length', '1');
-
-// Firefox doesn't support these for Attr nodes.
-debug("\n7. Attr.replaceChild().");
-try {
- attrNode.replaceChild(document.createTextNode("g"), attrNode.firstChild);
- shouldBe('document.getElementById("f")', 'null');
- shouldBe('document.getElementById("g")', 'document.body');
- shouldBe('document.body.id', '"g"');
- shouldBe('document.body.getAttribute("id")', '"g"');
- shouldBe('attrNode.value', '"g"');
- shouldBe('attrNode.childNodes.length', '1');
-} catch (ex) {
- debug(ex);
-}
-
-debug("\n8. Attr.insertBefore().");
-try {
- attrNode.insertBefore(document.createTextNode("0"), attrNode.firstChild);
- shouldBe('document.getElementById("g")', 'null');
- shouldBe('document.getElementById("0g")', 'document.body');
- shouldBe('document.body.id', '"0g"');
- shouldBe('document.body.getAttribute("id")', '"0g"');
- shouldBe('attrNode.value', '"0g"');
- shouldBe('attrNode.childNodes.length', '2');
-} catch (ex) {
- debug(ex);
-}
-
-debug("\n9. attr.appendChild().");
-try {
- attrNode.appendChild(document.createTextNode("2"));
- shouldBe('document.getElementById("0g")', 'null');
- shouldBe('document.getElementById("0g2")', 'document.body');
- shouldBe('document.body.id', '"0g2"');
- shouldBe('document.body.getAttribute("id")', '"0g2"');
- shouldBe('attrNode.value', '"0g2"');
- shouldBe('attrNode.childNodes.length', '3');
-} catch (ex) {
- debug(ex);
-}
-
-debug("\n10. Attr.removeChild()");
-attrNode.nodeValue = "h";
-attrNode.removeChild(attrNode.firstChild);
-shouldBe('document.body.getAttributeNode("id").childNodes.length', '0');
-shouldBe('document.getElementById("h")', 'null');
-shouldBe('document.getElementById("")', 'null');
-shouldBe('document.body.id', '""');
-shouldBe('document.body.getAttribute("id")', '""');
-shouldBe('document.body.getAttributeNode("id").value', '""');
-
-debug("\n11. Changing Text.nodeValue.");
-attrNode.nodeValue = "h";
-attrNode.firstChild.nodeValue = "i";
-shouldBe('attrNode.firstChild.nodeValue', '"i"');
-shouldBe('document.getElementById("i")', 'document.body');
-shouldBe('document.body.id', '"i"');
-shouldBe('document.body.getAttribute("id")', '"i"');
-shouldBe('attrNode.value', '"i"');
-shouldBe('attrNode.childNodes.length', '1');
debug("\n12. Chnaging Attr.value.");
attrNode.value = "hi";
@@ -115,78 +54,6 @@ shouldBe('document.getElementById("hi")', 'document.body');
shouldBe('document.body.id', '"hi"');
shouldBe('document.body.getAttribute("id")', '"hi"');
shouldBe('attrNode.value', '"hi"');
-shouldBe('attrNode.childNodes.length', '1');
-
-debug("\n13. Text.splitText().");
-attrNode.firstChild.splitText(1);
-shouldBe('document.getElementById("hi")', 'document.body');
-shouldBe('document.body.id', '"hi"');
-shouldBe('document.body.getAttribute("id")', '"hi"');
-shouldBe('document.body.getAttributeNode("id").value', '"hi"');
-shouldBe('document.body.getAttributeNode("id").childNodes.length', '2');
-
-debug("\n14. Node.normalize(), joining text nodes.");
-attrNode.normalize();
-shouldBe('document.getElementById("hi")', 'document.body');
-shouldBe('document.body.id', '"hi"');
-shouldBe('document.body.getAttribute("id")', '"hi"');
-shouldBe('document.body.getAttributeNode("id").value', '"hi"');
-shouldBe('document.body.getAttributeNode("id").childNodes.length', '1');
-
-debug("\n15. Changing Attr.nodeValue.");
-attrNode.nodeValue = "foo";
-attrNode.firstChild.data = "j";
-shouldBe('document.getElementById("hi")', 'null');
-shouldBe('document.getElementById("j")', 'document.body');
-shouldBe('document.body.id', '"j"');
-shouldBe('document.body.getAttribute("id")', '"j"');
-shouldBe('attrNode.value', '"j"');
-shouldBe('attrNode.childNodes.length', '1');
-
-debug("\n16. Changing Text.data.");
-attrNode.firstChild.data = "k";
-shouldBe('document.getElementById("j")', 'null');
-shouldBe('document.getElementById("k")', 'document.body');
-shouldBe('document.body.id', '"k"');
-shouldBe('document.body.getAttribute("id")', '"k"');
-shouldBe('attrNode.value', '"k"');
-shouldBe('attrNode.childNodes.length', '1');
-
-debug("\n17. Changing text child with appendData().");
-attrNode.firstChild.appendData("l");
-shouldBe('document.getElementById("k")', 'null');
-shouldBe('document.getElementById("kl")', 'document.body');
-shouldBe('document.body.id', '"kl"');
-shouldBe('document.body.getAttribute("id")', '"kl"');
-shouldBe('attrNode.value', '"kl"');
-shouldBe('attrNode.childNodes.length', '1');
-
-debug("\n18. Changing text child with insertData().");
-attrNode.firstChild.insertData(1, "1");
-shouldBe('document.getElementById("kl")', 'null');
-shouldBe('document.getElementById("k1l")', 'document.body');
-shouldBe('document.body.id', '"k1l"');
-shouldBe('document.body.getAttribute("id")', '"k1l"');
-shouldBe('attrNode.value', '"k1l"');
-shouldBe('attrNode.childNodes.length', '1');
-
-debug("\n19. Changing text child with deleteData().");
-attrNode.firstChild.deleteData(0, 2);
-shouldBe('document.getElementById("k1l")', 'null');
-shouldBe('document.getElementById("l")', 'document.body');
-shouldBe('document.body.id', '"l"');
-shouldBe('document.body.getAttribute("id")', '"l"');
-shouldBe('attrNode.value', '"l"');
-shouldBe('attrNode.childNodes.length', '1');
-
-debug("\n20. Changing text child with replaceData().");
-attrNode.firstChild.replaceData(0, 1, "mn");
-shouldBe('document.getElementById("l")', 'null');
-shouldBe('document.getElementById("mn")', 'document.body');
-shouldBe('document.body.id', '"mn"');
-shouldBe('document.body.getAttribute("id")', '"mn"');
-shouldBe('attrNode.value', '"mn"');
-shouldBe('attrNode.childNodes.length', '1');
debug("\n21. Remove an Attr node.");
document.body.removeAttributeNode(attrNode);

Powered by Google App Engine
This is Rietveld 408576698