mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 07:02:54 +00:00
Before this change "scroll" events were only fired on document but now it happens for all elements with scrollable overflow.
29 lines
1,011 B
HTML
29 lines
1,011 B
HTML
<!DOCTYPE html>
|
|
<style>
|
|
#scrollable-div {
|
|
width: 300px;
|
|
height: 200px;
|
|
overflow: auto;
|
|
border: 1px solid black;
|
|
padding: 10px;
|
|
font-size: 50px;
|
|
}
|
|
</style>
|
|
<script src="include.js"></script>
|
|
<div id="scrollable-div">
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed
|
|
cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis
|
|
ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum
|
|
lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
|
|
inceptos himenaeos.
|
|
</div>
|
|
<script>
|
|
asyncTest(done => {
|
|
const scrollable = document.getElementById("scrollable-div");
|
|
scrollable.addEventListener("scroll", event => {
|
|
println(`scroll event fired y=${scrollable.scrollTop}`);
|
|
done();
|
|
});
|
|
scrollable.scrollTop = 100;
|
|
});
|
|
</script>
|