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

Side by Side Diff: pkg/polymer/lib/src/build/import_inliner.dart

Issue 79513002: Fix resolution of packages in pub-build to allow '../../packages/foo/bar' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « pkg/polymer/lib/src/build/common.dart ('k') | pkg/polymer/test/build/import_inliner_test.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /** Transfomer that inlines polymer-element definitions from html imports. */ 5 /** Transfomer that inlines polymer-element definitions from html imports. */
6 library polymer.src.build.import_inliner; 6 library polymer.src.build.import_inliner;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:convert'; 9 import 'dart:convert';
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 } 204 }
205 205
206 if (id.path.startsWith('asset/')) { 206 if (id.path.startsWith('asset/')) {
207 return 'assets/${id.package}/${id.path.substring(6)}'; 207 return 'assets/${id.package}/${id.path.substring(6)}';
208 } 208 }
209 209
210 if (primaryId.package != id.package) { 210 if (primaryId.package != id.package) {
211 // Techincally we shouldn't get there 211 // Techincally we shouldn't get there
212 transform.logger.error("don't know how to include $id from $primaryId", 212 transform.logger.error("don't know how to include $id from $primaryId",
213 span: span); 213 span: span);
214 return null; 214 return href;
Siggi Cherem (dart-lang) 2013/11/20 22:44:19 this makes sure that we don't assign a null value
215 } 215 }
216 216
217 var builder = path.url; 217 var builder = path.url;
218 return builder.relative(builder.join('/', id.path), 218 return builder.relative(builder.join('/', id.path),
219 from: builder.join('/', builder.dirname(primaryId.path))); 219 from: builder.join('/', builder.dirname(primaryId.path)));
220 } 220 }
221 } 221 }
222 222
223 /** 223 /**
224 * HTML attributes that expect a URL value. 224 * HTML attributes that expect a URL value.
225 * <http://dev.w3.org/html5/spec/section-index.html#attributes-1> 225 * <http://dev.w3.org/html5/spec/section-index.html#attributes-1>
226 * 226 *
227 * Every one of these attributes is a URL in every context where it is used in 227 * Every one of these attributes is a URL in every context where it is used in
228 * the DOM. The comments show every DOM element where an attribute can be used. 228 * the DOM. The comments show every DOM element where an attribute can be used.
229 */ 229 */
230 const _urlAttributes = const [ 230 const _urlAttributes = const [
231 'action', // in form 231 'action', // in form
232 'background', // in body 232 'background', // in body
233 'cite', // in blockquote, del, ins, q 233 'cite', // in blockquote, del, ins, q
234 'data', // in object 234 'data', // in object
235 'formaction', // in button, input 235 'formaction', // in button, input
236 'href', // in a, area, link, base, command 236 'href', // in a, area, link, base, command
237 'icon', // in command 237 'icon', // in command
238 'manifest', // in html 238 'manifest', // in html
239 'poster', // in video 239 'poster', // in video
240 'src', // in audio, embed, iframe, img, input, script, source, track, 240 'src', // in audio, embed, iframe, img, input, script, source, track,
241 // video 241 // video
242 ]; 242 ];
OLDNEW
« no previous file with comments | « pkg/polymer/lib/src/build/common.dart ('k') | pkg/polymer/test/build/import_inliner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698