aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/selector_matching.rs
diff options
context:
space:
mode:
authorMatthew Rasmus <mattr@zzntd.com>2014-12-08 11:29:42 -0800
committerMatthew Rasmus <mattr@zzntd.com>2014-12-16 11:34:04 -0800
commit504f968b20b35f901f2f6af564023b2bc8aa998d (patch)
tree9a61ebc16b7d132fc61a6552d4bcb14c53a5ef68 /components/style/selector_matching.rs
parent2d05ac537cbd33c413da3516544023391d03ee82 (diff)
downloadservo-504f968b20b35f901f2f6af564023b2bc8aa998d.tar.gz
servo-504f968b20b35f901f2f6af564023b2bc8aa998d.zip
Implements :indeterminate pseudo-class
Addresses reviews
Diffstat (limited to 'components/style/selector_matching.rs')
-rw-r--r--components/style/selector_matching.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/components/style/selector_matching.rs b/components/style/selector_matching.rs
index 5482745721f..091d6204886 100644
--- a/components/style/selector_matching.rs
+++ b/components/style/selector_matching.rs
@@ -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)