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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 } | 1231 } |
1232 var contextElement; | 1232 var contextElement; |
1233 if (this is BodyElement) { | 1233 if (this is BodyElement) { |
1234 contextElement = _parseDocument.body; | 1234 contextElement = _parseDocument.body; |
1235 } else { | 1235 } else { |
1236 contextElement = _parseDocument.$dom_createElement(tagName); | 1236 contextElement = _parseDocument.$dom_createElement(tagName); |
1237 _parseDocument.body.append(contextElement); | 1237 _parseDocument.body.append(contextElement); |
1238 } | 1238 } |
1239 var fragment; | 1239 var fragment; |
1240 if (Range.supportsCreateContextualFragment) { | 1240 if (Range.supportsCreateContextualFragment) { |
1241 var range = _parseDocument.$dom_createRange(); | 1241 var range = _parseDocument.createRange(); |
1242 range.selectNodeContents(contextElement); | 1242 range.selectNodeContents(contextElement); |
1243 fragment = range.createContextualFragment(html); | 1243 fragment = range.createContextualFragment(html); |
1244 } else { | 1244 } else { |
1245 contextElement._innerHtml = html; | 1245 contextElement._innerHtml = html; |
1246 | 1246 |
1247 fragment = _parseDocument.createDocumentFragment(); | 1247 fragment = _parseDocument.createDocumentFragment(); |
1248 while (contextElement.firstChild != null) { | 1248 while (contextElement.firstChild != null) { |
1249 fragment.append(contextElement.firstChild); | 1249 fragment.append(contextElement.firstChild); |
1250 } | 1250 } |
1251 } | 1251 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 const ScrollAlignment._internal(this._value); | 1333 const ScrollAlignment._internal(this._value); |
1334 toString() => 'ScrollAlignment.$_value'; | 1334 toString() => 'ScrollAlignment.$_value'; |
1335 | 1335 |
1336 /// Attempt to align the element to the top of the scrollable area. | 1336 /// Attempt to align the element to the top of the scrollable area. |
1337 static const TOP = const ScrollAlignment._internal('TOP'); | 1337 static const TOP = const ScrollAlignment._internal('TOP'); |
1338 /// Attempt to center the element in the scrollable area. | 1338 /// Attempt to center the element in the scrollable area. |
1339 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1339 static const CENTER = const ScrollAlignment._internal('CENTER'); |
1340 /// Attempt to align the element to the bottom of the scrollable area. | 1340 /// Attempt to align the element to the bottom of the scrollable area. |
1341 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1341 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
1342 } | 1342 } |
OLD | NEW |