| 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 | 700 |
| 701 /** | 701 /** |
| 702 * The set of all CSS values applied to this element, including inherited | 702 * The set of all CSS values applied to this element, including inherited |
| 703 * and default values. | 703 * and default values. |
| 704 * | 704 * |
| 705 * The computedStyle contains values that are inherited from other | 705 * The computedStyle contains values that are inherited from other |
| 706 * sources, such as parent elements or stylesheets. This differs from the | 706 * sources, such as parent elements or stylesheets. This differs from the |
| 707 * [style] property, which contains only the values specified directly on this | 707 * [style] property, which contains only the values specified directly on this |
| 708 * element. | 708 * element. |
| 709 * | 709 * |
| 710 * PseudoElement can be values such as `::after`, `::before`, `::marker`, |
| 711 * `::line-marker`. |
| 712 * |
| 710 * See also: | 713 * See also: |
| 711 * | 714 * |
| 712 * * [CSS Inheritance and Cascade](http://docs.webplatform.org/wiki/tutorials/
inheritance_and_cascade) | 715 * * [CSS Inheritance and Cascade](http://docs.webplatform.org/wiki/tutorials/
inheritance_and_cascade) |
| 716 * * [Pseudo-elements](http://docs.webplatform.org/wiki/css/selectors/pseudo-e
lements) |
| 713 */ | 717 */ |
| 714 Future<CssStyleDeclaration> get computedStyle { | 718 CssStyleDeclaration getComputedStyle([String pseudoElement]) { |
| 715 // TODO(jacobr): last param should be null, see b/5045788 | 719 if (pseudoElement == null) { |
| 716 return getComputedStyle(''); | 720 pseudoElement = ''; |
| 721 } |
| 722 // TODO(jacobr): last param should be null, see b/5045788 |
| 723 return window.$dom_getComputedStyle(this, pseudoElement); |
| 717 } | 724 } |
| 718 | 725 |
| 719 /** | 726 /** |
| 720 * Returns the computed styles for pseudo-elements such as `::after`, | |
| 721 * `::before`, `::marker`, `::line-marker`. | |
| 722 * | |
| 723 * See also: | |
| 724 * | |
| 725 * * [Pseudo-elements](http://docs.webplatform.org/wiki/css/selectors/pseudo-e
lements) | |
| 726 */ | |
| 727 Future<CssStyleDeclaration> getComputedStyle(String pseudoElement) { | |
| 728 return _createMeasurementFuture( | |
| 729 () => window.$dom_getComputedStyle(this, pseudoElement), | |
| 730 new Completer<CssStyleDeclaration>()); | |
| 731 } | |
| 732 | |
| 733 /** | |
| 734 * Adds the specified element to after the last child of this element. | 727 * Adds the specified element to after the last child of this element. |
| 735 */ | 728 */ |
| 736 void append(Element e) { | 729 void append(Element e) { |
| 737 this.children.add(e); | 730 this.children.add(e); |
| 738 } | 731 } |
| 739 | 732 |
| 740 /** | 733 /** |
| 741 * Adds the specified text as a text node after the last child of this | 734 * Adds the specified text as a text node after the last child of this |
| 742 * element. | 735 * element. |
| 743 */ | 736 */ |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 $if DART2JS | 1037 $if DART2JS |
| 1045 // Optimization to improve performance until the dart2js compiler inlines this | 1038 // Optimization to improve performance until the dart2js compiler inlines this |
| 1046 // method. | 1039 // method. |
| 1047 static dynamic createElement_tag(String tag) => | 1040 static dynamic createElement_tag(String tag) => |
| 1048 JS('Element', 'document.createElement(#)', tag); | 1041 JS('Element', 'document.createElement(#)', tag); |
| 1049 $else | 1042 $else |
| 1050 static Element createElement_tag(String tag) => | 1043 static Element createElement_tag(String tag) => |
| 1051 document.$dom_createElement(tag); | 1044 document.$dom_createElement(tag); |
| 1052 $endif | 1045 $endif |
| 1053 } | 1046 } |
| OLD | NEW |