aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/virtualmethods.rs
diff options
context:
space:
mode:
authorFernando Jiménez Moreno <ferjmoreno@gmail.com>2018-11-29 17:37:34 +0100
committerFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-01-11 17:11:11 +0100
commit5c5b5aae0f80767f88e030ed3c9bc04aa473df6a (patch)
tree0a5996ed64c0283fd86f5a3c85c5100424b65161 /components/script/dom/virtualmethods.rs
parentb49e7517a37f31c6b867093bc1a20469f55da24b (diff)
downloadservo-5c5b5aae0f80767f88e030ed3c9bc04aa473df6a.tar.gz
servo-5c5b5aae0f80767f88e030ed3c9bc04aa473df6a.zip
Implement HTMLMediaElement poster attribute
Diffstat (limited to 'components/script/dom/virtualmethods.rs')
-rw-r--r--components/script/dom/virtualmethods.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/components/script/dom/virtualmethods.rs b/components/script/dom/virtualmethods.rs
index 559cf63b8ea..7a41642a201 100644
--- a/components/script/dom/virtualmethods.rs
+++ b/components/script/dom/virtualmethods.rs
@@ -6,6 +6,7 @@ use crate::dom::attr::Attr;
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::inheritance::ElementTypeId;
use crate::dom::bindings::inheritance::HTMLElementTypeId;
+use crate::dom::bindings::inheritance::HTMLMediaElementTypeId;
use crate::dom::bindings::inheritance::NodeTypeId;
use crate::dom::bindings::inheritance::SVGElementTypeId;
use crate::dom::bindings::inheritance::SVGGraphicsElementTypeId;
@@ -49,6 +50,7 @@ use crate::dom::htmltablesectionelement::HTMLTableSectionElement;
use crate::dom::htmltemplateelement::HTMLTemplateElement;
use crate::dom::htmltextareaelement::HTMLTextAreaElement;
use crate::dom::htmltitleelement::HTMLTitleElement;
+use crate::dom::htmlvideoelement::HTMLVideoElement;
use crate::dom::node::{ChildrenMutation, CloneChildrenFlag, Node, UnbindContext};
use crate::dom::svgsvgelement::SVGSVGElement;
use html5ever::LocalName;
@@ -208,8 +210,13 @@ pub fn vtable_for(node: &Node) -> &dyn VirtualMethods {
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLLinkElement)) => {
node.downcast::<HTMLLinkElement>().unwrap() as &dyn VirtualMethods
},
- NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLMediaElement(_))) => {
- node.downcast::<HTMLMediaElement>().unwrap() as &dyn VirtualMethods
+ NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLMediaElement(
+ media_el,
+ ))) => match media_el {
+ HTMLMediaElementTypeId::HTMLVideoElement => {
+ node.downcast::<HTMLVideoElement>().unwrap() as &dyn VirtualMethods
+ },
+ _ => node.downcast::<HTMLMediaElement>().unwrap() as &dyn VirtualMethods,
},
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLMetaElement)) => {
node.downcast::<HTMLMetaElement>().unwrap() as &dyn VirtualMethods