LibWeb: Remove non-spec condition in scrollable overflow calculation

This commit is contained in:
Psychpsyo 2024-11-23 14:58:32 +01:00 committed by Sam Atkins
parent 366f15b441
commit 0320494c3f
Notes: github-actions[bot] 2024-12-04 17:26:30 +00:00
3 changed files with 26 additions and 3 deletions

View file

@ -124,11 +124,11 @@ static CSSPixelRect measure_scrollable_overflow(Box const& box)
// (including zero-area boxes and accounting for transforms as described above),
// provided they themselves have overflow: visible (i.e. do not themselves trap the overflow)
// and that scrollable overflow is not already clipped (e.g. by the clip property or the contain property).
if (is<Viewport>(box) || child.computed_values().overflow_x() == CSS::Overflow::Visible || child.computed_values().overflow_y() == CSS::Overflow::Visible) {
if (child.computed_values().overflow_x() == CSS::Overflow::Visible || child.computed_values().overflow_y() == CSS::Overflow::Visible) {
auto child_scrollable_overflow = measure_scrollable_overflow(child);
if (is<Viewport>(box) || child.computed_values().overflow_x() == CSS::Overflow::Visible)
if (child.computed_values().overflow_x() == CSS::Overflow::Visible)
scrollable_overflow_rect.unite_horizontally(child_scrollable_overflow);
if (is<Viewport>(box) || child.computed_values().overflow_y() == CSS::Overflow::Visible)
if (child.computed_values().overflow_y() == CSS::Overflow::Visible)
scrollable_overflow_rect.unite_vertically(child_scrollable_overflow);
}

View file

@ -0,0 +1 @@
<!-- This page intentionally left blank -->

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<link rel="match" href="../expected/scrollable-overflow-viewport-bug.html">
<style>
#child {
position: absolute;
top: 150vh;
width: 100px;
height: 100px;
}
#holder {
position: absolute;
overflow: hidden;
}
</style>
<div id="holder"></div>
<script>
const child = document.createElement("div");
child.id = "child";
holder.appendChild(child);
</script>