LibWeb: Let's say that layout viewports are always scroll containers

This will allow us to have a shared code path for overflow calculation.
This commit is contained in:
Andreas Kling 2023-05-29 08:52:34 +02:00
parent 571c05bb47
commit 4ff52cebc4
Notes: sideshowbarker 2024-07-17 18:06:52 +09:00

View File

@ -47,6 +47,10 @@ static bool overflow_value_makes_box_a_scroll_container(CSS::Overflow overflow)
// https://www.w3.org/TR/css-overflow-3/#scroll-container
bool Box::is_scroll_container() const
{
// NOTE: This isn't in the spec, but we want the viewport to behave like a scroll container.
if (is_viewport())
return true;
return overflow_value_makes_box_a_scroll_container(computed_values().overflow_x())
|| overflow_value_makes_box_a_scroll_container(computed_values().overflow_y());
}