| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.html; | 8 library engine.html; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| (...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 * @param ifEmpty the (empty) nodes to return if "children" is empty | 1481 * @param ifEmpty the (empty) nodes to return if "children" is empty |
| 1482 * @return the nodes that were made children of this node | 1482 * @return the nodes that were made children of this node |
| 1483 */ | 1483 */ |
| 1484 List becomeParentOfAll(List children, {List ifEmpty}) { | 1484 List becomeParentOfAll(List children, {List ifEmpty}) { |
| 1485 if (children == null || children.isEmpty) { | 1485 if (children == null || children.isEmpty) { |
| 1486 if (ifEmpty != null) { | 1486 if (ifEmpty != null) { |
| 1487 return ifEmpty; | 1487 return ifEmpty; |
| 1488 } | 1488 } |
| 1489 } | 1489 } |
| 1490 if (children != null) { | 1490 if (children != null) { |
| 1491 for (JavaIterator iter = new JavaIterator(children); iter.hasNext;) { | 1491 children.forEach((XmlNode node) { |
| 1492 XmlNode node = iter.next(); | |
| 1493 node.parent = this; | 1492 node.parent = this; |
| 1494 } | 1493 }); |
| 1495 // This will create ArrayList for exactly given number of elements. | |
| 1496 return new List.from(children); | |
| 1497 } | 1494 } |
| 1498 return children; | 1495 return children; |
| 1499 } | 1496 } |
| 1500 | 1497 |
| 1501 /** | 1498 /** |
| 1502 * This method exists for debugging purposes only. | 1499 * This method exists for debugging purposes only. |
| 1503 */ | 1500 */ |
| 1504 void _appendIdentifier(StringBuffer buffer, XmlNode node) { | 1501 void _appendIdentifier(StringBuffer buffer, XmlNode node) { |
| 1505 if (node is XmlTagNode) { | 1502 if (node is XmlTagNode) { |
| 1506 buffer.write(node.tag); | 1503 buffer.write(node.tag); |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2040 */ | 2037 */ |
| 2041 abstract class XmlVisitor<R> { | 2038 abstract class XmlVisitor<R> { |
| 2042 R visitHtmlScriptTagNode(HtmlScriptTagNode node); | 2039 R visitHtmlScriptTagNode(HtmlScriptTagNode node); |
| 2043 | 2040 |
| 2044 R visitHtmlUnit(HtmlUnit htmlUnit); | 2041 R visitHtmlUnit(HtmlUnit htmlUnit); |
| 2045 | 2042 |
| 2046 R visitXmlAttributeNode(XmlAttributeNode xmlAttributeNode); | 2043 R visitXmlAttributeNode(XmlAttributeNode xmlAttributeNode); |
| 2047 | 2044 |
| 2048 R visitXmlTagNode(XmlTagNode xmlTagNode); | 2045 R visitXmlTagNode(XmlTagNode xmlTagNode); |
| 2049 } | 2046 } |
| OLD | NEW |