diff --git a/components/style/element_state.rs b/components/style/element_state.rs index 930c459b830..30c65dc9feb 100644 --- a/components/style/element_state.rs +++ b/components/style/element_state.rs @@ -125,6 +125,11 @@ bitflags! { const IN_DEVTOOLS_HIGHLIGHTED_STATE = 1 << 45; /// Used for the devtools style editor. Probably should go away. const IN_STYLEEDITOR_TRANSITIONING_STATE = 1 << 46; + /// For :-moz-value-empty (to show widgets like the reveal password + /// button or the clear button). + const IN_VALUE_EMPTY_STATE = 1 << 47; + /// For :-moz-revealed. + const IN_REVEALED_STATE = 1 << 48; } } diff --git a/components/style/gecko/non_ts_pseudo_class_list.rs b/components/style/gecko/non_ts_pseudo_class_list.rs index c92f7ae8db2..feb28feb0df 100644 --- a/components/style/gecko/non_ts_pseudo_class_list.rs +++ b/components/style/gecko/non_ts_pseudo_class_list.rs @@ -63,6 +63,8 @@ macro_rules! apply_non_ts_list { ("-moz-dir-attr-like-auto", MozDirAttrLikeAuto, IN_HAS_DIR_ATTR_LIKE_AUTO_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), ("-moz-autofill-preview", MozAutofillPreview, IN_AUTOFILL_PREVIEW_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME), + ("-moz-value-empty", MozValueEmpty, IN_VALUE_EMPTY_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), + ("-moz-revealed", MozRevealed, IN_REVEALED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), ("-moz-math-increment-script-level", MozMathIncrementScriptLevel, IN_INCREMENT_SCRIPT_LEVEL_STATE, _), diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 27f3eefe62e..4350135a4f2 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -1975,6 +1975,8 @@ impl<'le> ::selectors::Element for GeckoElement<'le> { NonTSPseudoClass::Active | NonTSPseudoClass::Hover | NonTSPseudoClass::MozAutofillPreview | + NonTSPseudoClass::MozRevealed | + NonTSPseudoClass::MozValueEmpty | NonTSPseudoClass::Dir(..) => self.state().intersects(pseudo_class.state_flag()), NonTSPseudoClass::AnyLink => self.is_link(), NonTSPseudoClass::Link => {