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

@ -67,7 +67,7 @@ impl BoxTree {
// TODO: This should handle when different overflow is set multiple axes, which requires the
// compositor scroll tree to allow setting a value per axis.
let root_style = root_element.style(context);
let mut root_overflow = root_style.get_box().overflow_y;
let mut root_overflow = root_style.effective_overflow().y;
if root_overflow == Overflow::Visible && !root_style.get_box().display.is_none() {
for child in iter_child_nodes(root_element) {
if !child.to_threadsafe().as_element().map_or(false, |element| {
@ -78,7 +78,7 @@ impl BoxTree {
let style = child.style(context);
if !style.get_box().display.is_none() {
root_overflow = style.get_box().overflow_y;
root_overflow = style.effective_overflow().y;
break;
}
}