Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't make frame initial viewport size depend on whether it's been la…
…id out. This is rather tricky / unfortunate, but this is the low-risk fix for now. The issue is as follows: When we construct a subdocument frame, we try to show its viewer by using a script runner which will call ShowViewer(). If ShowViewer() gets called before the subdoc frame gets laid out (has the NS_FRAME_FIRST_REFLOW bit set), we pick an (arbitrary) 10x10 device pixel size, and initialize the page with that viewport. Then, eventually, the frame gets laid out to the correct size and fires a resize event. If we have container queries around, we need to lay out the page while styling, which causes the layout to happen before the script blocker checkpoint, and thus the viewport to get initialized with the right size to begin with. This generally shouldn't be bad, but google chat at least seems to rely on this resize event (and the divergence being caused by container queries is rather unfortunate). For now, do the low risk fix of always using the "initial" subdoc frame size to show the viewer. We should ideally sort this out better. Even our "good" behavior is quite bizarre (e.g, I'd expect going from display: block to none to trigger a resize event and the viewport to go back to 0... As you noted, chrome's inner layout sizes do change when the frame is display: none). But it seems worth to land this at least in the interim. Differential Revision: https://phabricator.services.mozilla.com/D233399 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1935189 gecko-commit: 0c612ed5d669c157a34c24d0c7df4b7f8ccd5fe4 gecko-reviewers: dholbert
- Loading branch information