Call synthetic_click_activation for all clicks

Moved synthetic_click_actiavtion out of Activatable trait so it can be
called by all elements (not just activatable). Calls appropriately
from click. Also updates the isdisabled check in click to check for all
types of elements
This commit is contained in:
Rebecca 2016-02-22 20:54:45 -05:00
parent 57a96ece0c
commit d6678a184b
9 changed files with 95 additions and 66 deletions

View file

@ -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;
@ -1077,9 +1078,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 => {