Parse poster url relative to the node's document

This commit is contained in:
Fernando Jiménez Moreno 2019-01-11 16:08:42 +01:00
parent 1033d6bc07
commit 4e286ffa96
4 changed files with 4 additions and 10 deletions

View file

@ -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,
};