Specific instances of activatable elements may not be activatable (fixes #4765

This commit is contained in:
Manish Goregaokar 2015-01-30 20:34:23 +05:30
parent a7e29939a1
commit 26732403b9
3 changed files with 20 additions and 1 deletions

View file

@ -1449,7 +1449,11 @@ impl<'a> ActivationElementHelpers<'a> for JSRef<'a, Element> {
match node.type_id() {
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLInputElement)) => {
let element: &'a JSRef<'a, HTMLInputElement> = HTMLInputElementCast::to_borrowed_ref(self).unwrap();
Some(element as &'a (Activatable + 'a))
if element.is_instance_activatable() {
Some(element as &'a (Activatable + 'a))
} else {
None
}
},
_ => {
None