Skip to content

Commit

Permalink
Parse poster url relative to the node's document
Browse files Browse the repository at this point in the history
  • Loading branch information
ferjm committed Jan 14, 2019
1 parent 1033d6b commit 4e286ff
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
8 changes: 1 addition & 7 deletions components/script/dom/htmlvideoelement.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
};

Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/location.rs
Expand Up @@ -37,7 +37,7 @@ impl Location {
)
}

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

Expand Down
2 changes: 1 addition & 1 deletion tests/wpt/mozilla/meta/MANIFEST.json
Expand Up @@ -32838,7 +32838,7 @@
"testharness"
],
"mozilla/video_poster_frame.html": [
"2f4af97720c40fbbde8d1cad660b1018d88367e5",
"8b321ef5d82e0de6e16625ecd41190abc00bacb6",
"reftest"
],
"mozilla/video_poster_frame_ref.html": [
Expand Down
2 changes: 1 addition & 1 deletion tests/wpt/mozilla/tests/mozilla/video_poster_frame.html
Expand Up @@ -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");
});
Expand Down

0 comments on commit 4e286ff

Please sign in to comment.