mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibWeb: Remove inheritance of TableRowGroupBox
from BlockContainer
Having `TableRowGroupBox` not inherited from `BlockContainer` allows to write more simpler layout code.
This commit is contained in:
parent
1bdc4e6b29
commit
c8337e9ee8
Notes:
sideshowbarker
2024-07-17 03:30:41 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/c8337e9ee8 Pull-request: https://github.com/SerenityOS/serenity/pull/16913 Reviewed-by: https://github.com/awesomekling
3 changed files with 7 additions and 10 deletions
|
@ -457,19 +457,16 @@ void TableFormattingContext::run(Box const& box, LayoutMode, AvailableSpace cons
|
|||
auto& row_group_box_state = m_state.get_mutable(row_group_box);
|
||||
row_group_box_state.set_content_y(row_group_top_offset);
|
||||
|
||||
CSSPixels row_top_offset = 0.0f;
|
||||
row_group_box.template for_each_child_of_type<TableRowBox>([&](auto& row) {
|
||||
auto& row_state = m_state.get_mutable(row);
|
||||
row_state.set_content_y(row_top_offset);
|
||||
auto const& row_state = m_state.get(row);
|
||||
row_group_height += row_state.border_box_height();
|
||||
row_group_width = max(row_group_width, row_state.border_box_width());
|
||||
row_top_offset += row_state.border_box_height();
|
||||
});
|
||||
|
||||
row_group_top_offset += row_top_offset;
|
||||
|
||||
row_group_box_state.set_content_height(row_group_height);
|
||||
row_group_box_state.set_content_width(row_group_width);
|
||||
|
||||
row_group_top_offset += row_group_height;
|
||||
});
|
||||
|
||||
for (auto& cell : m_cells) {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace Web::Layout {
|
||||
|
||||
TableRowGroupBox::TableRowGroupBox(DOM::Document& document, DOM::Element* element, NonnullRefPtr<CSS::StyleProperties> style)
|
||||
: Layout::BlockContainer(document, element, move(style))
|
||||
: Layout::Box(document, element, move(style))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Layout/BlockContainer.h>
|
||||
#include <LibWeb/Layout/Box.h>
|
||||
|
||||
namespace Web::Layout {
|
||||
|
||||
class TableRowGroupBox final : public BlockContainer {
|
||||
JS_CELL(TableRowGroupBox, BlockContainer);
|
||||
class TableRowGroupBox final : public Box {
|
||||
JS_CELL(TableRowGroupBox, Box);
|
||||
|
||||
public:
|
||||
TableRowGroupBox(DOM::Document&, DOM::Element*, NonnullRefPtr<CSS::StyleProperties>);
|
||||
|
|
Loading…
Reference in a new issue