mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
LibWeb: Make things aware of box-sizing
Of course, we don't actually *use* the box-sizing property yet, but the value is applied and shows up in the computed style.
This commit is contained in:
parent
3c192f492a
commit
fc7af21c7c
Notes:
sideshowbarker
2024-07-18 03:01:37 +09:00
Author: https://github.com/AtkinsSJ
Commit: fc7af21c7c
Pull-request: https://github.com/SerenityOS/serenity/pull/10368
6 changed files with 41 additions and 0 deletions
|
@ -33,6 +33,17 @@ String ResolvedCSSStyleDeclaration::item(size_t index) const
|
|||
return {};
|
||||
}
|
||||
|
||||
static CSS::ValueID to_css_value_id(CSS::BoxSizing value)
|
||||
{
|
||||
switch (value) {
|
||||
case CSS::BoxSizing::BorderBox:
|
||||
return CSS::ValueID::BorderBox;
|
||||
case CSS::BoxSizing::ContentBox:
|
||||
return CSS::ValueID::ContentBox;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
static CSS::ValueID to_css_value_id(CSS::Display value)
|
||||
{
|
||||
switch (value) {
|
||||
|
@ -546,6 +557,8 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
|
|||
}
|
||||
case CSS::PropertyID::ListStyleType:
|
||||
return IdentifierStyleValue::create(to_css_value_id(layout_node.computed_values().list_style_type()));
|
||||
case CSS::PropertyID::BoxSizing:
|
||||
return IdentifierStyleValue::create(to_css_value_id(layout_node.computed_values().box_sizing()));
|
||||
case CSS::PropertyID::Invalid:
|
||||
return IdentifierStyleValue::create(CSS::ValueID::Invalid);
|
||||
case CSS::PropertyID::Custom:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue