diff --git a/Tests/LibWeb/Layout/expected/table/columns-width-distribution-1.txt b/Tests/LibWeb/Layout/expected/table/columns-width-distribution-1.txt index 5b98c8a899..623a767c39 100644 --- a/Tests/LibWeb/Layout/expected/table/columns-width-distribution-1.txt +++ b/Tests/LibWeb/Layout/expected/table/columns-width-distribution-1.txt @@ -2,14 +2,14 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline BlockContainer at (0,0) content-size 800x600 [BFC] children: not-inline BlockContainer
at (8,8) content-size 784x113.15625 children: not-inline TableWrapper <(anonymous)> at (8,8) content-size 784x113.15625 [BFC] children: not-inline - Box.mbox-image) [11,11 52x107.15625]
PaintableWithLines (BlockContainer .mbox-image-div) [12,39.578125 50x50]
- PaintableWithLines (BlockContainer .mbox-text) [65,11 726x107.15625]
+ PaintableWithLines (BlockContainer | .mbox-text) [65,11 724x107.15625]
TextPaintable (TextNode<#text>)
diff --git a/Tests/LibWeb/Layout/expected/table/infinite-padding.txt b/Tests/LibWeb/Layout/expected/table/infinite-padding.txt
new file mode 100644
index 0000000000..cbac3178ab
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/table/infinite-padding.txt
@@ -0,0 +1,21 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer at (0,0) content-size 800x16 [BFC] children: not-inline
+ BlockContainer at (8,8) content-size 784x0 children: not-inline
+ TableWrapper <(anonymous)> at (8,8) content-size 0x0 [BFC] children: not-inline
+ Box | at (8,8) content-size 0x0 table-box [TFC] children: not-inline
+ Box <(anonymous)> at (8,8) content-size 0x0 table-row children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 table-cell [BFC] children: not-inline
+ BlockContainer at (8,8) content-size 0x0 children: not-inline
+ TableWrapper <(anonymous)> at (8,8) content-size 0x0 [BFC] children: not-inline
+ Box at (8,8) content-size 0x0 table-box [TFC] children: not-inline
+
+PaintableWithLines (Viewport<#document>) [0,0 800x600]
+ PaintableWithLines (BlockContainer) [0,0 800x16]
+ PaintableWithLines (BlockContainer) [8,8 784x0]
+ PaintableWithLines (TableWrapper(anonymous)) [8,8 0x0]
+ PaintableBox (Box #box1) [8,8 0x0]
+ PaintableBox (Box(anonymous)) [8,8 0x0]
+ PaintableWithLines (BlockContainer(anonymous)) [8,8 0x0]
+ PaintableWithLines (BlockContainer ) [8,8 0x0]
+ PaintableWithLines (TableWrapper(anonymous)) [8,8 0x0]
+ PaintableBox (Box #box2) [8,8 0x0]
diff --git a/Tests/LibWeb/Layout/input/table/infinite-padding.html b/Tests/LibWeb/Layout/input/table/infinite-padding.html
new file mode 100644
index 0000000000..eb048c4352
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/table/infinite-padding.html
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
index ca684bb1a8..4013520bc8 100644
--- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
@@ -421,14 +421,6 @@ CSSPixels BlockFormattingContext::compute_table_box_width_inside_table_wrapper(B
auto available_width = width_of_containing_block - margin_left.to_px(box) - margin_right.to_px(box);
LayoutState throwaway_state(&m_state);
- if (available_space.width.is_definite())
- throwaway_state.get_mutable(box).set_content_width(available_width);
- else if (available_space.width.is_min_content())
- throwaway_state.get_mutable(box).set_min_content_width();
- else {
- VERIFY(available_space.width.is_max_content());
- throwaway_state.get_mutable(box).set_max_content_width();
- }
auto context = create_independent_formatting_context_if_needed(throwaway_state, box);
VERIFY(context);
context->run(box, LayoutMode::IntrinsicSizing, m_state.get(box).available_inner_space_or_constraints_from(available_space));
diff --git a/Userland/Libraries/LibWeb/Layout/LayoutState.cpp b/Userland/Libraries/LibWeb/Layout/LayoutState.cpp
index 076c5ead49..51ddbeed77 100644
--- a/Userland/Libraries/LibWeb/Layout/LayoutState.cpp
+++ b/Userland/Libraries/LibWeb/Layout/LayoutState.cpp
@@ -426,18 +426,4 @@ void LayoutState::UsedValues::set_indefinite_content_height()
m_has_definite_height = false;
}
-void LayoutState::UsedValues::set_min_content_width()
-{
- width_constraint = SizeConstraint::MinContent;
- m_content_width = 0;
- m_has_definite_height = false;
-}
-
-void LayoutState::UsedValues::set_max_content_width()
-{
- width_constraint = SizeConstraint::MaxContent;
- m_content_width = INFINITY;
- m_has_definite_width = false;
-}
-
}
diff --git a/Userland/Libraries/LibWeb/Layout/LayoutState.h b/Userland/Libraries/LibWeb/Layout/LayoutState.h
index 17d3601473..afdb8772aa 100644
--- a/Userland/Libraries/LibWeb/Layout/LayoutState.h
+++ b/Userland/Libraries/LibWeb/Layout/LayoutState.h
@@ -51,8 +51,6 @@ struct LayoutState {
void set_indefinite_content_width();
void set_indefinite_content_height();
- void set_min_content_width();
- void set_max_content_width();
// NOTE: These are used by FlexFormattingContext to assign a temporary main size to items
// early on, so that descendants have something to resolve percentages against.
diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
index d26e57b3e6..f654f8a53e 100644
--- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
@@ -567,7 +567,7 @@ void TableFormattingContext::compute_table_width()
auto& computed_values = table_box().computed_values();
- CSSPixels width_of_table_containing_block = m_state.get(*table_box().containing_block()).content_width();
+ CSSPixels width_of_table_containing_block = m_available_space->width.to_px();
// Percentages on 'width' and 'height' on the table are relative to the table wrapper box's containing block,
// not the table wrapper box itself.
|