mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:28:11 +00:00
LibWeb: Make resolved styles handle calculated length-percentages
This could lead to a crash when inspecting for example the <body> on holidaycss.js.org, because it has `width: calc(100% - 1em)`
This commit is contained in:
parent
fe0f0b0acf
commit
450c0df938
2 changed files with 9 additions and 1 deletions
|
@ -497,7 +497,9 @@ static NonnullRefPtr<StyleValue> style_value_for_length_percentage(LengthPercent
|
|||
{
|
||||
if (length_percentage.is_percentage())
|
||||
return PercentageStyleValue::create(length_percentage.percentage());
|
||||
return LengthStyleValue::create(length_percentage.length());
|
||||
if (length_percentage.is_length())
|
||||
return LengthStyleValue::create(length_percentage.length());
|
||||
return length_percentage.calculated();
|
||||
}
|
||||
|
||||
RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout::NodeWithStyle const& layout_node, PropertyID property_id) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue