mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 02:26:11 +00:00
LibWeb: Do not consume scroll event in PaintableBox without overflow
Specifically, without scrollable overflow. Fixes #24009, both on brave.com and on the reduction.
This commit is contained in:
parent
a020a0779d
commit
cd1eeb3cdd
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="match" href="reference/box-without-scrollable-overflow-should-not-consume-scroll-events-ref.html" />
|
||||
<style>
|
||||
.item {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid black;
|
||||
}
|
||||
.item1 { overflow: auto; }
|
||||
.scrollable {
|
||||
overflow-y: scroll;
|
||||
width: 100px;
|
||||
height: 300px;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
</style>
|
||||
<div class="scrollable">
|
||||
<div class="item item1">1</div>
|
||||
<div class="item">2</div>
|
||||
<div class="item">3</div>
|
||||
<div class="item">4</div>
|
||||
</div>
|
||||
<script>
|
||||
internals.wheel(10, 10, 0, 100);
|
||||
</script>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
.scrollable {
|
||||
overflow-y: scroll;
|
||||
width: 100px;
|
||||
height: 300px;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.item {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<div class="scrollable">
|
||||
<div class="item">2</div>
|
||||
<div class="item">3</div>
|
||||
<div class="item">4</div>
|
||||
</div>
|
|
@ -731,6 +731,11 @@ bool PaintableBox::handle_mousewheel(Badge<EventHandler>, CSSPixelPoint, unsigne
|
|||
{
|
||||
if (!layout_box().is_user_scrollable())
|
||||
return false;
|
||||
|
||||
// TODO: Vertical and horizontal scroll overflow should be handled seperately.
|
||||
if (!has_scrollable_overflow())
|
||||
return false;
|
||||
|
||||
scroll_by(wheel_delta_x, wheel_delta_y);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue