summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authormartinfalisse <martinmotteditfalisse@gmail.com>2023-04-05 18:21:40 +0200
committerAndreas Kling <kling@serenityos.org>2023-04-07 10:42:26 +0200
commitc839c51b0b2a1ccf30734147995fd94be2e30d0e (patch)
tree217d9a988c9703a71351435c00b5bcef099a88ed /Userland
parent1440845aadaa457a00558579fb2b79c833da1ebf (diff)
downloadserenity-c839c51b0b2a1ccf30734147995fd94be2e30d0e.zip
LibWeb: Use max-width property in table formatting
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
index dad77c8e88..0a9dd32306 100644
--- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
@@ -246,6 +246,8 @@ void TableFormattingContext::compute_table_width()
// of resolved-table-width, and the used min-width of the table.
CSSPixels resolved_table_width = computed_values.width().resolved(table_box(), CSS::Length::make_px(width_of_table_containing_block)).to_px(table_box());
used_width = max(resolved_table_width, used_min_width);
+ if (!computed_values.max_width().is_none())
+ used_width = min(used_width, computed_values.max_width().resolved(table_box(), CSS::Length::make_px(width_of_table_containing_block)).to_px(table_box()));
table_box_state.set_content_width(used_width);
}
}