mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibWeb: Set border width to zero if style is none
This commit is contained in:
parent
d5eb09adc2
commit
86290c0e4e
Notes:
sideshowbarker
2024-07-18 20:28:38 +09:00
Author: https://github.com/Cleverking2003 Commit: https://github.com/SerenityOS/serenity/commit/86290c0e4ef Pull-request: https://github.com/SerenityOS/serenity/pull/6270
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)));
|
||||
|
||||
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.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);
|
||||
|
|
Loading…
Add table
Reference in a new issue