On Headless and Linux new windows appear to not open at their intended size immediately.
Categories
(Core :: Layout, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox107 | --- | fixed |
People
(Reporter: matc.pub, Assigned: matc.pub)
Details
Attachments
(3 files)
Steps to reproduce:
Open a new window an log its sizes.
onclick = function () {
let win = open(document.location.href, "", "width=200,height=200");
console.log(win.innerWidth, win.innerHeight);
win.onload = function () {
console.log(win.innerWidth, win.innerHeight);
win.close();
};
};
This behavior started after Bug 1786513 (Make SimpleResizeReflow not flush by default.). The windows do indeed open at their intended size but the layout is not flushed early enough.
Actual results:
Log looks like:
1280 931
200 200
Expected results:
Log should look like:
200 200
200 200
Without flushing the layout, new windows appear to initially open at the
size of their opener instead of their intended size.
We can flush the layout from OpenWindowInternal when we have access to
chrome. For remote tabs we can extend the condition for
nsFrameLoader::ForceLayoutIfNecessary to also apply when the pres shell
needs a layout flush.
Updated•3 years ago
|
Comment 2•3 years ago
|
||
I extended the test case a bit to include the view from the content in the new window. And it looks like by the time the content gets to run scripts the layout is reliably already flushed (without any of my changes), e.g. the window appears properly sized to the content in the new window.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 4•3 years ago
|
||
Comment 6•3 years ago
|
||
| bugherder | ||
Description
•