mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
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
This commit is contained in:
parent
44d7657487
commit
77f52d2eab
5 changed files with 37 additions and 1 deletions
|
@ -369,7 +369,7 @@ impl VirtualMethods for HTMLImageElement {
|
||||||
&atom!("src") => {
|
&atom!("src") => {
|
||||||
self.update_image(mutation.new_value(attr).map(|value| {
|
self.update_image(mutation.new_value(attr).map(|value| {
|
||||||
// FIXME(ajeffrey): convert directly from AttrValue to DOMString
|
// FIXME(ajeffrey): convert directly from AttrValue to DOMString
|
||||||
(DOMString::from(&**value), window_from_node(self).get_url())
|
(DOMString::from(&**value), document_from_node(self).base_url())
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
_ => {},
|
_ => {},
|
||||||
|
|
|
@ -37329,6 +37329,18 @@
|
||||||
"url": "/html/semantics/embedded-content/the-iframe-element/iframe-with-base.html"
|
"url": "/html/semantics/embedded-content/the-iframe-element/iframe-with-base.html"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"html/semantics/embedded-content/the-img-element/document-base-url.html": [
|
||||||
|
{
|
||||||
|
"path": "html/semantics/embedded-content/the-img-element/document-base-url.html",
|
||||||
|
"references": [
|
||||||
|
[
|
||||||
|
"/html/semantics/embedded-content/the-img-element/document-base-url-ref.html",
|
||||||
|
"=="
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"url": "/html/semantics/embedded-content/the-img-element/document-base-url.html"
|
||||||
|
}
|
||||||
|
],
|
||||||
"html/semantics/embedded-content/the-video-element/video_content_image.htm": [
|
"html/semantics/embedded-content/the-video-element/video_content_image.htm": [
|
||||||
{
|
{
|
||||||
"path": "html/semantics/embedded-content/the-video-element/video_content_image.htm",
|
"path": "html/semantics/embedded-content/the-video-element/video_content_image.htm",
|
||||||
|
@ -40525,6 +40537,18 @@
|
||||||
],
|
],
|
||||||
"url": "/html/semantics/embedded-content/the-iframe-element/iframe-with-base.html"
|
"url": "/html/semantics/embedded-content/the-iframe-element/iframe-with-base.html"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"html/semantics/embedded-content/the-img-element/document-base-url.html": [
|
||||||
|
{
|
||||||
|
"path": "html/semantics/embedded-content/the-img-element/document-base-url.html",
|
||||||
|
"references": [
|
||||||
|
[
|
||||||
|
"/html/semantics/embedded-content/the-img-element/document-base-url-ref.html",
|
||||||
|
"=="
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"url": "/html/semantics/embedded-content/the-img-element/document-base-url.html"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Document base URL img test</title>
|
||||||
|
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-img-element" />
|
||||||
|
<img src="resources/cat.jpg" alt="cat">
|
|
@ -0,0 +1,7 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Document base URL img test</title>
|
||||||
|
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-img-element" />
|
||||||
|
<link rel="match" href="document-base-url-ref.html">
|
||||||
|
<base href="resources/" />
|
||||||
|
<img src="cat.jpg" alt="cat">
|
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Loading…
Add table
Add a link
Reference in a new issue