mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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 -->
This commit is contained in:
commit
f2f6787189
9 changed files with 95 additions and 66 deletions
|
@ -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 => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue