Title: [216098] trunk/Source/WebKit2
- Revision
- 216098
- Author
- [email protected]
- Date
- 2017-05-02 15:17:27 -0700 (Tue, 02 May 2017)
Log Message
Inform clients when viewport-fit state changes, so they can recompute insets
https://bugs.webkit.org/show_bug.cgi?id=171573
<rdar://problem/31947614>
Reviewed by Simon Fraser.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didChangeAvoidsUnsafeArea]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didChangeAvoidsUnsafeArea):
For clients who use setObscuredInsets/setUnobscuredSafeAreaInsets
themselves, we need to let them know when the current state of
viewport-fit changes so that they can recompute the insets.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (216097 => 216098)
--- trunk/Source/WebKit2/ChangeLog 2017-05-02 22:15:59 UTC (rev 216097)
+++ trunk/Source/WebKit2/ChangeLog 2017-05-02 22:17:27 UTC (rev 216098)
@@ -1,3 +1,21 @@
+2017-05-02 Timothy Horton <[email protected]>
+
+ Inform clients when viewport-fit state changes, so they can recompute insets
+ https://bugs.webkit.org/show_bug.cgi?id=171573
+ <rdar://problem/31947614>
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _didChangeAvoidsUnsafeArea]):
+ * UIProcess/API/Cocoa/WKWebViewInternal.h:
+ * UIProcess/ios/PageClientImplIOS.mm:
+ (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea):
+ For clients who use setObscuredInsets/setUnobscuredSafeAreaInsets
+ themselves, we need to let them know when the current state of
+ viewport-fit changes so that they can recompute the insets.
+
2017-05-02 Gwang Yoon Hwang <[email protected]>
[GTK] Recycle textures while handling tiles
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (216097 => 216098)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h 2017-05-02 22:15:59 UTC (rev 216097)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h 2017-05-02 22:17:27 UTC (rev 216098)
@@ -100,6 +100,7 @@
- (void)_webView:(WKWebView *)webView dataInteraction:(id)interaction session:(id)session didEndWithOperation:(NSUInteger)operation WK_API_AVAILABLE(ios(WK_IOS_TBA));
- (void)_webView:(WKWebView *)webView dataInteractionOperationWasHandled:(BOOL)handled forSession:(id)session itemProviders:(NSArray *)itemProviders WK_API_AVAILABLE(ios(WK_IOS_TBA));
- (NSUInteger)_webView:(WKWebView *)webView willUpdateDataInteractionOperationToOperation:(NSUInteger)operation forSession:(id)session WK_API_AVAILABLE(ios(WK_IOS_TBA));
+- (void)_webView:(WKWebView *)webView didChangeSafeAreaShouldAffectObscuredInsets:(BOOL)safeAreaShouldAffectObscuredInsets WK_API_AVAILABLE(ios(WK_IOS_TBA));
#else
- (NSMenu *)_webView:(WKWebView *)webView contextMenu:(NSMenu *)menu forElement:(_WKContextMenuElementInfo *)element WK_API_AVAILABLE(macosx(10.12));
- (NSMenu *)_webView:(WKWebView *)webView contextMenu:(NSMenu *)menu forElement:(_WKContextMenuElementInfo *)element userInfo:(id <NSSecureCoding>)userInfo WK_API_AVAILABLE(macosx(10.12));
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (216097 => 216098)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2017-05-02 22:15:59 UTC (rev 216097)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2017-05-02 22:17:27 UTC (rev 216098)
@@ -2633,6 +2633,16 @@
#endif
}
+- (void)_didChangeAvoidsUnsafeArea:(BOOL)avoidsUnsafeArea
+{
+ [self _updateScrollViewInsetAdjustmentBehavior];
+ [self _scheduleVisibleContentRectUpdate];
+
+ id <WKUIDelegatePrivate> uiDelegate = (id <WKUIDelegatePrivate>)[self UIDelegate];
+ if ([uiDelegate respondsToSelector:@selector(_webView:didChangeSafeAreaShouldAffectObscuredInsets:)])
+ [uiDelegate _webView:self didChangeSafeAreaShouldAffectObscuredInsets:avoidsUnsafeArea];
+}
+
#endif // PLATFORM(IOS)
#pragma mark OS X-specific methods
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (216097 => 216098)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h 2017-05-02 22:15:59 UTC (rev 216097)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h 2017-05-02 22:17:27 UTC (rev 216098)
@@ -119,7 +119,7 @@
- (void)_showPasswordViewWithDocumentName:(NSString *)documentName passwordHandler:(void (^)(NSString *))passwordHandler;
- (void)_hidePasswordView;
-- (void)_updateScrollViewInsetAdjustmentBehavior;
+- (void)_didChangeAvoidsUnsafeArea:(BOOL)avoidsUnsafeArea;
@property (nonatomic, readonly) WKPasswordView *_passwordView;
Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (216097 => 216098)
--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm 2017-05-02 22:15:59 UTC (rev 216097)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm 2017-05-02 22:17:27 UTC (rev 216098)
@@ -823,8 +823,7 @@
void PageClientImpl::didChangeAvoidsUnsafeArea(bool avoidsUnsafeArea)
{
- [m_webView _updateScrollViewInsetAdjustmentBehavior];
- [m_webView _scheduleVisibleContentRectUpdate];
+ [m_webView _didChangeAvoidsUnsafeArea:avoidsUnsafeArea];
}
} // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes