Permalink
Browse files

Parse poster url relative to the node's document

  • Loading branch information...
ferjm committed Jan 11, 2019
1 parent 1033d6b commit 8a8ee77000527fd9c9e7e4dd3f9ef1be2bf4d1d2
@@ -112,13 +112,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,
};

@@ -37,7 +37,7 @@ impl Location {
)
}

pub fn get_url(&self) -> ServoUrl {
fn get_url(&self) -> ServoUrl {
self.window.get_url()
}

@@ -13,7 +13,7 @@
// Apart from removing the `reftest-wait` class we need to get
// the `load` event to signal that it's ok to take the reftest
// screenshot. Video loading delays the document `load` event,
// so we garantee that we get this event by setting an invaid
// so we garantee that we get this event by setting an invalid
// src attribute to the video tag.
document.documentElement.classList.remove("reftest-wait");
});

0 comments on commit 8a8ee77

Please sign in to comment.