| Index: sky/specs/elements.md
|
| diff --git a/sky/specs/elements.md b/sky/specs/elements.md
|
| index b3da48b0698271de58f9ff4895fdaa5a3612b12a..37bb95c4c250106f0724864ca35a517e1ee541fa 100644
|
| --- a/sky/specs/elements.md
|
| +++ b/sky/specs/elements.md
|
| @@ -139,10 +139,11 @@ abstract class ParentNode extends Node {
|
|
|
| external void _appendChild(Node node); // O(N) in number of descendants
|
| // node must be Text or Element
|
| - void appendChild(Node node) {
|
| + Node appendChild(Node node) {
|
| if (node is String)
|
| node = new Text(node);
|
| - _appendChild(node);
|
| + _appendChild(node);
|
| + return node;
|
| }
|
| void append(List nodes) {
|
| nodes.forEach(appendChild);
|
| @@ -150,10 +151,11 @@ abstract class ParentNode extends Node {
|
|
|
| external void _prependChild(Node node); // O(N) in number of descendants
|
| // node must be Text or Element
|
| - void prependChild(Node node) {
|
| + Node prependChild(Node node) {
|
| if (node is String)
|
| node = new Text(node);
|
| - _prependChild(node);
|
| + _prependChild(node);
|
| + return node;
|
| }
|
| void prepend(List nodes) {
|
| // note: not implemented in terms of _prependChild()
|
| @@ -164,9 +166,10 @@ abstract class ParentNode extends Node {
|
| }
|
|
|
| external void removeChildren(); // O(N) in number of descendants
|
| - void setChild(Node node) {
|
| + Node setChild(Node node) {
|
| removeChildren();
|
| appendChild(node);
|
| + return node;
|
| }
|
| void setChildren(List nodes) {
|
| removeChildren();
|
|
|