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

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

Issue 148913003: Improve how we handle packages/ HTML imports. This resolves better any valid (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 | « pkg/polymer/lib/src/build/common.dart ('k') | pkg/polymer/lib/src/loader.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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 _newUrl(String href, Span span) { 176 _newUrl(String href, Span span) {
177 var uri = Uri.parse(href); 177 var uri = Uri.parse(href);
178 if (uri.isAbsolute) return href; 178 if (uri.isAbsolute) return href;
179 if (!uri.scheme.isEmpty) return href; 179 if (!uri.scheme.isEmpty) return href;
180 if (!uri.host.isEmpty) return href; 180 if (!uri.host.isEmpty) return href;
181 if (uri.path.isEmpty) return href; // Implies standalone ? or # in URI. 181 if (uri.path.isEmpty) return href; // Implies standalone ? or # in URI.
182 if (path.isAbsolute(href)) return href; 182 if (path.isAbsolute(href)) return href;
183 183
184 var id = resolve(sourceId, href, transform.logger, span); 184 var id = resolve(sourceId, href, transform.logger, span);
185 if (id == null) return href;
185 var primaryId = transform.primaryInput.id; 186 var primaryId = transform.primaryInput.id;
186 187
187 if (id.path.startsWith('lib/')) { 188 if (id.path.startsWith('lib/')) {
188 return 'packages/${id.package}/${id.path.substring(4)}'; 189 return 'packages/${id.package}/${id.path.substring(4)}';
189 } 190 }
190 191
191 if (id.path.startsWith('asset/')) { 192 if (id.path.startsWith('asset/')) {
192 return 'assets/${id.package}/${id.path.substring(6)}'; 193 return 'assets/${id.package}/${id.path.substring(6)}';
193 } 194 }
194 195
(...skipping 23 matching lines...) Expand all
218 'cite', // in blockquote, del, ins, q 219 'cite', // in blockquote, del, ins, q
219 'data', // in object 220 'data', // in object
220 'formaction', // in button, input 221 'formaction', // in button, input
221 'href', // in a, area, link, base, command 222 'href', // in a, area, link, base, command
222 'icon', // in command 223 'icon', // in command
223 'manifest', // in html 224 'manifest', // in html
224 'poster', // in video 225 'poster', // in video
225 'src', // in audio, embed, iframe, img, input, script, source, track, 226 'src', // in audio, embed, iframe, img, input, script, source, track,
226 // video 227 // video
227 ]; 228 ];
OLDNEW
« no previous file with comments | « pkg/polymer/lib/src/build/common.dart ('k') | pkg/polymer/lib/src/loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698