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

UNCONFIRMED
Unassigned

Status

()

Core
DOM: CSS Object Model
UNCONFIRMED
5 years ago
a year ago

People

(Reporter: Georg Koppen, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(1 attachment)

1.74 KB, application/x-xpinstall
Details
(Reporter)

Description

5 years ago
Created attachment 747399 [details]
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.

Updated

5 years ago
Component: DOM: Core & HTML → DOM: CSS Object Model
(Reporter)

Updated

5 years ago
Attachment #747399 - Attachment mime type: application/octet-stream → application/x-xpinstall
(Reporter)

Updated

5 years ago
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?
(Reporter)

Comment 2

5 years ago
(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: 1260929
Whiteboard: [tor] → [tor][tor-standalone]
You need to log in before you can comment on or make changes to this bug.