mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 08:10:02 +00:00
LibWeb: Use padding box to get background rect for inline paintable
Fixes regression introduced by f574e2b03a
This commit is contained in:
parent
c891b83fc0
commit
0fe84e89b2
Notes:
github-actions[bot]
2024-08-06 14:26:28 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 0fe84e89b2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/992
3 changed files with 41 additions and 0 deletions
19
Tests/LibWeb/Ref/inline-block-with-css-background.html
Normal file
19
Tests/LibWeb/Ref/inline-block-with-css-background.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="match" href="reference/inline-block-with-css-background-ref.html" />
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
.box {
|
||||
margin-top: 8px;
|
||||
width: 200px;
|
||||
}
|
||||
.box span {
|
||||
background: rgb(138, 100, 229);
|
||||
border: 3px solid orange;
|
||||
font-size: 16px;
|
||||
color: rgb(255, 255, 255);
|
||||
padding: 5px 13px;
|
||||
}
|
||||
</style>
|
||||
<div class="box"><span>Text</span></div>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
.box {
|
||||
width: 200px;
|
||||
}
|
||||
.box span {
|
||||
background: rgb(138, 100, 229);
|
||||
border: 3px solid orange;
|
||||
font-size: 16px;
|
||||
color: rgb(255, 255, 255);
|
||||
padding: 5px 13px;
|
||||
display: block;
|
||||
width: fit-content;
|
||||
}
|
||||
</style>
|
||||
<div class="box"><span>Text</span></div>
|
|
@ -278,6 +278,9 @@ void InlinePaintable::resolve_paint_properties()
|
|||
bottom_left_border_radius);
|
||||
fragment.set_border_radii_data(border_radii_data);
|
||||
|
||||
absolute_fragment_rect.translate_by(0, -box_model().padding.top);
|
||||
absolute_fragment_rect.set_height(absolute_fragment_rect.height() + box_model().padding.top + box_model().padding.bottom);
|
||||
|
||||
auto resolved_background = resolve_background_layers(computed_values.background_layers(), layout_node, computed_values.background_color(), absolute_fragment_rect, border_radii_data);
|
||||
fragment.set_resolved_background(move(resolved_background));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue