style: Implement the ::file-chooser-button pseudo-element.

As per https://github.com/w3c/csswg-drafts/issues/5049.

Don't enable it unconditionally just yet, as the name may change.

I had to move some rules in forms.css because otherwise you get
specificity conflicts.

Differential Revision: https://phabricator.services.mozilla.com/D76214
This commit is contained in:
Emilio Cobos Álvarez 2020-05-25 23:54:10 +00:00
parent 0c8865b8e1
commit ab79cc0e39

View file

@ -37,7 +37,8 @@ impl ::selectors::parser::PseudoElement for PseudoElement {
PseudoElement::Before |
PseudoElement::After |
PseudoElement::Marker |
PseudoElement::Placeholder
PseudoElement::Placeholder |
PseudoElement::FileChooserButton
)
}
@ -159,12 +160,12 @@ impl PseudoElement {
/// Whether this pseudo-element is enabled for all content.
pub fn enabled_in_content(&self) -> bool {
if (self.flags() & structs::CSS_PSEUDO_ELEMENT_ENABLED_IN_UA_SHEETS_AND_CHROME) != 0 {
return false;
}
match *self {
PseudoElement::MozFocusOuter => static_prefs::pref!("layout.css.moz-focus-outer.enabled"),
_ => true,
PseudoElement::FileChooserButton => static_prefs::pref!("layout.css.file-chooser-button.enabled"),
_ => {
(self.flags() & structs::CSS_PSEUDO_ELEMENT_ENABLED_IN_UA_SHEETS_AND_CHROME) == 0
}
}
}