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

Side by Side Diff: build.dart

Issue 14295009: Fix widget.dart to work with the latest web_ui library. Specifically, query selectors need to use "… (Closed) Base URL: https://github.com/kevmoo/widget.dart.git@master
Patch Set: ptal Created 7 years, 8 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
« no previous file with comments | « no previous file | changelog.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import 'dart:async'; 1 import 'dart:async';
2 import 'dart:io'; 2 import 'dart:io';
3 import 'package:html5lib/dom.dart'; 3 import 'package:html5lib/dom.dart';
4 import 'package:html5lib/parser.dart'; 4 import 'package:html5lib/parser.dart';
5 import 'package:html5lib/dom_parsing.dart'; 5 import 'package:html5lib/dom_parsing.dart';
6 import 'package:web_ui/component_build.dart' as build_utils; 6 import 'package:web_ui/component_build.dart' as build_utils;
7 import 'package:bot/bot.dart'; 7 import 'package:bot/bot.dart';
8 8
9 final _whitespaceRegex = new RegExp(r'\s+'); 9 final _whitespaceRegex = new RegExp(r'\s+');
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 Future<bool> _updateIfChanged(String filePath, String newContent) { 97 Future<bool> _updateIfChanged(String filePath, String newContent) {
98 final file = new File(filePath); 98 final file = new File(filePath);
99 return file.exists() 99 return file.exists()
100 .then((bool exists) { 100 .then((bool exists) {
101 if(exists) { 101 if(exists) {
102 return file.readAsString() 102 return file.readAsString()
103 .then((String content) => content != newContent); 103 .then((String content) => content != newContent);
104 } else { 104 } else {
105 return new Future.immediate(true); 105 return new Future.value(true);
106 } 106 }
107 }).then((bool shouldUpdate) { 107 }).then((bool shouldUpdate) {
108 if(shouldUpdate) { 108 if(shouldUpdate) {
109 return file.writeAsString(newContent) 109 return file.writeAsString(newContent)
110 .then((_) => true); 110 .then((_) => true);
111 } else { 111 } else {
112 return new Future.immediate(false); 112 return new Future.value(false);
113 } 113 }
114 }); 114 });
115 } 115 }
116 116
117 // TODO: crazy hack. Really need select recursive 117 // TODO: crazy hack. Really need select recursive
118 // or propery query support...whichever 118 // or propery query support...whichever
119 List<Element> _findElements(Element element, Func1<Element, bool> predicate, [Li st<Element> target]) { 119 List<Element> _findElements(Element element, Func1<Element, bool> predicate, [Li st<Element> target]) {
120 if(target == null) { 120 if(target == null) {
121 target = new List<Element>(); 121 target = new List<Element>();
122 } 122 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 }); 228 });
229 229
230 for(var i = 0; i < lines.length; i++) { 230 for(var i = 0; i < lines.length; i++) {
231 lines[i] = lines[i].substring(minPrefix); 231 lines[i] = lines[i].substring(minPrefix);
232 } 232 }
233 233
234 input = lines.join('\n'); 234 input = lines.join('\n');
235 235
236 return input; 236 return input;
237 } 237 }
OLDNEW
« no previous file with comments | « no previous file | changelog.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698