Let table-related boxes adjust their overflow values (#33400)

The `overflow` property doesn't apply to table track and track groups,
and table elements only accept a few `overflow` values.

Therefore, this patch adds an `effective_overflow()` method to get the
actual value that needs to be used.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Oriol Brufau 2024-09-11 17:30:17 +02:00 committed by GitHub
parent 027fc53e2f
commit 9175e598ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 64 additions and 17 deletions

View file

@ -241,7 +241,7 @@ impl BoxFragment {
\nclearance={:?}\
\nscrollable_overflow={:?}\
\nbaselines={:?}\
\noverflow={:?} / {:?}",
\noverflow={:?}",
self.base,
self.content_rect,
self.padding_rect(),
@ -250,8 +250,7 @@ impl BoxFragment {
self.clearance,
self.scrollable_overflow(),
self.baselines,
self.style.get_box().overflow_x,
self.style.get_box().overflow_y,
self.style.effective_overflow(),
));
for child in &self.children {
@ -274,12 +273,13 @@ impl BoxFragment {
overflow.max_y().max(scrollable_overflow.max_y()),
);
if self.style.get_box().overflow_y == ComputedOverflow::Visible {
let overflow_style = self.style.effective_overflow();
if overflow_style.y == ComputedOverflow::Visible {
overflow.origin.y = overflow.origin.y.min(scrollable_overflow.origin.y);
overflow.size.height = bottom_right.y - overflow.origin.y;
}
if self.style.get_box().overflow_x == ComputedOverflow::Visible {
if overflow_style.x == ComputedOverflow::Visible {
overflow.origin.x = overflow.origin.x.min(scrollable_overflow.origin.x);
overflow.size.width = bottom_right.x - overflow.origin.x;
}