Bug 201942 - Eagerly create and add the m_layerHostingView to WKWebView
Summary: Eagerly create and add the m_layerHostingView to WKWebView
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-18 13:40 PDT by Timothy Hatcher
Modified: 2019-09-18 17:07 PDT (History)
4 users (show)

See Also:


Attachments
Patch (4.11 KB, patch)
2019-09-18 13:47 PDT, Timothy Hatcher
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2019-09-18 13:40:35 PDT
Some apps will add subviews to WKWebView, and by the time we add our m_layerHostingView view we might be adding it behind a view that should have been added behind our layer hosting view subview. This recently affected the Spark email app, due to some changes in order of loading delegate calls and when compositing is enabled. From what I can tell we are hitting this now because we sped up loading since Mojave.

We are at the mercy of TiledCoreAnimationDrawingArea’s layer flush runloop observer which, which checks for m_needsSendEnterAcceleratedCompositingMode, before waiting a runloop cycle before triggering the message to the UI process to add the WKFlippedView for m_layerHostingView. The didFinishNavigation delegate call, which adds Spark's subview, seems to be happening reliably sooner than it did in Mojave. WebKit always adds the WKFlippedView behind all subviews, so if Spark's subview is added early, then WKFlippedView will be behind Spark's opaque subview.

<rdar://problem/55312523>
Comment 1 Timothy Hatcher 2019-09-18 13:47:05 PDT
Created attachment 379068 [details]
Patch
Comment 2 WebKit Commit Bot 2019-09-18 17:07:38 PDT
Comment on attachment 379068 [details]
Patch

Clearing flags on attachment: 379068

Committed r250069: <https://trac.webkit.org/changeset/250069>
Comment 3 WebKit Commit Bot 2019-09-18 17:07:40 PDT
All reviewed patches have been landed.  Closing bug.