mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
When delegating mouse events to iframes, coordinate transformations were not accounting for scroll offsets. This caused clicks inside iframes to be incorrectly positioned when the parent page was scrolled.
32 lines
788 B
HTML
32 lines
788 B
HTML
<!DOCTYPE html>
|
|
<style>
|
|
body { margin: 0; height: 2000px; }
|
|
iframe {
|
|
position: absolute;
|
|
top: 100px;
|
|
left: 50px;
|
|
width: 200px;
|
|
height: 200px;
|
|
border: none;
|
|
}
|
|
</style>
|
|
<iframe srcdoc="
|
|
<!DOCTYPE html>
|
|
<style>body { margin: 0; }</style>
|
|
<div style='width: 100px; height: 100px'
|
|
onclick='parent.reportClick(event.clientX, event.clientY)'></div>
|
|
"></iframe>
|
|
<script src="include.js"></script>
|
|
<script>
|
|
asyncTest((done) => {
|
|
window.reportClick = function(x, y) {
|
|
println(`click at (${x}, ${y})`);
|
|
done();
|
|
};
|
|
document.querySelector("iframe").onload = () => {
|
|
window.scrollTo(0, 50);
|
|
internals.click(60, 60);
|
|
};
|
|
});
|
|
</script>
|