Closed Bug 870346 Opened 11 years ago Closed 6 years ago

innerHeight of content window is not properly resized from extensions on startup

Categories

(Core :: DOM: CSS Object Model, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1330882

People

(Reporter: gk, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [tor][tor-standalone])

Attachments

(1 file)

Attached file innerwidthheight.xpi
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0

Steps to reproduce:

I resized the content window with an extension (a test extension is attached)


Actual results:

The extension output shows that the content window is correctly resized (to 1100x900) but a test website (e.g. http://mpulp.mobi/labs/ppk/widthtest.html) does not confirm this. Rather, there the height is just 874 on my Linux box. Similar things happen on Windows and OS X although the height of the resized content window differs slightly.


Expected results:

The content window should have been resized to 1100x900.
Component: DOM: Core & HTML → DOM: CSS Object Model
Attachment #747399 - Attachment mime type: application/octet-stream → application/x-xpinstall
OS: Windows 7 → All
Setting innerHeight depends on knowing the height of our chrome, since we have to tell the OS the _outer_ window height.

Therefore, setting it at any point before we know what the layout of our chrome looks like will fail, obviously.

The attached extension will race with things that modify the layout of the chrome from onload, which I assume are not exactly rare, so I don't see how it could possibly work in general.

Does doing the size sets from a setTimeout(0) that's set from onload do the right thing?
(In reply to Boris Zbarsky (:bz) from comment #1)
> Setting innerHeight depends on knowing the height of our chrome, since we
> have to tell the OS the _outer_ window height.
> 
> Therefore, setting it at any point before we know what the layout of our
> chrome looks like will fail, obviously.
> 
> The attached extension will race with things that modify the layout of the
> chrome from onload, which I assume are not exactly rare, so I don't see how
> it could possibly work in general.
> 
> Does doing the size sets from a setTimeout(0) that's set from onload do the
> right thing?

Well, the problem with this approach is that the resizing is always visible which might be kind of annoying to users. What I am looking for is to get the window properly resized before it is visible. So far I failed to find a notification/event triggered between having the outer window height ready and making the window visible to the user...
Whiteboard: [tor]
Blocks: meta_tor
Whiteboard: [tor] → [tor][tor-standalone]
Flags: needinfo?(arthuredelstein)
Georg agrees we can close this as a duplicate of bug 1330882.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Flags: needinfo?(arthuredelstein)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: