mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Issue 8719: Add basic support for :active selector
This commit is contained in:
parent
80cb0cf821
commit
421c354d44
5 changed files with 63 additions and 2 deletions
|
@ -735,9 +735,22 @@ impl Document {
|
|||
// https://w3c.github.io/uievents/#trusted-events
|
||||
event.set_trusted(true);
|
||||
// https://html.spec.whatwg.org/multipage/#run-authentic-click-activation-steps
|
||||
let activatable = el.as_maybe_activatable();
|
||||
match mouse_event_type {
|
||||
MouseEventType::Click => el.authentic_click_activation(event),
|
||||
_ => {
|
||||
MouseEventType::MouseDown => {
|
||||
if let Some(a) = activatable {
|
||||
a.enter_formal_activation_state();
|
||||
}
|
||||
|
||||
let target = node.upcast();
|
||||
event.fire(target);
|
||||
},
|
||||
MouseEventType::MouseUp => {
|
||||
if let Some(a) = activatable {
|
||||
a.exit_formal_activation_state();
|
||||
}
|
||||
|
||||
let target = node.upcast();
|
||||
event.fire(target);
|
||||
},
|
||||
|
@ -904,6 +917,7 @@ impl Document {
|
|||
.inclusive_ancestors()
|
||||
.filter_map(Root::downcast::<Element>) {
|
||||
element.set_hover_state(false);
|
||||
element.set_active_state(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue