LibWeb: Use border box to position sticky elements

Fixes https://github.com/LadybirdBrowser/ladybird/issues/1245
This commit is contained in:
Aliaksandr Kalenik
2024-09-02 14:06:35 +02:00
committed by Andreas Kling
parent 2e06d26ddb
commit 427e6cec7b
5 changed files with 81 additions and 19 deletions

View File

@@ -1120,9 +1120,9 @@ RefPtr<ScrollFrame const> PaintableBox::nearest_scroll_frame() const
return nullptr;
}
CSSPixelRect PaintableBox::padding_box_rect_relative_to_nearest_scrollable_ancestor() const
CSSPixelRect PaintableBox::border_box_rect_relative_to_nearest_scrollable_ancestor() const
{
auto result = absolute_padding_box_rect();
auto result = absolute_border_box_rect();
auto const* nearest_scrollable_ancestor = this->nearest_scrollable_ancestor();
if (nearest_scrollable_ancestor) {
result.set_location(result.location() - nearest_scrollable_ancestor->absolute_rect().top_left());