diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-03-11 10:06:24 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-03-11 10:06:24 +0530 |
commit | f2f6787189d8ea021cbd4ea3425d39ef8b1b8f93 (patch) | |
tree | 96fbea7db41f4da5bd1c197083f76095c487566e /components/script/dom/document.rs | |
parent | 20992c9df9463b9d5426b1eb4b00381fd2cf35c5 (diff) | |
parent | d6678a184b1f53085c2b2808c32d3d424bb777b9 (diff) | |
download | servo-f2f6787189d8ea021cbd4ea3425d39ef8b1b8f93.tar.gz servo-f2f6787189d8ea021cbd4ea3425d39ef8b1b8f93.zip |
Auto merge of #9930 - rebstar6:htmlclick, r=jdm
Remove activatable element filter within HTMLElement#click()
Address https://github.com/servo/servo/issues/6542
Ensure that click() calls are not limited to activatable elements. Also makes the isTrusted attribute false when synthetic click activation are called from a click() method (as per spec).
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9930)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index e0f4c0c5592..db565414ce1 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -4,6 +4,7 @@ use devtools_traits::CSSError; use document_loader::{DocumentLoader, LoadType}; +use dom::activation::{ActivationSource, synthetic_click_activation}; use dom::attr::{Attr, AttrValue}; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::DOMRectBinding::DOMRectMethods; @@ -1083,9 +1084,12 @@ impl Document { Key::Space if !prevented && state == KeyState::Released => { let maybe_elem = target.downcast::<Element>(); if let Some(el) = maybe_elem { - if let Some(a) = el.as_maybe_activatable() { - a.synthetic_click_activation(ctrl, alt, shift, meta); - } + synthetic_click_activation(el, + false, + false, + false, + false, + ActivationSource::NotFromClick) } } Key::Enter if !prevented && state == KeyState::Released => { |