mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibWeb: Define static position calculation separately for each FC
Static position of a box is defined by formatting context type it belongs to, so let's define this algorithm separately for each FC instead of assuming FormattingContext::calculate_static_position_rect() understands how to handle all of them. Also with this change calculate_static_position_rect() is no longer virtual function.
This commit is contained in:
parent
6ee1c4c634
commit
1a78edb8c9
Notes:
github-actions[bot]
2024-10-06 13:45:57 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 1a78edb8c9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1642
11 changed files with 73 additions and 49 deletions
|
@ -1849,6 +1849,15 @@ CSSPixels TableFormattingContext::border_spacing_vertical() const
|
|||
return computed_values.border_spacing_vertical().to_px(table_box());
|
||||
}
|
||||
|
||||
StaticPositionRect TableFormattingContext::calculate_static_position_rect(Box const& box) const
|
||||
{
|
||||
// FIXME: Implement static position calculation for table descendants instead of always returning a rectangle with zero position and size.
|
||||
StaticPositionRect static_position;
|
||||
auto offset_to_static_parent = content_box_rect_in_static_position_ancestor_coordinate_space(box, *box.containing_block());
|
||||
static_position.rect = { offset_to_static_parent.location(), { 0, 0 } };
|
||||
return static_position;
|
||||
}
|
||||
|
||||
template<>
|
||||
Vector<TableFormattingContext::Row>& TableFormattingContext::table_rows_or_columns()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue