feat: enable innerWidth and innerHeight for window open (#47038)

feat: enable innerWidth and innerHeight for window open (#46749)

* feat: enable innerWidth and innerHeight for window open

* update comment for added special innerWidth and innerHeight

* update 100 min spec requirement handling

* update testing to include getContentSize

* update macOS min requirement handling

* adjust refactored consts

* update const values from nativewindowviews

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
This commit is contained in:
trop[bot] 2025-05-15 12:23:17 -07:00 committed by GitHub
commit 6a0e31633a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 87 additions and 8 deletions

View file

@ -26,7 +26,12 @@ const keysOfTypeNumberCompileTimeCheck: { [K in IntegerBrowserWindowOptionKeys]
};
// Note `top` / `left` are special cases from the browser which we later convert
// to y / x.
const keysOfTypeNumber = new Set(['top', 'left', ...Object.keys(keysOfTypeNumberCompileTimeCheck)]);
// NOTE(@mlaurencin) `innerWidth` / `innerHeight` are also special cases. The spec
// states that `width` and `height` represent the window content size and are equivalent
// to `innerWidth` / `innerHeight`. However, our implementation currently incorrectly maps
// `width` and `height` to `outerWidth` and `outerHeight`, or the size of the window
// with all border and related window chrome.
const keysOfTypeNumber = new Set(['top', 'left', 'innerWidth', 'innerHeight', ...Object.keys(keysOfTypeNumberCompileTimeCheck)]);
/**
* Note that we only allow "0" and "1" boolean conversion when the type is known