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 implements NodeListWrapper { | 8 implements NodeListWrapper { |
9 // Raw Element. | 9 // Raw Element. |
10 final Element _element; | 10 final Element _element; |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 CssRect get marginEdge; | 257 CssRect get marginEdge; |
258 $!STREAM_GETTER_SIGNATURES | 258 $!STREAM_GETTER_SIGNATURES |
259 } | 259 } |
260 | 260 |
261 // Wrapper over an immutable NodeList to make it implement ElementList. | 261 // Wrapper over an immutable NodeList to make it implement ElementList. |
262 // | 262 // |
263 // Clients are {`Document`, `DocumentFragment`}.`querySelectorAll` which are | 263 // Clients are {`Document`, `DocumentFragment`}.`querySelectorAll` which are |
264 // declared to return `ElementList`. This provides all the static analysis | 264 // declared to return `ElementList`. This provides all the static analysis |
265 // benefit so there is no need for this class have a constrained type parameter. | 265 // benefit so there is no need for this class have a constrained type parameter. |
266 // | 266 // |
267 class _FrozenElementList extends ListBase | 267 class _FrozenElementList extends ListBase<Element> |
268 implements ElementList, NodeListWrapper { | 268 implements ElementList<Element>, NodeListWrapper { |
269 final List<Node> _nodeList; | 269 final List<Node> _nodeList; |
270 | 270 |
271 $if JSINTEROP | 271 $if JSINTEROP |
272 var dartClass_instance; | 272 var dartClass_instance; |
273 | 273 |
274 _FrozenElementList._wrap(this._nodeList) { | 274 _FrozenElementList._wrap(this._nodeList) { |
275 this.dartClass_instance = this._nodeList; | 275 this.dartClass_instance = this._nodeList; |
276 } | 276 } |
277 $else | 277 $else |
278 _FrozenElementList._wrap(this._nodeList); | 278 _FrozenElementList._wrap(this._nodeList); |
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 return result; | 1523 return result; |
1524 } | 1524 } |
1525 $else | 1525 $else |
1526 static String _safeTagName(element) { | 1526 static String _safeTagName(element) { |
1527 try { | 1527 try { |
1528 // Safe as we plumb directly to a C++ native method. | 1528 // Safe as we plumb directly to a C++ native method. |
1529 return element.tagName; | 1529 return element.tagName; |
1530 } catch (e) {} | 1530 } catch (e) {} |
1531 return 'element tag unavailable'; | 1531 return 'element tag unavailable'; |
1532 } | 1532 } |
1533 $endif | 1533 $endif |
1534 | 1534 |
1535 $if DART2JS | 1535 $if DART2JS |
1536 @DomName('Element.offsetParent') | 1536 @DomName('Element.offsetParent') |
1537 @DocsEditable() | 1537 @DocsEditable() |
1538 final Element offsetParent; | 1538 final Element offsetParent; |
1539 | 1539 |
1540 @DomName('Element.offsetHeight') | 1540 @DomName('Element.offsetHeight') |
1541 @DocsEditable() | 1541 @DocsEditable() |
1542 int get offsetHeight => JS('num', '#.offsetHeight', this).round(); | 1542 int get offsetHeight => JS('num', '#.offsetHeight', this).round(); |
1543 | 1543 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1669 const ScrollAlignment._internal(this._value); | 1669 const ScrollAlignment._internal(this._value); |
1670 toString() => 'ScrollAlignment.$_value'; | 1670 toString() => 'ScrollAlignment.$_value'; |
1671 | 1671 |
1672 /// Attempt to align the element to the top of the scrollable area. | 1672 /// Attempt to align the element to the top of the scrollable area. |
1673 static const TOP = const ScrollAlignment._internal('TOP'); | 1673 static const TOP = const ScrollAlignment._internal('TOP'); |
1674 /// Attempt to center the element in the scrollable area. | 1674 /// Attempt to center the element in the scrollable area. |
1675 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1675 static const CENTER = const ScrollAlignment._internal('CENTER'); |
1676 /// Attempt to align the element to the bottom of the scrollable area. | 1676 /// Attempt to align the element to the bottom of the scrollable area. |
1677 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1677 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
1678 } | 1678 } |
OLD | NEW |