mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Parse poster url relative to the node's document
This commit is contained in:
parent
1033d6bc07
commit
4e286ffa96
4 changed files with 4 additions and 10 deletions
|
@ -6,7 +6,6 @@ use crate::dom::attr::Attr;
|
|||
use crate::dom::bindings::cell::DomRefCell;
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLVideoElementBinding;
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLVideoElementBinding::HTMLVideoElementMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowBinding::WindowMethods;
|
||||
use crate::dom::bindings::inheritance::Castable;
|
||||
use crate::dom::bindings::refcounted::Trusted;
|
||||
use crate::dom::bindings::reflector::DomObject;
|
||||
|
@ -112,13 +111,8 @@ impl HTMLVideoElement {
|
|||
}
|
||||
|
||||
// Step 3.
|
||||
let poster_url = match ServoUrl::parse(poster_url) {
|
||||
let poster_url = match document_from_node(self).url().join(&poster_url) {
|
||||
Ok(url) => url,
|
||||
Err(url::ParseError::RelativeUrlWithoutBase) => {
|
||||
let window = window_from_node(self);
|
||||
let url = window.Location().get_url();
|
||||
url.join(&poster_url).unwrap()
|
||||
},
|
||||
Err(_) => return,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue