mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Remove non-spec condition in scrollable overflow calculation
This commit is contained in:
parent
366f15b441
commit
0320494c3f
Notes:
github-actions[bot]
2024-12-04 17:26:30 +00:00
Author: https://github.com/Psychpsyo
Commit: 0320494c3f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2525
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 26 additions and 3 deletions
|
@ -124,11 +124,11 @@ static CSSPixelRect measure_scrollable_overflow(Box const& box)
|
||||||
// (including zero-area boxes and accounting for transforms as described above),
|
// (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)
|
// 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).
|
// 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);
|
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);
|
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);
|
scrollable_overflow_rect.unite_vertically(child_scrollable_overflow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<!-- This page intentionally left blank -->
|
22
Tests/LibWeb/Ref/input/scrollable-overflow-viewport-bug.html
Normal file
22
Tests/LibWeb/Ref/input/scrollable-overflow-viewport-bug.html
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue