iOS: Split keyboard should not shrink visualViewport.height
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2019 02:53:27 +0000 (02:53 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2019 02:53:27 +0000 (02:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193798

Reviewed by Tim Horton.

Treat a split keyboard like a floating keyboard and don't consider its input view bounds in computing the visible content rects.

No new tests since while it's possible to transition between split and merged keyboard using some SPI,
there isn't a reliable mechanism to reset the keyboard state. e.g. we need to wait for a hard-coded amount of time.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240466 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/Platform/spi/ios/UIKitSPI.h
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

index 2c13684..3f711ea 100644 (file)
@@ -1,3 +1,19 @@
+2019-01-24  Ryosuke Niwa  <rniwa@webkit.org>
+
+        iOS: Split keyboard should not shrink visualViewport.height
+        https://bugs.webkit.org/show_bug.cgi?id=193798
+
+        Reviewed by Tim Horton.
+
+        Treat a split keyboard like a floating keyboard and don't consider its input view bounds in computing the visible content rects.
+
+        No new tests since while it's possible to transition between split and merged keyboard using some SPI,
+        there isn't a reliable mechanism to reset the keyboard state. e.g. we need to wait for a hard-coded amount of time.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
+
 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
 
         [iOS] Silence MediaPlayer compile warnings
index b5c3e34..d447906 100644 (file)
@@ -297,6 +297,7 @@ typedef enum {
 + (UIPeripheralHost *)activeInstance;
 + (CGRect)visiblePeripheralFrame;
 - (BOOL)isOnScreen;
+- (BOOL)isUndocked;
 - (UIKeyboardRotationState *)rotationState;
 @end
 
index 5f754aa..2a1bb53 100644 (file)
@@ -3175,6 +3175,9 @@ static int32_t activeOrientation(WKWebView *webView)
     else
         _inputViewBounds = [self.window convertRect:CGRectIntersection([endFrameValue CGRectValue], self.window.screen.bounds) fromWindow:nil];
 
+    if ([[UIPeripheralHost sharedInstance] isUndocked])
+        _inputViewBounds = CGRectZero;
+
     if (adjustScrollView) {
         CGFloat bottomInsetBeforeAdjustment = [_scrollView contentInset].bottom;
         SetForScope<BOOL> insetAdjustmentGuard(_currentlyAdjustingScrollViewInsetsForKeyboard, YES);