mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-17 15:02:24 +00:00
LibWeb: Ignore mousewheel events in ViewportPaintable
That allow EventHandler process wheel event on corresponding navigable. For top-level navigable that means IPC call to let chrome know about scrollbar position update. Fixes https://github.com/SerenityOS/serenity/issues/23599 Fixes https://github.com/SerenityOS/serenity/issues/23493 Fixes https://github.com/SerenityOS/serenity/issues/23966
This commit is contained in:
parent
d53058421a
commit
bad86ca6b4
Notes:
sideshowbarker
2024-07-17 18:46:57 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: bad86ca6b4
Pull-request: https://github.com/SerenityOS/serenity/pull/24008
Issue: https://github.com/SerenityOS/serenity/issues/23493
Issue: https://github.com/SerenityOS/serenity/issues/23599
Issue: https://github.com/SerenityOS/serenity/issues/23966
4 changed files with 62 additions and 0 deletions
|
@ -0,0 +1 @@
|
||||||
|
new scrollY: 100
|
54
Tests/LibWeb/Text/input/scroll-window-using-wheel-event.html
Normal file
54
Tests/LibWeb/Text/input/scroll-window-using-wheel-event.html
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
height: 300px;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.red {
|
||||||
|
background-color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.green {
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cyan {
|
||||||
|
background-color: cyan;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pink {
|
||||||
|
background-color: pink;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blue {
|
||||||
|
background-color: blue;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="container">
|
||||||
|
<div class="box red"></div>
|
||||||
|
<div class="box green"></div>
|
||||||
|
<div class="box blue"></div>
|
||||||
|
<div class="box pink"></div>
|
||||||
|
<div class="box cyan"></div>
|
||||||
|
<div class="box red"></div>
|
||||||
|
<div class="box green"></div>
|
||||||
|
<div class="box blue"></div>
|
||||||
|
<div class="box pink"></div>
|
||||||
|
<div class="box cyan"></div>
|
||||||
|
</div>
|
||||||
|
<script src="include.js"></script>
|
||||||
|
<script>
|
||||||
|
asyncTest(done => {
|
||||||
|
const container = document.querySelector(".container");
|
||||||
|
window.onscroll = () => {
|
||||||
|
println(`new scrollY: ${window.scrollY}`);
|
||||||
|
done();
|
||||||
|
};
|
||||||
|
internals.wheel(50, 50, 0, 100);
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -515,6 +515,11 @@ void ViewportPaintable::recompute_selection_states()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ViewportPaintable::handle_mousewheel(Badge<EventHandler>, CSSPixelPoint, unsigned, unsigned, int, int)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void ViewportPaintable::visit_edges(Visitor& visitor)
|
void ViewportPaintable::visit_edges(Visitor& visitor)
|
||||||
{
|
{
|
||||||
Base::visit_edges(visitor);
|
Base::visit_edges(visitor);
|
||||||
|
|
|
@ -34,6 +34,8 @@ public:
|
||||||
JS::GCPtr<Selection::Selection> selection() const;
|
JS::GCPtr<Selection::Selection> selection() const;
|
||||||
void recompute_selection_states();
|
void recompute_selection_states();
|
||||||
|
|
||||||
|
bool handle_mousewheel(Badge<EventHandler>, CSSPixelPoint, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void build_stacking_context_tree();
|
void build_stacking_context_tree();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue