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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 * | 720 * |
721 * [wc]: http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html | 721 * [wc]: http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html |
722 * [x-tags]: http://x-tags.org/ | 722 * [x-tags]: http://x-tags.org/ |
723 */ | 723 */ |
724 $if DART2JS | 724 $if DART2JS |
725 @Creates('Null') // Set from Dart code; does not instantiate a native type. | 725 @Creates('Null') // Set from Dart code; does not instantiate a native type. |
726 $endif | 726 $endif |
727 var xtag; | 727 var xtag; |
728 | 728 |
729 $if DART2JS | 729 $if DART2JS |
| 730 static const EventStreamProvider<WheelEvent> mouseWheelEvent = |
| 731 const _CustomEventStreamProvider<WheelEvent>( |
| 732 Element._determineMouseWheelEventType); |
| 733 |
| 734 static String _determineMouseWheelEventType(EventTarget e) { |
| 735 if (JS('bool', '#.onwheel !== undefined', e)) { |
| 736 // W3C spec, and should be IE9+, but IE has a bug exposing onwheel. |
| 737 return 'wheel'; |
| 738 } else if (JS('bool', '#.onmousewheel !== undefined', e)) { |
| 739 // Chrome & IE |
| 740 return 'mousewheel'; |
| 741 } else { |
| 742 // Firefox |
| 743 return 'DOMMouseScroll'; |
| 744 } |
| 745 } |
| 746 |
730 /** | 747 /** |
731 * Creates a text node and inserts it into the DOM at the specified location. | 748 * Creates a text node and inserts it into the DOM at the specified location. |
732 * | 749 * |
733 * To see the possible values for [where], read the doc for | 750 * To see the possible values for [where], read the doc for |
734 * [insertAdjacentHtml]. | 751 * [insertAdjacentHtml]. |
735 * | 752 * |
736 * See also: | 753 * See also: |
737 * | 754 * |
738 * * [insertAdjacentHtml] | 755 * * [insertAdjacentHtml] |
739 */ | 756 */ |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 $if DART2JS | 991 $if DART2JS |
975 // Optimization to improve performance until the dart2js compiler inlines this | 992 // Optimization to improve performance until the dart2js compiler inlines this |
976 // method. | 993 // method. |
977 static dynamic createElement_tag(String tag) => | 994 static dynamic createElement_tag(String tag) => |
978 JS('Element', 'document.createElement(#)', tag); | 995 JS('Element', 'document.createElement(#)', tag); |
979 $else | 996 $else |
980 static Element createElement_tag(String tag) => | 997 static Element createElement_tag(String tag) => |
981 document.$dom_createElement(tag); | 998 document.$dom_createElement(tag); |
982 $endif | 999 $endif |
983 } | 1000 } |
OLD | NEW |