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

Side by Side Diff: lib/templating.dart

Issue 11416379: Fixes for the upcoming sdk changes (bleeding_edge 16052) (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: Created 8 years 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
« no previous file with comments | « lib/src/emitters.dart ('k') | lib/web_ui.dart » ('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 /** Common utility functions used by code generated by the dwc compiler. */ 5 /** Common utility functions used by code generated by the dwc compiler. */
6 library templating; 6 library templating;
7 7
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:uri'; 9 import 'dart:uri';
10 import 'package:web_ui/safe_html.dart'; 10 import 'package:web_ui/safe_html.dart';
11 import 'package:web_ui/watcher.dart'; 11 import 'package:web_ui/watcher.dart';
12 12
13 /** 13 /**
14 * Removes all sibling nodes from `start.nextNode` until [end] (inclusive). For 14 * Removes all sibling nodes from `start.nextNode` until [end] (inclusive). For
15 * convinience, this function returns [start]. 15 * convinience, this function returns [start].
16 */ 16 */
17 Node removeNodes(Node start, Node end) { 17 Node removeNodes(Node start, Node end) {
18 var parent = end != null ? end.parent : null; 18 var parent = end != null ? end.parentNode : null;
19 if (parent == null) return start; 19 if (parent == null) return start;
20 20
21 while (start != end) { 21 while (start != end) {
22 var prev = end.previousNode; 22 var prev = end.previousNode;
23 // TODO(sigmund): use `end.remove()` after dartbug.com/7173 is fixed 23 // TODO(sigmund): use `end.remove()` after dartbug.com/7173 is fixed
24 parent.$dom_removeChild(end); 24 parent.$dom_removeChild(end);
25 end = prev; 25 end = prev;
26 } 26 }
27 return start; 27 return start;
28 } 28 }
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 return _SAFE_SCHEMES.contains(scheme.toLowerCase()) || 213 return _SAFE_SCHEMES.contains(scheme.toLowerCase()) ||
214 "MAILTO" == scheme.toUpperCase(); 214 "MAILTO" == scheme.toUpperCase();
215 } 215 }
216 216
217 /** An error thrown when data bindings are set up with incorrect data. */ 217 /** An error thrown when data bindings are set up with incorrect data. */
218 class DataBindingError implements Error { 218 class DataBindingError implements Error {
219 final message; 219 final message;
220 DataBindingError(this.message); 220 DataBindingError(this.message);
221 toString() => "Data binding error: $message"; 221 toString() => "Data binding error: $message";
222 } 222 }
OLDNEW
« no previous file with comments | « lib/src/emitters.dart ('k') | lib/web_ui.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698