| 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 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 } | 1321 } |
| 1322 treeSanitizer = _defaultSanitizer; | 1322 treeSanitizer = _defaultSanitizer; |
| 1323 } else if (validator != null) { | 1323 } else if (validator != null) { |
| 1324 throw new ArgumentError( | 1324 throw new ArgumentError( |
| 1325 'validator can only be passed if treeSanitizer is null'); | 1325 'validator can only be passed if treeSanitizer is null'); |
| 1326 } | 1326 } |
| 1327 | 1327 |
| 1328 if (_parseDocument == null) { | 1328 if (_parseDocument == null) { |
| 1329 _parseDocument = document.implementation.createHtmlDocument(''); | 1329 _parseDocument = document.implementation.createHtmlDocument(''); |
| 1330 _parseRange = _parseDocument.createRange(); | 1330 _parseRange = _parseDocument.createRange(); |
| 1331 |
| 1332 // Workaround for Safari bug. Was also previously Chrome bug 229142 |
| 1333 // - URIs are not resolved in new doc. |
| 1334 var base = _parseDocument.createElement('base'); |
| 1335 base.href = document.baseUri; |
| 1336 _parseDocument.head.append(base); |
| 1331 } | 1337 } |
| 1332 var contextElement; | 1338 var contextElement; |
| 1333 if (this is BodyElement) { | 1339 if (this is BodyElement) { |
| 1334 contextElement = _parseDocument.body; | 1340 contextElement = _parseDocument.body; |
| 1335 } else { | 1341 } else { |
| 1336 contextElement = _parseDocument.createElement(tagName); | 1342 contextElement = _parseDocument.createElement(tagName); |
| 1337 _parseDocument.body.append(contextElement); | 1343 _parseDocument.body.append(contextElement); |
| 1338 } | 1344 } |
| 1339 var fragment; | 1345 var fragment; |
| 1340 if (Range.supportsCreateContextualFragment && | 1346 if (Range.supportsCreateContextualFragment && |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1674 const ScrollAlignment._internal(this._value); | 1680 const ScrollAlignment._internal(this._value); |
| 1675 toString() => 'ScrollAlignment.$_value'; | 1681 toString() => 'ScrollAlignment.$_value'; |
| 1676 | 1682 |
| 1677 /// Attempt to align the element to the top of the scrollable area. | 1683 /// Attempt to align the element to the top of the scrollable area. |
| 1678 static const TOP = const ScrollAlignment._internal('TOP'); | 1684 static const TOP = const ScrollAlignment._internal('TOP'); |
| 1679 /// Attempt to center the element in the scrollable area. | 1685 /// Attempt to center the element in the scrollable area. |
| 1680 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1686 static const CENTER = const ScrollAlignment._internal('CENTER'); |
| 1681 /// Attempt to align the element to the bottom of the scrollable area. | 1687 /// Attempt to align the element to the bottom of the scrollable area. |
| 1682 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1688 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
| 1683 } | 1689 } |
| OLD | NEW |