Skip to content
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

Use the document base url when resolving image URLs #10574

Closed
jdm opened this issue Apr 13, 2016 · 3 comments
Closed

Use the document base url when resolving image URLs #10574

jdm opened this issue Apr 13, 2016 · 3 comments
Labels
A-content/dom Interacting with the DOM from web content C-assigned There is someone working on resolving the issue E-less-complex Straightforward. Recommended for a new contributor.

Comments

@jdm
Copy link
Member

jdm commented Apr 13, 2016

According to the specification (step 5.1), we need to be using the base URL. This means calling document.base_url() instead of window.get_url() as the code currently does.

Code: components/script/dom/htmlimageelement.rs
Test:

<base href="resources/"></base>
<img src="image.png">

Visit this from a web server (eg. python -m SimpleHTTPServer) with a resources/ directory that contains an image.png file.

There does not appear to be an automated test for this yet, so we'll need to write a reference test! It belongs in tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/.

@jdm jdm added A-content/dom Interacting with the DOM from web content E-less-complex Straightforward. Recommended for a new contributor. labels Apr 13, 2016
@amarant
Copy link
Contributor

amarant commented Apr 13, 2016

Can I try this one ?

@jdm
Copy link
Member Author

jdm commented Apr 13, 2016

Please do!

@jdm jdm added the C-assigned There is someone working on resolving the issue label Apr 13, 2016
amarant added a commit to amarant/servo that referenced this issue Apr 15, 2016
add a test with base path set to the resources path and an img with a cat and the reference directly to the image
bors-servo pushed a commit that referenced this issue Apr 19, 2016
Issue #10574 Use the document base url in img

add a test with base path set to the resources path and an img with a cat and the reference directly to the image

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10634)
<!-- Reviewable:end -->
@timvandermeij
Copy link
Contributor

Fixed by #10634?

@jdm jdm closed this as completed Apr 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/dom Interacting with the DOM from web content C-assigned There is someone working on resolving the issue E-less-complex Straightforward. Recommended for a new contributor.
Projects
None yet
Development

No branches or pull requests

3 participants