mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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:
parent
0c8865b8e1
commit
ab79cc0e39
1 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue