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 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 // offsetParent, "tops out" at BODY. But people could conceivably pass in | 1265 // offsetParent, "tops out" at BODY. But people could conceivably pass in |
1266 // the document.documentElement and I want it to return an absolute offset, | 1266 // the document.documentElement and I want it to return an absolute offset, |
1267 // so we have the special case checking for HTML. | 1267 // so we have the special case checking for HTML. |
1268 $if JSINTEROP | 1268 $if JSINTEROP |
1269 bool sameAsParent = current == parent; | 1269 bool sameAsParent = current == parent; |
1270 $else | 1270 $else |
1271 bool sameAsParent = identical(current, parent); | 1271 bool sameAsParent = identical(current, parent); |
1272 $endif | 1272 $endif |
1273 bool foundAsParent = sameAsParent || parent.tagName == 'HTML'; | 1273 bool foundAsParent = sameAsParent || parent.tagName == 'HTML'; |
1274 if (current == null || sameAsParent) { | 1274 if (current == null || sameAsParent) { |
1275 if (foundAsParent) return new Point(0, 0); | 1275 if (foundAsParent) return new Point/*<num>*/(0, 0); |
1276 throw new ArgumentError("Specified element is not a transitive offset " | 1276 throw new ArgumentError("Specified element is not a transitive offset " |
1277 "parent of this element."); | 1277 "parent of this element."); |
1278 } | 1278 } |
1279 Element parentOffset = current.offsetParent; | 1279 Element parentOffset = current.offsetParent; |
1280 Point p = Element._offsetToHelper(parentOffset, parent); | 1280 Point p = Element._offsetToHelper(parentOffset, parent); |
1281 return new Point(p.x + current.offsetLeft, p.y + current.offsetTop); | 1281 return new Point/*<num>*/(p.x + current.offsetLeft, p.y + current.offsetTop)
; |
1282 } | 1282 } |
1283 | 1283 |
1284 static HtmlDocument _parseDocument; | 1284 static HtmlDocument _parseDocument; |
1285 static Range _parseRange; | 1285 static Range _parseRange; |
1286 static NodeValidatorBuilder _defaultValidator; | 1286 static NodeValidatorBuilder _defaultValidator; |
1287 static _ValidatingTreeSanitizer _defaultSanitizer; | 1287 static _ValidatingTreeSanitizer _defaultSanitizer; |
1288 | 1288 |
1289 /** | 1289 /** |
1290 * Create a DocumentFragment from the HTML fragment and ensure that it follows | 1290 * Create a DocumentFragment from the HTML fragment and ensure that it follows |
1291 * the sanitization rules specified by the validator or treeSanitizer. | 1291 * the sanitization rules specified by the validator or treeSanitizer. |
(...skipping 377 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 |