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

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

Issue 26077002: Add scrollIntoViewIfNeeded on Dartium. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Raw Element. 8 // Raw Element.
9 final Element _element; 9 final Element _element;
10 final HtmlCollection _childElements; 10 final HtmlCollection _childElements;
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 * Note that alignCenter is currently only supported on WebKit platforms. If 784 * Note that alignCenter is currently only supported on WebKit platforms. If
785 * alignCenter is specified but not supported then this will fall back to 785 * alignCenter is specified but not supported then this will fall back to
786 * alignTop. 786 * alignTop.
787 * 787 *
788 * See also: 788 * See also:
789 * 789 *
790 * * [scrollIntoView](http://docs.webplatform.org/wiki/dom/methods/scrollIntoV iew) 790 * * [scrollIntoView](http://docs.webplatform.org/wiki/dom/methods/scrollIntoV iew)
791 * * [scrollIntoViewIfNeeded](http://docs.webplatform.org/wiki/dom/methods/scr ollIntoViewIfNeeded) 791 * * [scrollIntoViewIfNeeded](http://docs.webplatform.org/wiki/dom/methods/scr ollIntoViewIfNeeded)
792 */ 792 */
793 void scrollIntoView([ScrollAlignment alignment]) { 793 void scrollIntoView([ScrollAlignment alignment]) {
794 var hasScrollIntoViewIfNeeded = false; 794 var hasScrollIntoViewIfNeeded = true;
795 $if DART2JS 795 $if DART2JS
796 hasScrollIntoViewIfNeeded = 796 hasScrollIntoViewIfNeeded =
797 JS('bool', '!!(#.scrollIntoViewIfNeeded)', this); 797 JS('bool', '!!(#.scrollIntoViewIfNeeded)', this);
798 $endif 798 $endif
799 if (alignment == ScrollAlignment.TOP) { 799 if (alignment == ScrollAlignment.TOP) {
800 this._scrollIntoView(true); 800 this._scrollIntoView(true);
801 } else if (alignment == ScrollAlignment.BOTTOM) { 801 } else if (alignment == ScrollAlignment.BOTTOM) {
802 this._scrollIntoView(false); 802 this._scrollIntoView(false);
803 } else if (hasScrollIntoViewIfNeeded) { 803 } else if (hasScrollIntoViewIfNeeded) {
804 if (alignment == ScrollAlignment.CENTER) { 804 if (alignment == ScrollAlignment.CENTER) {
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 const ScrollAlignment._internal(this._value); 1409 const ScrollAlignment._internal(this._value);
1410 toString() => 'ScrollAlignment.$_value'; 1410 toString() => 'ScrollAlignment.$_value';
1411 1411
1412 /// Attempt to align the element to the top of the scrollable area. 1412 /// Attempt to align the element to the top of the scrollable area.
1413 static const TOP = const ScrollAlignment._internal('TOP'); 1413 static const TOP = const ScrollAlignment._internal('TOP');
1414 /// Attempt to center the element in the scrollable area. 1414 /// Attempt to center the element in the scrollable area.
1415 static const CENTER = const ScrollAlignment._internal('CENTER'); 1415 static const CENTER = const ScrollAlignment._internal('CENTER');
1416 /// Attempt to align the element to the bottom of the scrollable area. 1416 /// Attempt to align the element to the bottom of the scrollable area.
1417 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1417 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1418 } 1418 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698