| 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 $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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |