WebKit Bugzilla
Attachment 369568 Details for
Bug 197777
: Add WKWebViewConfiguration._canShowWhileLocked SPI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197777-20190510105019.patch (text/plain), 17.67 KB, created by
Chris Dumez
on 2019-05-10 10:50:19 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-05-10 10:50:19 PDT
Size:
17.67 KB
patch
obsolete
>Subversion Revision: 245158 >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index 3d9f18293e8209803a6d9751df4eaefd93130efa..97a5000f24c865df0325b86602863f64dc086ed7 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,13 @@ >+2019-05-10 Chris Dumez <cdumez@apple.com> >+ >+ Add WKWebViewConfiguration._canShowWhileLocked SPI >+ https://bugs.webkit.org/show_bug.cgi?id=197777 >+ <rdar://problem/50065100> >+ >+ Reviewed by Tim Horton. >+ >+ * pal/spi/cocoa/QuartzCoreSPI.h: >+ > 2019-05-08 Alex Christensen <achristensen@webkit.org> > > Add SPI to set HSTS storage directory >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 0b1a48cbc7efca67cc27a40e1109535092a1ea95..36e9214eeb6e2c3f28fcc2325245f56de5aebadf 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,40 @@ >+2019-05-10 Chris Dumez <cdumez@apple.com> >+ >+ Add WKWebViewConfiguration._canShowWhileLocked SPI >+ https://bugs.webkit.org/show_bug.cgi?id=197777 >+ <rdar://problem/50065100> >+ >+ Reviewed by Tim Horton. >+ >+ * Platform/mac/LayerHostingContext.h: >+ * Platform/mac/LayerHostingContext.mm: >+ (WebKit::LayerHostingContext::createForExternalHostingProcess): >+ * Shared/WebPageCreationParameters.cpp: >+ (WebKit::WebPageCreationParameters::encode const): >+ (WebKit::WebPageCreationParameters::decode): >+ * Shared/WebPageCreationParameters.h: >+ * UIProcess/API/APIPageConfiguration.cpp: >+ (API::PageConfiguration::copy const): >+ * UIProcess/API/APIPageConfiguration.h: >+ (API::PageConfiguration::canShowWhileLocked const): >+ (API::PageConfiguration::setCanShowWhileLocked): >+ * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: >+ (-[WKWebViewConfiguration _setCanShowWhileLocked:]): >+ (-[WKWebViewConfiguration _canShowWhileLocked]): >+ * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::creationParameters): >+ * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm: >+ (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom): >+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h: >+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: >+ (WebKit::RemoteLayerTreeContext::canShowWhileLocked const): >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::m_canShowWhileLocked): >+ (WebKit::m_shrinkToFitContentTimer): Deleted. >+ * WebProcess/WebPage/WebPage.h: >+ (WebKit::WebPage::canShowWhileLocked const): >+ > 2019-05-09 Daniel Bates <dabates@apple.com> > > [iOS] Lazily request keyboard on first hardware keydown when a non-editable element is focused >diff --git a/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h b/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h >index 3d4341e18da4d0051df03552e038cc9e2a98343b..2bd52ded1b4ed5db82bf72379fc806b9bdab0465 100644 >--- a/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h >+++ b/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h >@@ -238,6 +238,7 @@ extern NSString * const kCAContextIgnoresHitTest; > extern NSString * const kCAContextPortNumber; > > #if PLATFORM(IOS_FAMILY) >+extern NSString * const kCAContextSecure; > extern NSString * const kCAContentsFormatRGBA10XR; > #endif > >diff --git a/Source/WebKit/Platform/mac/LayerHostingContext.h b/Source/WebKit/Platform/mac/LayerHostingContext.h >index 5797793e7b75953d6c71052fa817c3fe3cfc69d4..99cadfe6db16fcc943a8f192e5d01ff8c014768e 100644 >--- a/Source/WebKit/Platform/mac/LayerHostingContext.h >+++ b/Source/WebKit/Platform/mac/LayerHostingContext.h >@@ -40,17 +40,26 @@ class MachSendRight; > namespace WebKit { > > using LayerHostingContextID = uint32_t; >+ >+struct LayerHostingContextOptions { >+#if PLATFORM(IOS_FAMILY) >+ bool canShowWhileLocked { false }; >+#endif >+}; > > class LayerHostingContext { > WTF_MAKE_NONCOPYABLE(LayerHostingContext); WTF_MAKE_FAST_ALLOCATED; > public: > static std::unique_ptr<LayerHostingContext> createForPort(const WTF::MachSendRight& serverPort); >+ > #if HAVE(OUT_OF_PROCESS_LAYER_HOSTING) >- static std::unique_ptr<LayerHostingContext> createForExternalHostingProcess(); >+ static std::unique_ptr<LayerHostingContext> createForExternalHostingProcess(const LayerHostingContextOptions& = { }); >+ > #if PLATFORM(MAC) > static std::unique_ptr<LayerHostingContext> createForExternalPluginHostingProcess(); > #endif >-#endif >+ >+#endif // HAVE(OUT_OF_PROCESS_LAYER_HOSTING) > > LayerHostingContext(); > ~LayerHostingContext(); >diff --git a/Source/WebKit/Platform/mac/LayerHostingContext.mm b/Source/WebKit/Platform/mac/LayerHostingContext.mm >index 910bb3fd8b8b49852e48ead22c259301ff966d83..f4633b4c5b00c2ae0aff796f7f599e2709148ff7 100644 >--- a/Source/WebKit/Platform/mac/LayerHostingContext.mm >+++ b/Source/WebKit/Platform/mac/LayerHostingContext.mm >@@ -50,7 +50,7 @@ std::unique_ptr<LayerHostingContext> LayerHostingContext::createForPort(const Ma > } > > #if HAVE(OUT_OF_PROCESS_LAYER_HOSTING) >-std::unique_ptr<LayerHostingContext> LayerHostingContext::createForExternalHostingProcess() >+std::unique_ptr<LayerHostingContext> LayerHostingContext::createForExternalHostingProcess(const LayerHostingContextOptions& options) > { > auto layerHostingContext = std::make_unique<LayerHostingContext>(); > layerHostingContext->m_layerHostingMode = LayerHostingMode::OutOfProcess; >@@ -59,6 +59,7 @@ std::unique_ptr<LayerHostingContext> LayerHostingContext::createForExternalHosti > // Use a very large display ID to ensure that the context is never put on-screen > // without being explicitly parented. See <rdar://problem/16089267> for details. > layerHostingContext->m_context = [CAContext remoteContextWithOptions:@{ >+ kCAContextSecure: @(options.canShowWhileLocked), > #if HAVE(CORE_ANIMATION_RENDER_SERVER) > kCAContextIgnoresHitTest : @YES, > kCAContextDisplayId : @10000 >@@ -66,9 +67,13 @@ std::unique_ptr<LayerHostingContext> LayerHostingContext::createForExternalHosti > }]; > #elif !PLATFORM(IOSMAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) > [CAContext setAllowsCGSConnections:NO]; >- layerHostingContext->m_context = [CAContext remoteContextWithOptions:@{kCAContextCIFilterBehavior : @"ignore"}]; >+ layerHostingContext->m_context = [CAContext remoteContextWithOptions:@{ >+ kCAContextCIFilterBehavior : @"ignore", >+ }]; > #else >- layerHostingContext->m_context = [CAContext contextWithCGSConnection:CGSMainConnectionID() options:@{ kCAContextCIFilterBehavior : @"ignore" }]; >+ layerHostingContext->m_context = [CAContext contextWithCGSConnection:CGSMainConnectionID() options:@{ >+ kCAContextCIFilterBehavior : @"ignore", >+ }]; > #endif > > return layerHostingContext; >diff --git a/Source/WebKit/Shared/WebPageCreationParameters.cpp b/Source/WebKit/Shared/WebPageCreationParameters.cpp >index bd9db403b39a5ad6f76cf6360971407b3cc96dd8..89f535d4e299244dca6bbee7c102d6ea39fa42a6 100644 >--- a/Source/WebKit/Shared/WebPageCreationParameters.cpp >+++ b/Source/WebKit/Shared/WebPageCreationParameters.cpp >@@ -96,6 +96,7 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const > encoder << maximumUnobscuredSize; > encoder << deviceOrientation; > encoder << keyboardIsAttached; >+ encoder << canShowWhileLocked; > encoder << overrideViewportArguments; > #endif > #if PLATFORM(COCOA) >@@ -283,6 +284,8 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod > return WTF::nullopt; > if (!decoder.decode(parameters.keyboardIsAttached)) > return WTF::nullopt; >+ if (!decoder.decode(parameters.canShowWhileLocked)) >+ return WTF::nullopt; > > Optional<Optional<WebCore::ViewportArguments>> overrideViewportArguments; > decoder >> overrideViewportArguments; >diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h >index 0243bd1cbacc59f286052e98e867e6a332df12e5..43af461a730c79c563d38f1e6962033995f04e26 100644 >--- a/Source/WebKit/Shared/WebPageCreationParameters.h >+++ b/Source/WebKit/Shared/WebPageCreationParameters.h >@@ -155,6 +155,7 @@ struct WebPageCreationParameters { > WebCore::FloatSize maximumUnobscuredSize; > int32_t deviceOrientation { 0 }; > bool keyboardIsAttached { false }; >+ bool canShowWhileLocked { false }; > Optional<WebCore::ViewportArguments> overrideViewportArguments; > #endif > #if PLATFORM(COCOA) >diff --git a/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp b/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp >index 177b99988402e3ceb9615c93cd1ae33d859fa3e5..eb9f13e50aa4bde086836e3c89509c348719d7dc 100644 >--- a/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp >+++ b/Source/WebKit/UIProcess/API/APIPageConfiguration.cpp >@@ -72,6 +72,7 @@ Ref<PageConfiguration> PageConfiguration::copy() const > copy->m_treatsSHA1SignedCertificatesAsInsecure = this->m_treatsSHA1SignedCertificatesAsInsecure; > #if PLATFORM(IOS_FAMILY) > copy->m_alwaysRunsAtForegroundPriority = this->m_alwaysRunsAtForegroundPriority; >+ copy->m_canShowWhileLocked = this->m_canShowWhileLocked; > #endif > copy->m_initialCapitalizationEnabled = this->m_initialCapitalizationEnabled; > copy->m_waitsForPaintAfterViewDidMoveToWindow = this->m_waitsForPaintAfterViewDidMoveToWindow; >diff --git a/Source/WebKit/UIProcess/API/APIPageConfiguration.h b/Source/WebKit/UIProcess/API/APIPageConfiguration.h >index 64a494a19b331a39a322205245bfae91f9e68442..0c51afdc005f9fa8656e62fe7340d80829ce7e28 100644 >--- a/Source/WebKit/UIProcess/API/APIPageConfiguration.h >+++ b/Source/WebKit/UIProcess/API/APIPageConfiguration.h >@@ -94,7 +94,10 @@ public: > > #if PLATFORM(IOS_FAMILY) > bool alwaysRunsAtForegroundPriority() { return m_alwaysRunsAtForegroundPriority; } >- void setAlwaysRunsAtForegroundPriority(bool alwaysRunsAtForegroundPriority) { m_alwaysRunsAtForegroundPriority = alwaysRunsAtForegroundPriority; } >+ void setAlwaysRunsAtForegroundPriority(bool alwaysRunsAtForegroundPriority) { m_alwaysRunsAtForegroundPriority = alwaysRunsAtForegroundPriority; } >+ >+ bool canShowWhileLocked() const { return m_canShowWhileLocked; } >+ void setCanShowWhileLocked(bool canShowWhileLocked) { m_canShowWhileLocked = canShowWhileLocked; } > #endif > bool initialCapitalizationEnabled() { return m_initialCapitalizationEnabled; } > void setInitialCapitalizationEnabled(bool initialCapitalizationEnabled) { m_initialCapitalizationEnabled = initialCapitalizationEnabled; } >@@ -147,6 +150,7 @@ private: > bool m_treatsSHA1SignedCertificatesAsInsecure { true }; > #if PLATFORM(IOS_FAMILY) > bool m_alwaysRunsAtForegroundPriority { false }; >+ bool m_canShowWhileLocked { false }; > #endif > bool m_initialCapitalizationEnabled { true }; > bool m_waitsForPaintAfterViewDidMoveToWindow { true }; >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm >index 7e8916a0a04ffde3078a6892c7a3be24c3133ae8..636eb6e84b920460d7913d3a40d376e1aaeea1fe 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm >@@ -771,6 +771,16 @@ - (void)_setShouldDecidePolicyBeforeLoadingQuickLookPreview:(BOOL)shouldDecide > _shouldDecidePolicyBeforeLoadingQuickLookPreview = shouldDecide; > } > >+- (void)_setCanShowWhileLocked:(BOOL)value >+{ >+ _pageConfiguration->setCanShowWhileLocked(value); >+} >+ >+- (BOOL)_canShowWhileLocked >+{ >+ return _pageConfiguration->canShowWhileLocked(); >+} >+ > #endif // PLATFORM(IOS_FAMILY) > > - (BOOL)_invisibleAutoplayNotPermitted >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h >index 78027fd9f0721dfe14277f114130670d145c3666..8cbe0a4daa73185bd3ec205e588731abea4c534d 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h >@@ -83,6 +83,7 @@ typedef NS_ENUM(NSUInteger, _WKDragLiftDelay) { > @property (nonatomic, setter=_setLongPressActionsEnabled:) BOOL _longPressActionsEnabled WK_API_AVAILABLE(ios(12.0)); > @property (nonatomic, setter=_setSystemPreviewEnabled:) BOOL _systemPreviewEnabled WK_API_AVAILABLE(ios(12.0)); > @property (nonatomic, setter=_setShouldDecidePolicyBeforeLoadingQuickLookPreview:) BOOL _shouldDecidePolicyBeforeLoadingQuickLookPreview WK_API_AVAILABLE(ios(WK_IOS_TBA)); >+@property (nonatomic, setter=_setCanShowWhileLocked:) BOOL _canShowWhileLocked WK_API_AVAILABLE(ios(WK_IOS_TBA)); > #else > @property (nonatomic, setter=_setShowsURLsInToolTips:) BOOL _showsURLsInToolTips WK_API_AVAILABLE(macos(10.12)); > @property (nonatomic, setter=_setServiceControlsEnabled:) BOOL _serviceControlsEnabled WK_API_AVAILABLE(macos(10.12)); >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index a8ab15e7550c4eb095b254b16094edd45f32d570..1ac051df633f1a53b89532de7ad89e0841b0899f 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -7126,6 +7126,7 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc > parameters.deviceOrientation = m_deviceOrientation; > parameters.keyboardIsAttached = isInHardwareKeyboardMode(); > parameters.overrideViewportArguments = m_overrideViewportArguments; >+ parameters.canShowWhileLocked = m_configuration->canShowWhileLocked(); > #endif > > #if PLATFORM(MAC) >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm >index 52a9bd4dcc91758cdf000dbc0b4de727ac856cd8..a9b4faa6080f7ab20bc3ec02261b203306a44046 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm >@@ -59,7 +59,11 @@ PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom(LayerType layerType, Pl > break; > #if HAVE(OUT_OF_PROCESS_LAYER_HOSTING) > case LayerHostingMode::OutOfProcess: >- m_layerHostingContext = LayerHostingContext::createForExternalHostingProcess(); >+ m_layerHostingContext = LayerHostingContext::createForExternalHostingProcess({ >+#if PLATFORM(IOS_FAMILY) >+ context.canShowWhileLocked() >+#endif >+ }); > #if PLATFORM(IOS_FAMILY) > if (layerType == LayerTypeAVPlayerLayer) { > float scaleFactor = context.deviceScaleFactor(); >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h >index d408057876372503b64527f36dacc80bb203e773..57a0259b22596001503f646b7bf75498994bf9e8 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h >@@ -77,6 +77,10 @@ public: > bool nextFlushIsForImmediatePaint() const { return m_nextFlushIsForImmediatePaint; } > > void adoptLayersFromContext(RemoteLayerTreeContext&); >+ >+#if PLATFORM(IOS_FAMILY) >+ bool canShowWhileLocked() const; >+#endif > > private: > // WebCore::GraphicsLayerFactory >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm >index 68b157a9d057ffe2847a56e65fa26db7e468db0d..f425d1161935f403c0c1a4b6aaea7d5d83575905 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm >@@ -78,6 +78,13 @@ LayerHostingMode RemoteLayerTreeContext::layerHostingMode() const > return m_webPage.layerHostingMode(); > } > >+#if PLATFORM(IOS_FAMILY) >+bool RemoteLayerTreeContext::canShowWhileLocked() const >+{ >+ return m_webPage.canShowWhileLocked(); >+} >+#endif >+ > void RemoteLayerTreeContext::layerDidEnterContext(PlatformCALayerRemote& layer, PlatformCALayer::LayerType type) > { > GraphicsLayer::PlatformLayerID layerID = layer.layerID(); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 944bea5404669dbbed857dae48de789eaf0c0107..843a890348ad39ab8751cc4d8204f9dee47fb2e0 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -414,6 +414,7 @@ WebPage::WebPage(uint64_t pageID, WebPageCreationParameters&& parameters) > , m_overrideScreenSize(parameters.overrideScreenSize) > , m_deviceOrientation(parameters.deviceOrientation) > , m_keyboardIsAttached(parameters.keyboardIsAttached) >+ , m_canShowWhileLocked(parameters.canShowWhileLocked) > #endif > , m_layerVolatilityTimer(*this, &WebPage::layerVolatilityTimerFired) > , m_activityState(parameters.activityState) >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index c29645d0c6174491070e39949845224df5fcfe6a..a38eb8ba1de101f8fbf32ebb24e36bd72edb3c9d 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -958,6 +958,8 @@ public: > void hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached); > > void updateStringForFind(const String&); >+ >+ bool canShowWhileLocked() const { return m_canShowWhileLocked; } > #endif > > #if ENABLE(IOS_TOUCH_EVENTS) >@@ -1829,6 +1831,7 @@ private: > WebCore::FloatSize m_maximumUnobscuredSize; > int32_t m_deviceOrientation { 0 }; > bool m_keyboardIsAttached { false }; >+ bool m_canShowWhileLocked { false }; > bool m_inDynamicSizeUpdate { false }; > HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory; > RefPtr<WebCore::Node> m_pendingSyntheticClickNode;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197777
:
369552
|
369555
| 369568