LibWeb: Inherit TableFormattingContext from FC instead of BFC
This commit is contained in:
parent
fae0b96fe4
commit
ca123350cc
Notes:
sideshowbarker
2024-07-17 08:35:21 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/ca123350cc Pull-request: https://github.com/SerenityOS/serenity/pull/16285
2 changed files with 8 additions and 8 deletions
|
@ -36,8 +36,8 @@ struct Traits<GridPosition> : public GenericTraits<GridPosition> {
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
TableFormattingContext::TableFormattingContext(LayoutState& state, BlockContainer const& block_container, FormattingContext* parent)
|
||||
: BlockFormattingContext(state, block_container, parent)
|
||||
TableFormattingContext::TableFormattingContext(LayoutState& state, BlockContainer const& root, FormattingContext* parent)
|
||||
: FormattingContext(Type::Table, state, root, parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -246,10 +246,10 @@ void TableFormattingContext::run(Box const& box, LayoutMode, AvailableSpace cons
|
|||
cell_state.border_right = cell.box.computed_values().border_right().width;
|
||||
|
||||
cell_state.set_content_width(span_width - cell_state.border_box_left() - cell_state.border_box_right());
|
||||
if (auto independent_formatting_context = layout_inside(cell.box, LayoutMode::Normal, cell_state.available_inner_space_or_constraints_from(available_space)))
|
||||
independent_formatting_context->parent_context_did_dimension_child_root_box();
|
||||
|
||||
BlockFormattingContext::compute_height(cell.box, AvailableSpace(AvailableSize::make_indefinite(), AvailableSize::make_indefinite()));
|
||||
auto independent_formatting_context = layout_inside(cell.box, LayoutMode::Normal, cell_state.available_inner_space_or_constraints_from(available_space));
|
||||
VERIFY(independent_formatting_context);
|
||||
cell_state.set_content_height(independent_formatting_context->automatic_content_height());
|
||||
independent_formatting_context->parent_context_did_dimension_child_root_box();
|
||||
|
||||
cell.baseline = box_baseline(m_state, cell.box);
|
||||
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <LibWeb/Layout/BlockFormattingContext.h>
|
||||
#include <LibWeb/Layout/FormattingContext.h>
|
||||
|
||||
namespace Web::Layout {
|
||||
|
||||
class TableFormattingContext final : public BlockFormattingContext {
|
||||
class TableFormattingContext final : public FormattingContext {
|
||||
public:
|
||||
explicit TableFormattingContext(LayoutState&, BlockContainer const&, FormattingContext* parent);
|
||||
~TableFormattingContext();
|
||||
|
|
Loading…
Add table
Reference in a new issue