mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implements the :checked pseudo-class for inputs
Relevant spec: https://html.spec.whatwg.org/multipage/scripting.html#selector-checked Also modifies HTMLInputElement::SetChecked to no longer modify its checked content value, instead making use of its internal checkedness state now that we can match `:checked` properly.
This commit is contained in:
parent
9ac817523c
commit
1b84bd22b8
7 changed files with 47 additions and 4 deletions
|
@ -997,6 +997,12 @@ pub fn matches_simple_selector<'a,E,N>(selector: &SimpleSelector,
|
|||
let elem = element.as_element();
|
||||
elem.get_enabled_state()
|
||||
},
|
||||
// https://html.spec.whatwg.org/multipage/scripting.html#selector-checked
|
||||
Checked => {
|
||||
*shareable = false;
|
||||
let elem = element.as_element();
|
||||
elem.get_checked_state()
|
||||
}
|
||||
FirstChild => {
|
||||
*shareable = false;
|
||||
matches_first_child(element)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue