window.outerWidth/Height are 16px less than should be when in fullscreen mode (using F11-key)
Reported by
vanheems...@gmail.com,
May 16 2018
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36 Steps to reproduce the problem: 1. Maximize your browser window 2. Type `window.outerWidth` in the console 3. Press F11 (go to Fullscreen mode) 4. Repeat step 2 What is the expected behavior? Step 2 and 4 should give you the maximum width of your screen (and the same value both times). What went wrong? The returned window.outerWidth (and window.outerHeight as well) values are 16 pixels less than what it should be when in fullscreen mode. Did this work before? N/A Chrome version: 66.0.3359.139 Channel: n/a OS Version: 10.0 Flash Version: Shockwave Flash 29.0 r0 For live feedback on the dimensions, visit http://ryanve.com/lab/dimensions/ and switch to/from fullscreen mode to see the outerWidth/Height values change.
,
May 16 2018
,
May 16 2018
,
May 16 2018
Able to reproduce the issue on Win-10 using chrome reported version #66.0.3359.139 and latest canary #68.0.3431.0. This is a non-regression issue as it is observed from M60 old builds. Issue is not reproducible in OS-mac and OS-linux i.e window.outerWidth/Height is more than 16px than should be when in fullscreen mode (using F11-key). Hence, marking it as untriaged to get more inputs from dev team. Thanks...!!
,
May 16 2018
Confirmed, seems limited to windows. I'm guessing we incorrectly subtract the scrollbar width in fullscreen (but not in regular mode). This is quite odd. szager, any idea why this might be?
,
May 16 2018
If it was 15px, I would guess scrollbar; but because it's 16px, I wonder if it has something to do with body padding?
,
May 16 2018
It's happens with the height as well (same 16px).
,
May 16 2018
The observed 16px difference is produced by the default 8px border of the window. My desktop theme has a smaller 4px border, which explains why I see 8px difference.
,
May 16 2018
In my situation (Win10) I have:
- no borders (only tabs and address bar at the top in maximized mode and nothing in fullscreen mode of course)
- no scrollbars visible (empty page with CSS: *{margin:0;padding:0;} )
- screen resolution = 1920x1080 (standard laptop screen)
- screen.width & .height are 1920 and 1080
Normal mode with maximized window:
- window.outerWidth == 1920
- window.outerHeight == 1040
After entering fullscreen mode with [F11]:
- window.outerWidth == 1904
- window.outerHeight == 1064
,
May 16 2018
The bug doesn't need the window borders to be actually visible. Chrome (or OS) just blindly subtracts their width which is 2*GetSystemMetrics(SM_CXPADDEDBORDER) In Windows 10 it can be changed via PaddedBorderWidth in the registry AFAIK. In Windows 7 it's relatively easy to change as "Active window border" in the legacy desktop control panel. When I change it, the outerWidth gap changes accordingly and matches the above formula. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by woxxom@gmail.com
, May 16 2018563 bytes
563 bytes View Download