LibWeb: Store final box model metrics in paint tree, not layout tree

This was a weird case of layout results being stored in the layout tree
instead of in the paint tree like everything else.
This commit is contained in:
Andreas Kling 2025-02-17 13:54:36 +01:00 committed by Andreas Kling
parent 71cb04d8cb
commit fb020a3c8f
Notes: github-actions[bot] 2025-02-17 17:29:27 +00:00
8 changed files with 65 additions and 58 deletions

View file

@ -1,41 +0,0 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Layout/BoxModelMetrics.h>
namespace Web::Layout {
PixelBox BoxModelMetrics::margin_box() const
{
return {
margin.top + border.top + padding.top,
margin.right + border.right + padding.right,
margin.bottom + border.bottom + padding.bottom,
margin.left + border.left + padding.left,
};
}
PixelBox BoxModelMetrics::padding_box() const
{
return {
padding.top,
padding.right,
padding.bottom,
padding.left,
};
}
PixelBox BoxModelMetrics::border_box() const
{
return {
border.top + padding.top,
border.right + padding.right,
border.bottom + padding.bottom,
border.left + padding.left,
};
}
}