| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of html; | 5 part of html; |
| 6 | 6 |
| 7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated | 7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated |
| 8 // functionality. | 8 // functionality. |
| 9 class _ChildrenElementList implements List { | 9 class _ChildrenElementList implements List { |
| 10 // Raw Element. | 10 // Raw Element. |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 | 560 |
| 561 void set attributes(Map<String, String> value) { | 561 void set attributes(Map<String, String> value) { |
| 562 Map<String, String> attributes = this.attributes; | 562 Map<String, String> attributes = this.attributes; |
| 563 attributes.clear(); | 563 attributes.clear(); |
| 564 for (String key in value.keys) { | 564 for (String key in value.keys) { |
| 565 attributes[key] = value[key]; | 565 attributes[key] = value[key]; |
| 566 } | 566 } |
| 567 } | 567 } |
| 568 | 568 |
| 569 /** | 569 /** |
| 570 * Deprecated, use innerHtml instead. | |
| 571 */ | |
| 572 @deprecated | |
| 573 String get innerHTML => this.innerHtml; | |
| 574 @deprecated | |
| 575 void set innerHTML(String value) { | |
| 576 this.innerHtml = value; | |
| 577 } | |
| 578 | |
| 579 @deprecated | |
| 580 void set elements(Collection<Element> value) { | |
| 581 this.children = value; | |
| 582 } | |
| 583 | |
| 584 /** | |
| 585 * Deprecated, use [children] instead. | |
| 586 */ | |
| 587 @deprecated | |
| 588 List<Element> get elements => this.children; | |
| 589 | |
| 590 /** | |
| 591 * List of the direct children of this element. | 570 * List of the direct children of this element. |
| 592 * | 571 * |
| 593 * This collection can be used to add and remove elements from the document. | 572 * This collection can be used to add and remove elements from the document. |
| 594 * | 573 * |
| 595 * var item = new DivElement(); | 574 * var item = new DivElement(); |
| 596 * item.text = 'Something'; | 575 * item.text = 'Something'; |
| 597 * document.body.children.add(item) // Item is now displayed on the page. | 576 * document.body.children.add(item) // Item is now displayed on the page. |
| 598 * for (var element in document.body.children) { | 577 * for (var element in document.body.children) { |
| 599 * element.style.background = 'red'; // Turns every child of body red. | 578 * element.style.background = 'red'; // Turns every child of body red. |
| 600 * } | 579 * } |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 $if DART2JS | 1019 $if DART2JS |
| 1041 // Optimization to improve performance until the dart2js compiler inlines this | 1020 // Optimization to improve performance until the dart2js compiler inlines this |
| 1042 // method. | 1021 // method. |
| 1043 static dynamic createElement_tag(String tag) => | 1022 static dynamic createElement_tag(String tag) => |
| 1044 JS('Element', 'document.createElement(#)', tag); | 1023 JS('Element', 'document.createElement(#)', tag); |
| 1045 $else | 1024 $else |
| 1046 static Element createElement_tag(String tag) => | 1025 static Element createElement_tag(String tag) => |
| 1047 document.$dom_createElement(tag); | 1026 document.$dom_createElement(tag); |
| 1048 $endif | 1027 $endif |
| 1049 } | 1028 } |
| OLD | NEW |