LibWeb: Hide stepper buttons on appearance: textfield number inputs

The spec says:

> For the purpose of this specification, they all have the same effect
  as auto. However, the host language may also take these values into
  account when defining the native appearance of the element.

https://drafts.csswg.org/css-ui/#typedef-appearance-compat-special

Firefox at least hides the stepper buttons when this is set.
This commit is contained in:
Sam Atkins 2025-11-14 14:25:37 +00:00
parent c3d23a2487
commit d5d1b5351e
Notes: github-actions[bot] 2025-12-01 11:11:27 +00:00
5 changed files with 163 additions and 23 deletions

View file

@ -833,8 +833,6 @@ Appearance ComputedProperties::appearance() const
auto appearance = keyword_to_appearance(value.to_keyword()).release_value();
switch (appearance) {
// Note: All these compatibility values can be treated as 'auto'
case Appearance::Textfield:
case Appearance::MenulistButton:
case Appearance::Searchfield:
case Appearance::Textarea:
case Appearance::PushButton:
@ -849,6 +847,10 @@ Appearance ComputedProperties::appearance() const
case Appearance::Button:
appearance = Appearance::Auto;
break;
// NB: <compat-special> values behave like auto but can also have an effect. Preserve them.
case Appearance::Textfield:
case Appearance::MenulistButton:
break;
default:
break;
}