From ac8d930432b1ea347f158ccfde5932ce688cbcbd Mon Sep 17 00:00:00 2001 From: Hixie Date: Fri, 13 Feb 2015 15:48:24 -0800 Subject: [PATCH] Specs: (reverts part of recent checkin) Make appendChild, prependChild, and setChild not return the child, since that can improve perf (especially if they're actually implemented natively) Review URL: https://codereview.chromium.org/924163004 --- specs/elements.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/specs/elements.md b/specs/elements.md index 37bb95c4c25..4ace5d4d95f 100644 --- a/specs/elements.md +++ b/specs/elements.md @@ -139,11 +139,10 @@ abstract class ParentNode extends Node { external void _appendChild(Node node); // O(N) in number of descendants // node must be Text or Element - Node appendChild(Node node) { + void appendChild(Node node) { if (node is String) node = new Text(node); _appendChild(node); - return node; } void append(List nodes) { nodes.forEach(appendChild); @@ -151,11 +150,10 @@ abstract class ParentNode extends Node { external void _prependChild(Node node); // O(N) in number of descendants // node must be Text or Element - Node prependChild(Node node) { + void prependChild(Node node) { if (node is String) node = new Text(node); _prependChild(node); - return node; } void prepend(List nodes) { // note: not implemented in terms of _prependChild() @@ -166,10 +164,9 @@ abstract class ParentNode extends Node { } external void removeChildren(); // O(N) in number of descendants - Node setChild(Node node) { + void setChild(Node node) { removeChildren(); appendChild(node); - return node; } void setChildren(List nodes) { removeChildren();