mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 23:15:07 +00:00
LibWeb: Improve resolved style for CSS {min,max}-{width,height}
If the specified value for these properties is "none", we end up storing it as an "undefined" CSS::Length in the computed values. We need to convert it back into "none" for getComputedStyle().
This commit is contained in:
parent
fb98e12f86
commit
a31855ae10
1 changed files with 8 additions and 0 deletions
|
@ -452,14 +452,22 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
|
||||||
case CSS::PropertyID::Width:
|
case CSS::PropertyID::Width:
|
||||||
return LengthStyleValue::create(layout_node.computed_values().width());
|
return LengthStyleValue::create(layout_node.computed_values().width());
|
||||||
case CSS::PropertyID::MinWidth:
|
case CSS::PropertyID::MinWidth:
|
||||||
|
if (layout_node.computed_values().min_width().is_undefined())
|
||||||
|
return IdentifierStyleValue::create(CSS::ValueID::None);
|
||||||
return LengthStyleValue::create(layout_node.computed_values().min_width());
|
return LengthStyleValue::create(layout_node.computed_values().min_width());
|
||||||
case CSS::PropertyID::MaxWidth:
|
case CSS::PropertyID::MaxWidth:
|
||||||
|
if (layout_node.computed_values().max_width().is_undefined())
|
||||||
|
return IdentifierStyleValue::create(CSS::ValueID::None);
|
||||||
return LengthStyleValue::create(layout_node.computed_values().max_width());
|
return LengthStyleValue::create(layout_node.computed_values().max_width());
|
||||||
case CSS::PropertyID::Height:
|
case CSS::PropertyID::Height:
|
||||||
return LengthStyleValue::create(layout_node.computed_values().height());
|
return LengthStyleValue::create(layout_node.computed_values().height());
|
||||||
case CSS::PropertyID::MinHeight:
|
case CSS::PropertyID::MinHeight:
|
||||||
|
if (layout_node.computed_values().min_height().is_undefined())
|
||||||
|
return IdentifierStyleValue::create(CSS::ValueID::None);
|
||||||
return LengthStyleValue::create(layout_node.computed_values().min_height());
|
return LengthStyleValue::create(layout_node.computed_values().min_height());
|
||||||
case CSS::PropertyID::MaxHeight:
|
case CSS::PropertyID::MaxHeight:
|
||||||
|
if (layout_node.computed_values().max_height().is_undefined())
|
||||||
|
return IdentifierStyleValue::create(CSS::ValueID::None);
|
||||||
return LengthStyleValue::create(layout_node.computed_values().max_height());
|
return LengthStyleValue::create(layout_node.computed_values().max_height());
|
||||||
case CSS::PropertyID::MarginTop:
|
case CSS::PropertyID::MarginTop:
|
||||||
return LengthStyleValue::create(layout_node.computed_values().margin().top);
|
return LengthStyleValue::create(layout_node.computed_values().margin().top);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue