Implements :indeterminate pseudo-class

Addresses reviews
This commit is contained in:
Matthew Rasmus 2014-12-08 11:29:42 -08:00
parent 2d05ac537c
commit 504f968b20
14 changed files with 105 additions and 206 deletions

View file

@ -23,7 +23,7 @@ use properties::{PropertyDeclaration, PropertyDeclarationBlock};
use selectors::{After, AnyLink, AttrDashMatch, AttrEqual};
use selectors::{AttrExists, AttrIncludes, AttrPrefixMatch};
use selectors::{AttrSubstringMatch, AttrSuffixMatch, Before, CaseInsensitive, CaseSensitive};
use selectors::{Checked, Child, ClassSelector};
use selectors::{Checked, Child, ClassSelector, Indeterminate};
use selectors::{CompoundSelector, Descendant, Disabled, Enabled, FirstChild, FirstOfType};
use selectors::{Hover, IDSelector, LastChild, LastOfType};
use selectors::{LaterSibling, LocalName, LocalNameSelector};
@ -972,6 +972,12 @@ pub fn matches_simple_selector<'a,E,N>(selector: &SimpleSelector,
let elem = element.as_element();
elem.get_checked_state()
}
// https://html.spec.whatwg.org/multipage/scripting.html#selector-indeterminate
Indeterminate => {
*shareable = false;
let elem = element.as_element();
elem.get_indeterminate_state()
}
FirstChild => {
*shareable = false;
matches_first_child(element)