WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
228115
WKWebView contents is offset at startup (top inset)
https://bugs.webkit.org/show_bug.cgi?id=228115
Summary
WKWebView contents is offset at startup (top inset)
gmorin
Reported
2021-07-20 11:36:50 PDT
Created
attachment 433886
[details]
Two sample projects On app startup, contents loaded in a WKWebView is offset vertically. We’ve found that this behavior only occurs when the following conditions are met: - The window containing the webview is configured to use a Full Size Content View - The window's title bar is not transparent We provide two sample applications which allow reproduction of the bug. - The first one shows the most basic way to reproduce the problem. We could easily use some workarounds to avoid the problem, such as refrain from using safe area guides and adjust the webview’s constraints to prevent the webview from appearing under the toolbar. - The second one shows a more complex example, with a full height sidebar while the webview appears on the content’s side of the SplitView. We've found that the problem seems to come from WebViewImpl, where a top inset is set using the following conditionL: `if ((window.styleMask & NSWindowStyleMaskFullSizeContentView) && !window.titlebarAppearsTransparent && ![m_view enclosingScrollView]) { ... }` Somewhat curious is the fact that slightly moving or resizing the window redraws the webview correctly and removes the inset...
Attachments
Two sample projects
(92.18 KB, application/zip)
2021-07-20 11:36 PDT
,
gmorin
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Smoley
Comment 1
2021-07-22 16:59:14 PDT
Thanks for filing, ccing relevant folks.
Radar WebKit Bug Importer
Comment 2
2021-07-22 16:59:45 PDT
<
rdar://problem/80991170
>
Tim Horton
Comment 3
2021-07-22 18:39:01 PDT
Would be super interested to know if
https://trac.webkit.org/changeset/279708/webkit
fixes this.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug