| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 ]; |
| OLD | NEW |