Changeset 248541 in webkit
- Timestamp:
- Aug 12, 2019 12:31:21 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r248540 r248541 1 2019-08-12 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iPadOS] Web pages sometimes load at half width in Safari 4 https://bugs.webkit.org/show_bug.cgi?id=200624 5 <rdar://problem/52694257> 6 7 Reviewed by Simon Fraser. 8 9 Whenever WKWebView's size changes, it normally notifies the web content process by calling into WebPageProxy:: 10 setViewportConfigurationViewLayoutSize, which remembers this view layout size using a member variable, 11 m_viewportConfigurationViewLayoutSize. Later, m_viewportConfigurationViewLayoutSize is consulted as a part of 12 constructing the creation parameters used to set up a new page. 13 14 However, during animated resize, WKWebView avoids these calls to setViewportConfigurationViewLayoutSize via the 15 dynamic viewport update mode check in -[WKWebView _frameOrBoundsChanged]. Instead, the new view layout size is 16 pushed to the web process by calling WebPageProxy::dynamicViewportSizeUpdate. 17 18 Since dynamicViewportSizeUpdate doesn't update m_viewportConfigurationViewLayoutSize, the next 19 WebPageCreationParameters that are created with this WebPageProxy (e.g. after a process swap, or after 20 reloading, if the process was terminated) will use the size of the WKWebView prior to the most recent animated 21 resize. 22 23 To fix the bug, we simply make sure that m_viewportConfigurationViewLayoutSize is updated in the dynamic 24 viewport size update (i.e. animated resize) case as well. 25 26 Test: WebKit.CreateWebPageAfterAnimatedResize 27 28 * UIProcess/ios/WebPageProxyIOS.mm: 29 (WebKit::WebPageProxy::dynamicViewportSizeUpdate): 30 1 31 2019-08-12 Chris Dumez <cdumez@apple.com> 2 32 -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r248502 r248541 301 301 hideValidationMessage(); 302 302 303 m_viewportConfigurationViewLayoutSize = viewLayoutSize; 303 304 m_process->send(Messages::WebPage::DynamicViewportSizeUpdate(viewLayoutSize, 304 305 maximumUnobscuredSize, targetExposedContentRect, targetUnobscuredRect, -
trunk/Tools/ChangeLog
r248531 r248541 1 2019-08-12 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iPadOS] Web pages sometimes load at half width in Safari 4 https://bugs.webkit.org/show_bug.cgi?id=200624 5 <rdar://problem/52694257> 6 7 Reviewed by Simon Fraser. 8 9 Add an API test to verify that after performing an animated resize and killing the web process, the subsequent 10 web page is created using the post-animated-resize web view dimensions, rather than the original layout 11 dimensions. 12 13 * TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm: 14 1 15 2019-08-12 Daniel Bates <dabates@apple.com> 2 16 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm
r242339 r248541 29 29 #import "Test.h" 30 30 #import "TestNavigationDelegate.h" 31 #import "TestWKWebView.h" 31 32 #import <WebKit/WKPreferences.h> 32 33 #import <WebKit/WKProcessPoolPrivate.h> … … 429 430 } 430 431 432 TEST(WebKit, CreateWebPageAfterAnimatedResize) 433 { 434 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)]); 435 [webView synchronouslyLoadTestPageNamed:@"large-red-square-image"]; 436 437 [webView _beginAnimatedResizeWithUpdates:^{ 438 [webView setFrame:CGRectMake(0, 0, 768, 1024)]; 439 }]; 440 441 __block bool doneWaitingForPresentationUpdate = false; 442 [webView _doAfterNextPresentationUpdate:^{ 443 doneWaitingForPresentationUpdate = true; 444 }]; 445 446 [webView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:^{ 447 [webView _endAnimatedResize]; 448 }]; 449 450 TestWebKitAPI::Util::run(&doneWaitingForPresentationUpdate); 451 452 [webView _killWebContentProcessAndResetState]; 453 [webView synchronouslyLoadTestPageNamed:@"large-red-square-image"]; 454 455 NSArray<NSNumber *> *dimensions = [webView objectByEvaluatingJavaScript:@"[innerWidth, innerHeight]"]; 456 EXPECT_EQ(768, dimensions.firstObject.intValue); 457 EXPECT_EQ(1024, dimensions.lastObject.intValue); 458 } 459 431 460 #endif
Note: See TracChangeset
for help on using the changeset viewer.