mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 13:30:31 +00:00
LibWeb: Take padding into account when resolving border radii
Before this change, we were resolving border radii values based on content box + border widths only, ignoring padding.
This commit is contained in:
parent
402de2985d
commit
ca57e40350
Notes:
sideshowbarker
2024-07-17 08:35:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ca57e40350 Pull-request: https://github.com/SerenityOS/serenity/pull/22643
3 changed files with 19 additions and 2 deletions
10
Tests/LibWeb/Ref/border-radius-with-padding.html
Normal file
10
Tests/LibWeb/Ref/border-radius-with-padding.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<!doctype html><head>
|
||||
<link rel="match" href="reference/border-radius-with-padding-ref.html" />
|
||||
<style type="text/css">
|
||||
div {
|
||||
border: 1px solid black;
|
||||
border-radius: 32px;
|
||||
padding: 25px;
|
||||
width: 0px;
|
||||
}
|
||||
</style></head><body><div>
|
|
@ -0,0 +1,8 @@
|
|||
<!doctype html><style type="text/css">
|
||||
div {
|
||||
border: 1px solid black;
|
||||
border-radius: 32px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
</style><div>
|
|
@ -285,8 +285,7 @@ void LayoutState::resolve_border_radii()
|
|||
if (paintable && is<Painting::PaintableBox>(*paintable)) {
|
||||
auto& paintable_box = static_cast<Painting::PaintableBox&>(*paintable);
|
||||
|
||||
CSSPixelRect const content_rect { 0, 0, used_values.content_width(), used_values.content_height() };
|
||||
auto border_rect = content_rect.inflated(used_values.border_top, used_values.border_right, used_values.border_bottom, used_values.border_left);
|
||||
CSSPixelRect const border_rect { 0, 0, used_values.border_box_width(), used_values.border_box_height() };
|
||||
|
||||
auto const& border_top_left_radius = node.computed_values().border_top_left_radius();
|
||||
auto const& border_top_right_radius = node.computed_values().border_top_right_radius();
|
||||
|
|
Loading…
Reference in a new issue