1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +00:00

LibWeb: Fix vertical position of top table caption

Setting the top of the table coordinate should not consider the top
padding and margin of the caption, just the bottom and content height.
This commit is contained in:
Andi Gallo 2023-07-25 02:13:44 +00:00 committed by Andreas Kling
parent 902e76baff
commit 66c92ebe3d
3 changed files with 43 additions and 1 deletions

View file

@ -91,7 +91,7 @@ CSSPixels TableFormattingContext::run_caption_layout(LayoutMode layout_mode, CSS
caption_context->resolve_vertical_box_model_metrics(child_box);
auto const& caption_state = m_state.get(child_box);
if (phase == CSS::CaptionSide::Top) {
m_state.get_mutable(table_box()).set_content_y(caption_state.margin_box_height());
m_state.get_mutable(table_box()).set_content_y(caption_state.content_height() + caption_state.margin_box_bottom());
} else {
m_state.get_mutable(child_box).set_content_y(
m_state.get(table_box()).margin_box_height() + caption_state.margin_box_top());