Issue 8719: Add basic support for :active selector

This commit is contained in:
Steve Melia 2016-06-17 22:59:05 +01:00
parent 80cb0cf821
commit 421c354d44
5 changed files with 63 additions and 2 deletions

View file

@ -2519,8 +2519,13 @@ impl Element {
self.state.get().contains(IN_ACTIVE_STATE)
}
/// https://html.spec.whatwg.org/multipage/#concept-selector-active
pub fn set_active_state(&self, value: bool) {
self.set_state(IN_ACTIVE_STATE, value)
self.set_state(IN_ACTIVE_STATE, value);
if let Some(parent) = self.upcast::<Node>().GetParentElement() {
parent.set_active_state(value);
}
}
pub fn focus_state(&self) -> bool {