mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:17:35 +00:00
LibWeb: Set border width to zero if style is none
This commit is contained in:
parent
d5eb09adc2
commit
86290c0e4e
1 changed files with 4 additions and 1 deletions
|
@ -307,9 +307,12 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& specified_style)
|
||||||
computed_values.set_padding(specified_style.length_box(CSS::PropertyID::PaddingLeft, CSS::PropertyID::PaddingTop, CSS::PropertyID::PaddingRight, CSS::PropertyID::PaddingBottom, CSS::Length::make_px(0)));
|
computed_values.set_padding(specified_style.length_box(CSS::PropertyID::PaddingLeft, CSS::PropertyID::PaddingTop, CSS::PropertyID::PaddingRight, CSS::PropertyID::PaddingBottom, CSS::Length::make_px(0)));
|
||||||
|
|
||||||
auto do_border_style = [&](CSS::BorderData& border, CSS::PropertyID width_property, CSS::PropertyID color_property, CSS::PropertyID style_property) {
|
auto do_border_style = [&](CSS::BorderData& border, CSS::PropertyID width_property, CSS::PropertyID color_property, CSS::PropertyID style_property) {
|
||||||
border.width = specified_style.length_or_fallback(width_property, {}).resolved_or_zero(*this, 0).to_px(*this);
|
|
||||||
border.color = specified_style.color_or_fallback(color_property, document(), Color::Transparent);
|
border.color = specified_style.color_or_fallback(color_property, document(), Color::Transparent);
|
||||||
border.line_style = specified_style.line_style(style_property).value_or(CSS::LineStyle::None);
|
border.line_style = specified_style.line_style(style_property).value_or(CSS::LineStyle::None);
|
||||||
|
if (border.line_style == CSS::LineStyle::None)
|
||||||
|
border.width = 0;
|
||||||
|
else
|
||||||
|
border.width = specified_style.length_or_fallback(width_property, {}).resolved_or_zero(*this, 0).to_px(*this);
|
||||||
};
|
};
|
||||||
|
|
||||||
do_border_style(computed_values.border_left(), CSS::PropertyID::BorderLeftWidth, CSS::PropertyID::BorderLeftColor, CSS::PropertyID::BorderLeftStyle);
|
do_border_style(computed_values.border_left(), CSS::PropertyID::BorderLeftWidth, CSS::PropertyID::BorderLeftColor, CSS::PropertyID::BorderLeftStyle);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue