New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dartium and "build.dart" differ in behavior for paths in img tag #15013
Comments
Changed the title to: "Dartium and "build.dart" differ in behavior for paths in img tag". |
--deploy is doing the rightish thing. Native HTML Imports aren't behaving correctly with URL resolution. I think Polymer is always using polyfills at the moment. I had to workaround this when porting the new TodoMVC from Polymer (https://codereview.chromium.org/60353013/). Here's the Blink bug for this feature: https://code.google.com/p/chromium/issues/detail?id=240592 I don't think we can workaround this in HTML Imports Polyfill anymore (now that webkitStartDart is gone), so I think we just have to wait for a fix on the C++ side. I did workaround it in my app so feel free to use that (somewhat ugly) technique. Removed Area-Polymer, Library-PolymerBuild labels. |
I'm surprised that there is any URL rewriting. Why is the URL rewritten? That is, why is the --deploy "smarter" here? |
|
aha, I think I know why you're surprised. This used to work, because Dartium and Polymer.js both used HTML Imports Polyfill for development, and build.dart/Vulcanizer for deployment. But we changed to native HTML Imports recently. Polymer-js is not using it yet. That's why we hit bugs like https://code.google.com/p/dart/issues/detail?id=12434#c21, but they haven't hit them yet. Was it premature to switch to native? Perhaps. I certainly didn't expect so many issues :|. We could go back to adding this to your HTML page: <script src="packages/html_imports/html_imports.js"> ... but we'd need to flip the experimental flag for HTML Imports back to OFF. Because if native is turned on, it will finish before the Polyfill has a chance. Anyway I'd suggest some people (perhaps sigmund@ vsm@) follow up with morrita@ and figure out what is best for Dartium given the Blink implementation timeline. cc @sigmundch. |
I'm afraid that switching back might not be that easy. Part of the problem here is how we load and bootstrap the code in Dartium. Without native support, we would have to require that our users write extra import statements, or go back to do something like we did with 'boot.js'. The latter is especially hard now that webkitStartDart is gone. Another alternative would be to keep using the native implementation, but do some url-fixes in our loader code to compensate for that bug in blink. |
Thanks, I didn't realize that pub build inlines. If so, makes sense it's changing paths. |
Thank you for following up! The difference in behavior is certainly confusing. And yes, I used to have to do this: a href="../#foo" But now I have to do this: a href="#foo" So something certainly changed. I have no problem including any number of extra files to get consistent behavior. I assume a building script will take care of concatenating/minifying/etc Thanks guys! And for the record, if we know of the blink bug we can drop a link there. |
Siggi: is there something we need to do here in Dartium? Set owner to @sigmundch. |
No that I know of. This seems like a blink bug, but I haven't found a bug item for them that I can link here, so we might have to file one for them. |
I filed a bug for blink here with a small repro example: |
Thanks! Starred. |
This comment was originally written by fayb...@gmail.com This could be a temp solution, as long as when you run in production your image is in the folder img in the root directory. Attachment: |
Removed the owner. |
Removed this from the 1.6 milestone. |
Removed Oldschool-Milestone-1.6 label. |
Accessing app from example.com/index.html
I have this:
web/elements/foo.html:
<p>
<img src="imgs/WordHerderOnHorse.png" width="150">
</p>
The image lives in:
web/imgs/WordHerderOnHorse.png
In Dartium, this works, because Dartium is treating imgs/WordHerderOnHorse.png as example.com/imgs/WordHerderOnHorse.png
However, when I run it through build.dart --deploy, it's rewriting that link to elements/imgs/... which does not exist.
So, who's right?
The text was updated successfully, but these errors were encountered: