Title: [248281] trunk
Revision
248281
Author
[email protected]
Date
2019-08-05 17:31:57 -0700 (Mon, 05 Aug 2019)

Log Message

iOS 13: Overflow:hidden on body prevents PDF scroll
https://bugs.webkit.org/show_bug.cgi?id=200435
rdar://problem/53942888

Reviewed by Tim Horton.
Source/WebKit:

When we navigate from an overflow:hidden HTML page to a custom view (like PDF), we need
to make sure that the scroll view is scrollable.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setHasCustomContentView:loadedMIMEType:]):

Tools:

When we navigate from an overflow:hidden HTML page to a custom view (like PDF), we need
to make sure that the scroll view is scrollable.

* TestWebKitAPI/Tests/ios/ScrollViewScrollabilityTests.mm:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (248280 => 248281)


--- trunk/Source/WebKit/ChangeLog	2019-08-06 00:03:34 UTC (rev 248280)
+++ trunk/Source/WebKit/ChangeLog	2019-08-06 00:31:57 UTC (rev 248281)
@@ -1,3 +1,17 @@
+2019-08-05  Simon Fraser  <[email protected]>
+
+        iOS 13: Overflow:hidden on body prevents PDF scroll
+        https://bugs.webkit.org/show_bug.cgi?id=200435
+        rdar://problem/53942888
+
+        Reviewed by Tim Horton.
+
+        When we navigate from an overflow:hidden HTML page to a custom view (like PDF), we need
+        to make sure that the scroll view is scrollable.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
+
 2019-08-05  John Wilander  <[email protected]>
 
         Resource Load Statistics: Re-introduce latch mode for subresource cookie blocking

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (248280 => 248281)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-08-06 00:03:34 UTC (rev 248280)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-08-06 00:31:57 UTC (rev 248281)
@@ -1630,6 +1630,7 @@
 
         _scrollViewBackgroundColor = WebCore::Color();
         [_scrollView setContentOffset:[self _initialContentOffsetForScrollView]];
+        [_scrollView _setScrollEnabledInternal:YES];
 
         [self _setAvoidsUnsafeArea:NO];
     } else if (_customContentView) {

Modified: trunk/Tools/ChangeLog (248280 => 248281)


--- trunk/Tools/ChangeLog	2019-08-06 00:03:34 UTC (rev 248280)
+++ trunk/Tools/ChangeLog	2019-08-06 00:31:57 UTC (rev 248281)
@@ -1,3 +1,17 @@
+2019-08-05  Simon Fraser  <[email protected]>
+
+        iOS 13: Overflow:hidden on body prevents PDF scroll
+        https://bugs.webkit.org/show_bug.cgi?id=200435
+        rdar://problem/53942888
+
+        Reviewed by Tim Horton.
+    
+        When we navigate from an overflow:hidden HTML page to a custom view (like PDF), we need
+        to make sure that the scroll view is scrollable.
+
+        * TestWebKitAPI/Tests/ios/ScrollViewScrollabilityTests.mm:
+        (TestWebKitAPI::TEST):
+
 2019-08-05  Aakash Jain  <[email protected]>
 
         New EWS:mac-wk2 status-bubble shows waiting to run tests for all recent bugs

Modified: trunk/Tools/TestWebKitAPI/Tests/ios/ScrollViewScrollabilityTests.mm (248280 => 248281)


--- trunk/Tools/TestWebKitAPI/Tests/ios/ScrollViewScrollabilityTests.mm	2019-08-06 00:03:34 UTC (rev 248280)
+++ trunk/Tools/TestWebKitAPI/Tests/ios/ScrollViewScrollabilityTests.mm	2019-08-06 00:31:57 UTC (rev 248281)
@@ -29,6 +29,7 @@
 
 #import "PlatformUtilities.h"
 #import "TestInputDelegate.h"
+#import "TestNavigationDelegate.h"
 #import "TestWKWebView.h"
 #import <UIKit/UIKit.h>
 #import <WebKit/WKWebViewPrivate.h>
@@ -137,6 +138,22 @@
     EXPECT_EQ([[webView scrollView] isScrollEnabled], YES);
 }
 
+TEST(ScrollViewScrollabilityTests, ScrollableAfterNavigateToPDF)
+{
+    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, viewHeight, 414)]);
+
+    [webView synchronouslyLoadHTMLString:nonScrollableDocumentMarkup];
+    [webView waitForNextPresentationUpdate];
+    EXPECT_EQ([[webView scrollView] isScrollEnabled], NO);
+
+    NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"test" withExtension:@"pdf" subdirectory:@"TestWebKitAPI.resources"]];
+    [webView loadRequest:request];
+
+    [webView _test_waitForDidFinishNavigation];
+
+    EXPECT_EQ([[webView scrollView] isScrollEnabled], YES);
+}
+
 } // namespace TestWebKitAPI
 
 #endif // PLATFORM(IOS_FAMILY)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to