| 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 // TODO(jacobr): use _Lists.dart to remove some of the duplicated | 5 // TODO(jacobr): use _Lists.dart to remove some of the duplicated |
| 6 // functionality. | 6 // functionality. |
| 7 class _ChildrenElementList implements ElementList { | 7 class _ChildrenElementList implements ElementList { |
| 8 // Raw Element. | 8 // Raw Element. |
| 9 final _ElementImpl _element; | 9 final _ElementImpl _element; |
| 10 final _HTMLCollectionImpl _childElements; | 10 final _HTMLCollectionImpl _childElements; |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 Future<CSSStyleDeclaration> get computedStyle() { | 712 Future<CSSStyleDeclaration> get computedStyle() { |
| 713 // TODO(jacobr): last param should be null, see b/5045788 | 713 // TODO(jacobr): last param should be null, see b/5045788 |
| 714 return getComputedStyle(''); | 714 return getComputedStyle(''); |
| 715 } | 715 } |
| 716 | 716 |
| 717 Future<CSSStyleDeclaration> getComputedStyle(String pseudoElement) { | 717 Future<CSSStyleDeclaration> getComputedStyle(String pseudoElement) { |
| 718 return _createMeasurementFuture( | 718 return _createMeasurementFuture( |
| 719 () => _window.$dom_getComputedStyle(this, pseudoElement), | 719 () => _window.$dom_getComputedStyle(this, pseudoElement), |
| 720 new Completer<CSSStyleDeclaration>()); | 720 new Completer<CSSStyleDeclaration>()); |
| 721 } | 721 } |
| 722 |
| 723 // Hooks to support custom WebComponents. |
| 724 var xtag; |
| 725 |
| 726 $if DARTIUM |
| 727 noSuchMethod(String name, List args) { |
| 728 if (dynamicUnknownElementDispatcher == null) { |
| 729 throw new NoSuchMethodException(this, name, args); |
| 730 } else { |
| 731 return dynamicUnknownElementDispatcher(this, name, args); |
| 732 } |
| 733 } |
| 734 $else |
| 735 // TODO(vsm): Implement noSuchMethod or similar for dart2js. |
| 736 $endif |
| 737 |
| 722 $!MEMBERS | 738 $!MEMBERS |
| 723 } | 739 } |
| 724 | 740 |
| 741 // Temporary dispatch hook to support WebComponents. |
| 742 Function dynamicUnknownElementDispatcher; |
| 743 |
| 725 final _START_TAG_REGEXP = const RegExp('<(\\w+)'); | 744 final _START_TAG_REGEXP = const RegExp('<(\\w+)'); |
| 726 class _ElementFactoryProvider { | 745 class _ElementFactoryProvider { |
| 727 static final _CUSTOM_PARENT_TAG_MAP = const { | 746 static final _CUSTOM_PARENT_TAG_MAP = const { |
| 728 'body' : 'html', | 747 'body' : 'html', |
| 729 'head' : 'html', | 748 'head' : 'html', |
| 730 'caption' : 'table', | 749 'caption' : 'table', |
| 731 'td': 'tr', | 750 'td': 'tr', |
| 732 'colgroup': 'table', | 751 'colgroup': 'table', |
| 733 'col' : 'colgroup', | 752 'col' : 'colgroup', |
| 734 'tr' : 'tbody', | 753 'tr' : 'tbody', |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 | 795 |
| 777 /** @domName Document.createElement */ | 796 /** @domName Document.createElement */ |
| 778 $if DART2JS | 797 $if DART2JS |
| 779 // Optimization to improve performance until the dart2js compiler inlines this | 798 // Optimization to improve performance until the dart2js compiler inlines this |
| 780 // method. | 799 // method. |
| 781 factory Element.tag(String tag) native "return document.createElement(tag)"; | 800 factory Element.tag(String tag) native "return document.createElement(tag)"; |
| 782 $else | 801 $else |
| 783 factory Element.tag(String tag) => _document.$dom_createElement(tag); | 802 factory Element.tag(String tag) => _document.$dom_createElement(tag); |
| 784 $endif | 803 $endif |
| 785 } | 804 } |
| OLD | NEW |