mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 07:25:07 +00:00
LibWeb: Stop creating auto
LengthStyleValue for resolved style
This commit is contained in:
parent
5647d37d42
commit
e3b557fa64
1 changed files with 3 additions and 5 deletions
|
@ -166,6 +166,8 @@ static NonnullRefPtr<StyleValue const> value_or_default(Optional<StyleProperty>
|
|||
|
||||
static NonnullRefPtr<StyleValue const> style_value_for_length_percentage(LengthPercentage const& length_percentage)
|
||||
{
|
||||
if (length_percentage.is_auto())
|
||||
return IdentifierStyleValue::create(ValueID::Auto);
|
||||
if (length_percentage.is_percentage())
|
||||
return PercentageStyleValue::create(length_percentage.percentage());
|
||||
if (length_percentage.is_length())
|
||||
|
@ -595,11 +597,7 @@ RefPtr<StyleValue const> ResolvedCSSStyleDeclaration::style_value_for_property(L
|
|||
}
|
||||
case CSS::PropertyID::VerticalAlign:
|
||||
if (auto const* length_percentage = layout_node.computed_values().vertical_align().get_pointer<CSS::LengthPercentage>()) {
|
||||
if (length_percentage->is_length())
|
||||
return LengthStyleValue::create(length_percentage->length());
|
||||
if (length_percentage->is_percentage())
|
||||
return PercentageStyleValue::create(length_percentage->percentage());
|
||||
VERIFY_NOT_REACHED();
|
||||
return style_value_for_length_percentage(*length_percentage);
|
||||
}
|
||||
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().vertical_align().get<CSS::VerticalAlign>()));
|
||||
case CSS::PropertyID::WhiteSpace:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue