mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-18 23:12:02 +00:00
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:
parent
71cb04d8cb
commit
fb020a3c8f
Notes:
github-actions[bot]
2025-02-17 17:29:27 +00:00
Author: https://github.com/awesomekling
Commit: fb020a3c8f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3603
Reviewed-by: https://github.com/gmta ✅
8 changed files with 65 additions and 58 deletions
|
@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue