style: Remove non-standard and unused system font values

And hide internal but used values. System fonts are not exposed in the
computed style so this should be fine.

If we need the old values for some obscure reason, it's trivial to alias
them to e.g., menu or so.

Differential Revision: https://phabricator.services.mozilla.com/D163269
This commit is contained in:
Emilio Cobos Álvarez 2022-12-01 09:23:19 +00:00 committed by Martin Robinson
parent bf593a81ed
commit 11313368ac
2 changed files with 16 additions and 8 deletions

View file

@ -71,7 +71,7 @@
let mut stretch = None; let mut stretch = None;
let size; let size;
% if engine == "gecko": % if engine == "gecko":
if let Ok(sys) = input.try_parse(SystemFont::parse) { if let Ok(sys) = input.try_parse(|i| SystemFont::parse(context, i)) {
return Ok(expanded! { return Ok(expanded! {
% for name in SYSTEM_FONT_LONGHANDS: % for name in SYSTEM_FONT_LONGHANDS:
${name}: ${name}::SpecifiedValue::system_font(sys), ${name}: ${name}::SpecifiedValue::system_font(sys),

View file

@ -72,21 +72,29 @@ macro_rules! system_font_methods {
#[allow(missing_docs)] #[allow(missing_docs)]
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
pub enum SystemFont { pub enum SystemFont {
/// https://drafts.csswg.org/css-fonts/#valdef-font-caption
Caption, Caption,
/// https://drafts.csswg.org/css-fonts/#valdef-font-icon
Icon, Icon,
/// https://drafts.csswg.org/css-fonts/#valdef-font-menu
Menu, Menu,
/// https://drafts.csswg.org/css-fonts/#valdef-font-message-box
MessageBox, MessageBox,
/// https://drafts.csswg.org/css-fonts/#valdef-font-small-caption
SmallCaption, SmallCaption,
/// https://drafts.csswg.org/css-fonts/#valdef-font-status-bar
StatusBar, StatusBar,
MozWindow, /// Internal system font, used by the `<menupopup>`s on macOS.
MozDocument, #[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
MozWorkspace,
MozDesktop,
MozInfo,
MozDialog,
MozButton,
MozPullDownMenu, MozPullDownMenu,
/// Internal system font, used for `<button>` elements.
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
MozButton,
/// Internal font, used by `<select>` elements.
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
MozList, MozList,
/// Internal font, used by `<input>` elements.
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
MozField, MozField,
#[css(skip)] #[css(skip)]
End, // Just for indexing purposes. End, // Just for indexing purposes.