mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:47:35 +00:00
LibWeb: Implement appearance
CSS property
This includes the "compat" values even though they are not strictly necessary.
This commit is contained in:
parent
b5febe538c
commit
d7d34d88e5
7 changed files with 78 additions and 0 deletions
|
@ -316,6 +316,36 @@ Optional<CSS::AlignSelf> StyleProperties::align_self() const
|
|||
return value_id_to_align_self(value->to_identifier());
|
||||
}
|
||||
|
||||
Optional<CSS::Appearance> StyleProperties::appearance() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::Appearance);
|
||||
auto appearance = value_id_to_appearance(value->to_identifier());
|
||||
if (appearance.has_value()) {
|
||||
switch (*appearance) {
|
||||
// Note: All these compatibility values can be treated as 'auto'
|
||||
case CSS::Appearance::Textfield:
|
||||
case CSS::Appearance::MenulistButton:
|
||||
case CSS::Appearance::Searchfield:
|
||||
case CSS::Appearance::Textarea:
|
||||
case CSS::Appearance::PushButton:
|
||||
case CSS::Appearance::SliderHorizontal:
|
||||
case CSS::Appearance::Checkbox:
|
||||
case CSS::Appearance::Radio:
|
||||
case CSS::Appearance::SquareButton:
|
||||
case CSS::Appearance::Menulist:
|
||||
case CSS::Appearance::Listbox:
|
||||
case CSS::Appearance::Meter:
|
||||
case CSS::Appearance::ProgressBar:
|
||||
case CSS::Appearance::Button:
|
||||
appearance = CSS::Appearance::Auto;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return appearance;
|
||||
}
|
||||
|
||||
Optional<CSS::Position> StyleProperties::position() const
|
||||
{
|
||||
auto value = property(CSS::PropertyID::Position);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue