diff options
author | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2018-12-26 15:39:48 +0100 |
---|---|---|
committer | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2019-01-11 17:11:12 +0100 |
commit | 9d5499bbfbf23174c6c2a36f024c0e1be3155f27 (patch) | |
tree | 12e477a4d666bb1641c95e412dd686273e0d23b5 /components/script/dom/htmlvideoelement.rs | |
parent | 5c5b5aae0f80767f88e030ed3c9bc04aa473df6a (diff) | |
download | servo-9d5499bbfbf23174c6c2a36f024c0e1be3155f27.tar.gz servo-9d5499bbfbf23174c6c2a36f024c0e1be3155f27.zip |
Reftest for video poster frame
Diffstat (limited to 'components/script/dom/htmlvideoelement.rs')
-rw-r--r-- | components/script/dom/htmlvideoelement.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/script/dom/htmlvideoelement.rs b/components/script/dom/htmlvideoelement.rs index 57e2f61a7eb..69a58d7a081 100644 --- a/components/script/dom/htmlvideoelement.rs +++ b/components/script/dom/htmlvideoelement.rs @@ -6,6 +6,7 @@ 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; @@ -113,6 +114,11 @@ impl HTMLVideoElement { // Step 3. let poster_url = match ServoUrl::parse(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, }; @@ -219,6 +225,10 @@ impl HTMLVideoElementMethods for HTMLVideoElement { // https://html.spec.whatwg.org/multipage/#dom-video-poster make_setter!(SetPoster, "poster"); + + // For testing purposes only. This is not an event from + // https://html.spec.whatwg.org/multipage/#dom-video-poster + event_handler!(postershown, GetOnpostershown, SetOnpostershown); } impl VirtualMethods for HTMLVideoElement { |