style: Add a Show Password button to <input type=password> controls

It's controlled by the pref:
layout.forms.input-type-show-password-button.enabled

Differential Revision: https://phabricator.services.mozilla.com/D130407
This commit is contained in:
Emilio Cobos Álvarez 2023-06-06 13:04:11 +02:00 committed by Oriol Brufau
parent b08701529f
commit 09a0edefb8
3 changed files with 9 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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, _),

View file

@ -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 => {