1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:57:45 +00:00

LibWeb: Introduce struct to hold border radii and normalize once

The struct BorderRadiusData contains the four radii of the box.
In case the specified borders are too large for the dimensions of the
box, they get scaled down.
This commit is contained in:
Tobias Christiansen 2021-05-16 00:15:37 +02:00 committed by Andreas Kling
parent c31046d952
commit 7a566e54e5
2 changed files with 44 additions and 10 deletions

View file

@ -121,6 +121,16 @@ public:
virtual float width_of_logical_containing_block() const;
struct BorderRadiusData {
// FIXME: Use floats here
int top_left { 0 };
int top_right { 0 };
int bottom_right { 0 };
int bottom_left { 0 };
};
BorderRadiusData normalized_border_radius_data();
protected:
Box(DOM::Document& document, DOM::Node* node, NonnullRefPtr<CSS::StyleProperties> style)
: NodeWithStyleAndBoxModelMetrics(document, node, move(style))