Repository navigation
script: Make iframe resizes immediately observable in child. - #46587
Merged
Merged
Conversation
jschwe
force-pushed
the
issue-45888-iframe-resize
branch
from
July 17, 2026 11:49
c7233ab to
f5db44c
Compare
When an iframe is resized, the new size should be observable immediatly, but before this commit observability was delayed. To fix this `add_resize_event` now immediatly applies the new viewport size. The resize event itself is processed as before during "run the resize steps". This is however a best effort approach (as in other engines too). If we can't flush parents layout synchronously, then we accept potentially outdated sizes. Layout queries flush the layout of parents, if it is out of date The viewport size can now be updated many times between reflows, we move the `dirty_all_nodes` to the reflow restyle phase, since dirtying everything synchronously would probably be bad for performance. The new location should be equivalent, since it's the only consumer. Signed-off-by: Jonathan Schwender <[email protected]>
jschwe
force-pushed
the
issue-45888-iframe-resize
branch
from
July 17, 2026 12:28
f5db44c to
c8ee6a3
Compare
jschwe
marked this pull request as ready for review
July 17, 2026 12:49
jdm
approved these changes
Jul 17, 2026
jdm
left a comment
Member
There was a problem hiding this comment.
Very nice! I'd like to file a followup issue on removing the early return, because a situation where parent layouts are unsafe but child layouts are safe sounds wrong to me.
Comment on lines
+2879
to
+2880
| // If we can't run layout we need to abort, otherwise we'd run into the same check but as an assert | ||
| // later. |
Member
There was a problem hiding this comment.
I'm interested in understanding when this happens. Do you have testcases that trigger this assertion?
Member
Author
There was a problem hiding this comment.
It triggered crashes in a couple wpt tests. One of them was dom/nodes/Node-isConnected.html
Co-authored-by: Josh Matthews <[email protected]> Signed-off-by: Jonathan Schwender <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an iframe is resized, the new size should be
observable immediately, but before this commit observability was delayed.
To fix this
add_resize_eventnow immediately applies the new viewport size. The resize event itself is processed as before during "run the resize steps".Layout queries flush the layout of parents, if it is out of date,
this is however a best effort approach (as in other engines too). If we can't flush parents layout synchronously, then we accept potentially outdated sizes.
The viewport size can now be updated many times between reflows, hence we move
dirty_all_nodesto the reflow restyle phase, since dirtying everything synchronously would probably be bad for performance. The new location should be equivalent, since it's the only consumer.Testing: Many new wpt-tests pass,
element-ready-check-containing-iframe.htmlchanges from FAIL to timeout. mach tryFixes: #45888