[Webkit-unassigned] [Bug 228115] New: WKWebView contents is offset at startup

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 20 11:36:50 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=228115

            Bug ID: 228115
           Summary: WKWebView contents is offset at startup
           Product: WebKit
           Version: Safari 14
          Hardware: Mac (Intel)
                OS: macOS 11
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit API
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: gmorin at druide.com

Created attachment 433886

  --> https://bugs.webkit.org/attachment.cgi?id=433886&action=review

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...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210720/e94ad237/attachment.htm>


More information about the webkit-unassigned mailing list