LibWeb: Don't fire resize event until document actually resizes once

The first time Document learns its viewport size, we now suppress firing
of the resize event.

This fixes an issue on multiple websites that were not expecting resize
events to fire so early in the loading process.
This commit is contained in:
Andreas Kling
2024-07-10 07:41:29 +02:00
committed by Andreas Kling
parent 0cdbcfd8b0
commit 4e7558c88b
Notes: sideshowbarker 2024-07-17 02:05:41 +09:00
4 changed files with 18 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
<script>
var resizeCount = 0;
onresize = function() {
++resizeCount;
}
</script>
<script src="include.js"></script>
<script>
test(() => {
println("resize count: " + resizeCount);
})
</script>