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

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

Issue 1014843004: Make Element.animate work in dart2js Chrome (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix comment indentation Created 5 years, 9 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 class _ChildrenElementList extends ListBase<Element> 7 class _ChildrenElementList extends ListBase<Element>
8 implements NodeListWrapper { 8 implements NodeListWrapper {
9 // Raw Element. 9 // Raw Element.
10 final Element _element; 10 final Element _element;
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 /** *Deprecated*: override [attached] instead. */ 772 /** *Deprecated*: override [attached] instead. */
773 @Experimental() 773 @Experimental()
774 @deprecated 774 @deprecated
775 void enteredView() {} 775 void enteredView() {}
776 776
777 /** *Deprecated*: override [detached] instead. */ 777 /** *Deprecated*: override [detached] instead. */
778 @Experimental() 778 @Experimental()
779 @deprecated 779 @deprecated
780 void leftView() {} 780 void leftView() {}
781 781
782 $if DART2JS
783 /**
784 * Creates a new AnimationEffect object whose target element is the object
785 * on which the method is called, and calls the play() method of the
786 * AnimationTimeline object of the document timeline of the node document
787 * of the element, passing the newly created AnimationEffect as the argument
788 * to the method. Returns an AnimationPlayer for the effect.
789 *
790 * Examples
791 *
792 * var animation = elem.animate([{"opacity": 75}, {"opacity": 0}], 200);
793 *
794 * var animation = elem.animate([
795 * {"transform": "translate(100px, -100%)"},
796 * {"transform" : "translate(400px, 500px)"}
797 * ], 1500);
798 *
799 * The [frames] parameter is an Iterable<Map>, where the
800 * map entries specify CSS animation effects. The
801 * [timing] paramter can be a double, representing the number of milliseconds
802 * for the transition, or a Map with fields corresponding to those
803 * of the [Timing] object.
804 *
805 * This is not yet supported in Dartium.
806 **/
807 // TODO(alanknight): Correct above comment once it works in Dartium.
808 @Experimental
809 @SupportedBrowser(SupportedBrowser.CHROME, '36')
810 AnimationPlayer animate(Iterable<Map<String, dynamic>> frames, [timing]) {
811 if (frames is! Iterable || !(frames.every((x) => x is Map))) {
812 throw new ArgumentError("The frames parameter should be a List of Maps "
813 "with frame information");
814 }
815 var convertedFrames = frames;
816 if (convertedFrames is Iterable) {
817 convertedFrames = frames.map(convertDartToNative_Dictionary).toList();
818 }
819 var convertedTiming = timing;
820 if (convertedTiming is Map) {
821 convertedTiming = convertDartToNative_Dictionary(convertedTiming);
822 }
823 return convertedTiming == null
824 ? _animate(convertedFrames)
825 : _animate(convertedFrames, convertedTiming);
826 }
827
828 @DomName('Element.animate')
829 @JSName('animate')
830 @Experimental() // untriaged
831 AnimationPlayer _animate(Object effect, [timing]) native;
832 $endif
782 /** 833 /**
783 * Called by the DOM whenever an attribute on this has been changed. 834 * Called by the DOM whenever an attribute on this has been changed.
784 */ 835 */
785 void attributeChanged(String name, String oldValue, String newValue) {} 836 void attributeChanged(String name, String oldValue, String newValue) {}
786 837
787 // Hooks to support custom WebComponents. 838 // Hooks to support custom WebComponents.
788 839
789 $if DART2JS 840 $if DART2JS
790 @Creates('Null') // Set from Dart code; does not instantiate a native type. 841 @Creates('Null') // Set from Dart code; does not instantiate a native type.
791 $endif 842 $endif
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 const ScrollAlignment._internal(this._value); 1545 const ScrollAlignment._internal(this._value);
1495 toString() => 'ScrollAlignment.$_value'; 1546 toString() => 'ScrollAlignment.$_value';
1496 1547
1497 /// Attempt to align the element to the top of the scrollable area. 1548 /// Attempt to align the element to the top of the scrollable area.
1498 static const TOP = const ScrollAlignment._internal('TOP'); 1549 static const TOP = const ScrollAlignment._internal('TOP');
1499 /// Attempt to center the element in the scrollable area. 1550 /// Attempt to center the element in the scrollable area.
1500 static const CENTER = const ScrollAlignment._internal('CENTER'); 1551 static const CENTER = const ScrollAlignment._internal('CENTER');
1501 /// Attempt to align the element to the bottom of the scrollable area. 1552 /// Attempt to align the element to the bottom of the scrollable area.
1502 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1553 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1503 } 1554 }
OLDNEW
« tests/html/element_animate_test.dart ('K') | « tools/dom/scripts/systemhtml.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698