diff --git a/components/script/dom/htmlvideoelement.rs b/components/script/dom/htmlvideoelement.rs index 69a58d7a081..266b5514ce2 100644 --- a/components/script/dom/htmlvideoelement.rs +++ b/components/script/dom/htmlvideoelement.rs @@ -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, }; diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs index 0a142205f02..aab7213a8f1 100644 --- a/components/script/dom/location.rs +++ b/components/script/dom/location.rs @@ -37,7 +37,7 @@ impl Location { ) } - pub fn get_url(&self) -> ServoUrl { + fn get_url(&self) -> ServoUrl { self.window.get_url() } diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 89f4eb55931..d9eb3fbccb1 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -32838,7 +32838,7 @@ "testharness" ], "mozilla/video_poster_frame.html": [ - "2f4af97720c40fbbde8d1cad660b1018d88367e5", + "8b321ef5d82e0de6e16625ecd41190abc00bacb6", "reftest" ], "mozilla/video_poster_frame_ref.html": [ diff --git a/tests/wpt/mozilla/tests/mozilla/video_poster_frame.html b/tests/wpt/mozilla/tests/mozilla/video_poster_frame.html index 2f4af97720c..8b321ef5d82 100644 --- a/tests/wpt/mozilla/tests/mozilla/video_poster_frame.html +++ b/tests/wpt/mozilla/tests/mozilla/video_poster_frame.html @@ -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"); });