1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

LibWeb: Keep both horizontal and vertical border radii till painting

This commit is contained in:
MacDue 2022-06-12 15:05:47 +01:00 committed by Linus Groh
parent 2366a73474
commit 28c78b45ca
10 changed files with 133 additions and 84 deletions

View file

@ -110,6 +110,11 @@ struct ContentData {
String alt_text {};
};
struct BorderRadiusData {
CSS::LengthPercentage horizontal_radius { InitialValues::border_radius() };
CSS::LengthPercentage vertical_radius { InitialValues::border_radius() };
};
class ComputedValues {
public:
CSS::Float float_() const { return m_noninherited.float_; }
@ -159,10 +164,10 @@ public:
BorderData const& border_right() const { return m_noninherited.border_right; }
BorderData const& border_bottom() const { return m_noninherited.border_bottom; }
const CSS::LengthPercentage& border_bottom_left_radius() const { return m_noninherited.border_bottom_left_radius; }
const CSS::LengthPercentage& border_bottom_right_radius() const { return m_noninherited.border_bottom_right_radius; }
const CSS::LengthPercentage& border_top_left_radius() const { return m_noninherited.border_top_left_radius; }
const CSS::LengthPercentage& border_top_right_radius() const { return m_noninherited.border_top_right_radius; }
const CSS::BorderRadiusData& border_bottom_left_radius() const { return m_noninherited.border_bottom_left_radius; }
const CSS::BorderRadiusData& border_bottom_right_radius() const { return m_noninherited.border_bottom_right_radius; }
const CSS::BorderRadiusData& border_top_left_radius() const { return m_noninherited.border_top_left_radius; }
const CSS::BorderRadiusData& border_top_right_radius() const { return m_noninherited.border_top_right_radius; }
CSS::Overflow overflow_x() const { return m_noninherited.overflow_x; }
CSS::Overflow overflow_y() const { return m_noninherited.overflow_y; }
@ -237,10 +242,10 @@ protected:
BorderData border_top;
BorderData border_right;
BorderData border_bottom;
LengthPercentage border_bottom_left_radius { InitialValues::border_radius() };
LengthPercentage border_bottom_right_radius { InitialValues::border_radius() };
LengthPercentage border_top_left_radius { InitialValues::border_radius() };
LengthPercentage border_top_right_radius { InitialValues::border_radius() };
BorderRadiusData border_bottom_left_radius;
BorderRadiusData border_bottom_right_radius;
BorderRadiusData border_top_left_radius;
BorderRadiusData border_top_right_radius;
Color background_color { InitialValues::background_color() };
Vector<BackgroundLayerData> background_layers;
CSS::FlexDirection flex_direction { InitialValues::flex_direction() };
@ -304,10 +309,10 @@ public:
void set_overflow_y(CSS::Overflow value) { m_noninherited.overflow_y = value; }
void set_list_style_type(CSS::ListStyleType value) { m_inherited.list_style_type = value; }
void set_display(CSS::Display value) { m_noninherited.display = value; }
void set_border_bottom_left_radius(CSS::LengthPercentage value) { m_noninherited.border_bottom_left_radius = value; }
void set_border_bottom_right_radius(CSS::LengthPercentage value) { m_noninherited.border_bottom_right_radius = value; }
void set_border_top_left_radius(CSS::LengthPercentage value) { m_noninherited.border_top_left_radius = value; }
void set_border_top_right_radius(CSS::LengthPercentage value) { m_noninherited.border_top_right_radius = value; }
void set_border_bottom_left_radius(CSS::BorderRadiusData value) { m_noninherited.border_bottom_left_radius = value; }
void set_border_bottom_right_radius(CSS::BorderRadiusData value) { m_noninherited.border_bottom_right_radius = value; }
void set_border_top_left_radius(CSS::BorderRadiusData value) { m_noninherited.border_top_left_radius = value; }
void set_border_top_right_radius(CSS::BorderRadiusData value) { m_noninherited.border_top_right_radius = value; }
BorderData& border_left() { return m_noninherited.border_left; }
BorderData& border_top() { return m_noninherited.border_top; }
BorderData& border_right() { return m_noninherited.border_right; }