Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 12211099: Fixing TransitionEnd event. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 $LIBRARYNAME; 5 part of $LIBRARYNAME;
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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 * 763 *
764 * [wc]: http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html 764 * [wc]: http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html
765 * [x-tags]: http://x-tags.org/ 765 * [x-tags]: http://x-tags.org/
766 */ 766 */
767 $if DART2JS 767 $if DART2JS
768 @Creates('Null') // Set from Dart code; does not instantiate a native type. 768 @Creates('Null') // Set from Dart code; does not instantiate a native type.
769 $endif 769 $endif
770 var xtag; 770 var xtag;
771 771
772 $if DART2JS 772 $if DART2JS
773 @DomName('Element.mouseWheelEvent')
773 static const EventStreamProvider<WheelEvent> mouseWheelEvent = 774 static const EventStreamProvider<WheelEvent> mouseWheelEvent =
774 const _CustomEventStreamProvider<WheelEvent>( 775 const _CustomEventStreamProvider<WheelEvent>(
775 Element._determineMouseWheelEventType); 776 Element._determineMouseWheelEventType);
776 777
777 static String _determineMouseWheelEventType(EventTarget e) { 778 static String _determineMouseWheelEventType(EventTarget e) {
778 if (JS('bool', '#.onwheel !== undefined', e)) { 779 if (JS('bool', '#.onwheel !== undefined', e)) {
779 // W3C spec, and should be IE9+, but IE has a bug exposing onwheel. 780 // W3C spec, and should be IE9+, but IE has a bug exposing onwheel.
780 return 'wheel'; 781 return 'wheel';
781 } else if (JS('bool', '#.onmousewheel !== undefined', e)) { 782 } else if (JS('bool', '#.onmousewheel !== undefined', e)) {
782 // Chrome & IE 783 // Chrome & IE
783 return 'mousewheel'; 784 return 'mousewheel';
784 } else { 785 } else {
785 // Firefox 786 // Firefox
786 return 'DOMMouseScroll'; 787 return 'DOMMouseScroll';
787 } 788 }
788 } 789 }
789 790
791 @DomName('Element.webkitTransitionEndEvent')
792 static const EventStreamProvider<TransitionEvent> transitionEndEvent =
793 const _CustomEventStreamProvider<TransitionEvent>(
794 Element._determineTransitionEventType);
795
796 static String _determineTransitionEventType(EventTarget e) {
797 // Unfortunately the normal 'ontransitionend' style checks don't work here.
798 if (_Device.isWebKit) {
799 return 'webkitTransitionEnd';
800 } else if (_Device.isOpera) {
801 return 'oTransitionEnd';
802 }
803 return 'transitionend';
804 }
790 /** 805 /**
791 * Creates a text node and inserts it into the DOM at the specified location. 806 * Creates a text node and inserts it into the DOM at the specified location.
792 * 807 *
793 * To see the possible values for [where], read the doc for 808 * To see the possible values for [where], read the doc for
794 * [insertAdjacentHtml]. 809 * [insertAdjacentHtml].
795 * 810 *
796 * See also: 811 * See also:
797 * 812 *
798 * * [insertAdjacentHtml] 813 * * [insertAdjacentHtml]
799 */ 814 */
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 // Optimization to improve performance until the dart2js compiler inlines this 1051 // Optimization to improve performance until the dart2js compiler inlines this
1037 // method. 1052 // method.
1038 static dynamic createElement_tag(String tag) => 1053 static dynamic createElement_tag(String tag) =>
1039 // Firefox may return a JS function for some types (Embed, Object). 1054 // Firefox may return a JS function for some types (Embed, Object).
1040 JS('Element|=Object', 'document.createElement(#)', tag); 1055 JS('Element|=Object', 'document.createElement(#)', tag);
1041 $else 1056 $else
1042 static Element createElement_tag(String tag) => 1057 static Element createElement_tag(String tag) =>
1043 document.$dom_createElement(tag); 1058 document.$dom_createElement(tag);
1044 $endif 1059 $endif
1045 } 1060 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698