Title: [250096] branches/safari-608.2.11.1-branch/Source/WebKit
- Revision
- 250096
- Author
- [email protected]
- Date
- 2019-09-19 11:04:21 -0700 (Thu, 19 Sep 2019)
Log Message
Cherry-pick r250069. rdar://problem/55524978
Eagerly create and add the m_layerHostingView to WKWebView.
https://bugs.webkit.org/show_bug.cgi?id=201942
Reviewed by Tim Horton.
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 affected
the Spark email app, due to changes in order of loading delegate calls and when compositing is enabled.
Instead of delayed creation of m_layerHostingView, always create it and add it to to the WKWebView.
This ensures proper ordering of subviews when clients add a view behind all existing subviews.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl): Create and add m_layerHostingView here.
(WebKit::WebViewImpl::setAcceleratedCompositingRootLayer): Remove creation and removal of m_layerHostingView.
Just set the sublayers of m_layerHostingView's layer here.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-608.2.11.1-branch/Source/WebKit/ChangeLog (250095 => 250096)
--- branches/safari-608.2.11.1-branch/Source/WebKit/ChangeLog 2019-09-19 18:01:55 UTC (rev 250095)
+++ branches/safari-608.2.11.1-branch/Source/WebKit/ChangeLog 2019-09-19 18:04:21 UTC (rev 250096)
@@ -1,3 +1,44 @@
+2019-09-19 Kocsen Chung <[email protected]>
+
+ Cherry-pick r250069. rdar://problem/55524978
+
+ Eagerly create and add the m_layerHostingView to WKWebView.
+ https://bugs.webkit.org/show_bug.cgi?id=201942
+
+ Reviewed by Tim Horton.
+
+ 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 affected
+ the Spark email app, due to changes in order of loading delegate calls and when compositing is enabled.
+ Instead of delayed creation of m_layerHostingView, always create it and add it to to the WKWebView.
+ This ensures proper ordering of subviews when clients add a view behind all existing subviews.
+
+ * UIProcess/Cocoa/WebViewImpl.mm:
+ (WebKit::WebViewImpl::WebViewImpl): Create and add m_layerHostingView here.
+ (WebKit::WebViewImpl::setAcceleratedCompositingRootLayer): Remove creation and removal of m_layerHostingView.
+ Just set the sublayers of m_layerHostingView's layer here.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-09-18 Timothy Hatcher <[email protected]>
+
+ Eagerly create and add the m_layerHostingView to WKWebView.
+ https://bugs.webkit.org/show_bug.cgi?id=201942
+
+ Reviewed by Tim Horton.
+
+ 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 affected
+ the Spark email app, due to changes in order of loading delegate calls and when compositing is enabled.
+ Instead of delayed creation of m_layerHostingView, always create it and add it to to the WKWebView.
+ This ensures proper ordering of subviews when clients add a view behind all existing subviews.
+
+ * UIProcess/Cocoa/WebViewImpl.mm:
+ (WebKit::WebViewImpl::WebViewImpl): Create and add m_layerHostingView here.
+ (WebKit::WebViewImpl::setAcceleratedCompositingRootLayer): Remove creation and removal of m_layerHostingView.
+ Just set the sublayers of m_layerHostingView's layer here.
+
2019-09-11 Alan Coon <[email protected]>
Apply patch. rdar://problem/55240886
Modified: branches/safari-608.2.11.1-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (250095 => 250096)
--- branches/safari-608.2.11.1-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2019-09-19 18:01:55 UTC (rev 250095)
+++ branches/safari-608.2.11.1-branch/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2019-09-19 18:04:21 UTC (rev 250096)
@@ -1351,6 +1351,22 @@
[view addTrackingArea:m_primaryTrackingArea.get()];
+ // Create an NSView that will host our layer tree.
+ m_layerHostingView = adoptNS([[WKFlippedView alloc] initWithFrame:[m_view bounds]]);
+ [m_layerHostingView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
+
+ [view addSubview:m_layerHostingView.get() positioned:NSWindowBelow relativeTo:nil];
+
+ // Create a root layer that will back the NSView.
+ RetainPtr<CALayer> layer = adoptNS([[CALayer alloc] init]);
+ [layer setDelegate:[WebActionDisablingCALayerDelegate shared]];
+#ifndef NDEBUG
+ [layer setName:@"Hosting root layer"];
+#endif
+
+ [m_layerHostingView setLayer:layer.get()];
+ [m_layerHostingView setWantsLayer:YES];
+
m_page->setIntrinsicDeviceScaleFactor(intrinsicDeviceScaleFactor());
if (Class gestureClass = NSClassFromString(@"NSImmediateActionGestureRecognizer")) {
@@ -3765,34 +3781,8 @@
[CATransaction begin];
[CATransaction setDisableActions:YES];
- if (rootLayer) {
- if (!m_layerHostingView) {
- // Create an NSView that will host our layer tree.
- m_layerHostingView = adoptNS([[WKFlippedView alloc] initWithFrame:[m_view bounds]]);
- [m_layerHostingView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
+ [m_layerHostingView layer].sublayers = rootLayer ? @[ rootLayer ] : nil;
- [m_view addSubview:m_layerHostingView.get() positioned:NSWindowBelow relativeTo:nil];
-
- // Create a root layer that will back the NSView.
- RetainPtr<CALayer> layer = adoptNS([[CALayer alloc] init]);
- [layer setDelegate:[WebActionDisablingCALayerDelegate shared]];
-#ifndef NDEBUG
- [layer setName:@"Hosting root layer"];
-#endif
-
- [m_layerHostingView setLayer:layer.get()];
- [m_layerHostingView setWantsLayer:YES];
- }
-
- [m_layerHostingView layer].sublayers = [NSArray arrayWithObject:rootLayer];
- } else if (m_layerHostingView) {
- [m_layerHostingView removeFromSuperview];
- [m_layerHostingView setLayer:nil];
- [m_layerHostingView setWantsLayer:NO];
-
- m_layerHostingView = nullptr;
- }
-
[CATransaction commit];
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes