| Index: tools/dom/templates/html/impl/impl_Node.darttemplate
|
| diff --git a/tools/dom/templates/html/impl/impl_Node.darttemplate b/tools/dom/templates/html/impl/impl_Node.darttemplate
|
| index 307cd0cea96e329577874641d1b269bf174c973d..5782724089feb30d8cdbdcd2279f4bf499bf5660 100644
|
| --- a/tools/dom/templates/html/impl/impl_Node.darttemplate
|
| +++ b/tools/dom/templates/html/impl/impl_Node.darttemplate
|
| @@ -70,9 +70,10 @@ $endif
|
|
|
| void addAll(Iterable<Node> iterable) {
|
| if (iterable is _ChildNodeListLazy) {
|
| - if (iterable._this != _this) {
|
| + if (!identical(iterable._this, _this)) {
|
| // Optimized route for copying between nodes.
|
| for (var i = 0, len = iterable.length; i < len; ++i) {
|
| + // Should use $dom_firstChild, Bug 8886.
|
| _this.$dom_appendChild(iterable[0]);
|
| }
|
| }
|
| @@ -291,5 +292,30 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
|
| return this;
|
| }
|
|
|
| + /**
|
| + * Inserts all of the nodes into this node directly before refChild.
|
| + *
|
| + * See also:
|
| + *
|
| + * * [insertBefore]
|
| + */
|
| + Node insertAllBefore(Iterable<Node> newNodes, Node refChild) {
|
| + if (newNodes is _ChildNodeListLazy) {
|
| + if (identical(newNodes._this, this)) {
|
| + throw new ArgumentError(newNodes);
|
| + }
|
| +
|
| + // Optimized route for copying between nodes.
|
| + for (var i = 0, len = newNodes.length; i < len; ++i) {
|
| + // Should use $dom_firstChild, Bug 8886.
|
| + this.insertBefore(newNodes[0], refChild);
|
| + }
|
| + } else {
|
| + for (var node in newNodes) {
|
| + this.insertBefore(node, refChild);
|
| + }
|
| + }
|
| + }
|
| +
|
| $!MEMBERS
|
| }
|
|
|