Chromium Code Reviews| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 ]; |
| OLD | NEW |