Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Side by Side Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 23534024: createRange.... (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/dom/src/AttributeMap.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tools/dom/src/AttributeMap.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698