Changeset 245561 in webkit
- Timestamp:
- May 20, 2019, 10:01:54 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245538 r245561 1 2019-05-20 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Layout viewport size on google.com increases after rotating to landscape and back 4 https://bugs.webkit.org/show_bug.cgi?id=198062 5 <rdar://problem/50547895> 6 7 Reviewed by Maciej Stachowiak. 8 9 Add a UIHelper method to simulate device rotation to a given orientation, and use it in a new layout test that 10 simulates rotation to and from landscape orientation, and verifies that the initial scale did not change from 11 its expected value of 1. 12 13 * fast/events/ios/rotation/do-not-shrink-to-fit-content-after-rotation-expected.txt: Added. 14 * fast/events/ios/rotation/do-not-shrink-to-fit-content-after-rotation.html: Added. 15 * resources/ui-helper.js: 16 (window.UIHelper.rotateDevice.return.new.Promise.): 17 (window.UIHelper.rotateDevice): 18 (window.UIHelper): 19 1 20 2019-05-20 Chris Dumez <cdumez@apple.com> 2 21 -
trunk/LayoutTests/resources/ui-helper.js
r245285 r245561 907 907 }); 908 908 } 909 910 static rotateDevice(orientationName, animatedResize = false) 911 { 912 if (!this.isWebKit2() || !this.isIOS()) 913 return Promise.resolve(); 914 915 return new Promise(resolve => { 916 testRunner.runUIScript(`(() => { 917 uiController.${animatedResize ? "simulateRotationLikeSafari" : "simulateRotation"}("${orientationName}", function() { 918 uiController.doAfterVisibleContentRectUpdate(() => uiController.uiScriptComplete()); 919 }); 920 })()`, resolve); 921 }); 922 } 909 923 } -
trunk/Source/WebKit/ChangeLog
r245543 r245561 1 2019-05-20 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Layout viewport size on google.com increases after rotating to landscape and back 4 https://bugs.webkit.org/show_bug.cgi?id=198062 5 <rdar://problem/50547895> 6 7 Reviewed by Maciej Stachowiak. 8 9 During an animated resize (e.g. when rotating the device on iOS), we currently immediately trigger the new 10 shrink-to-fit content size heuristic in the middle of dynamicViewportSizeUpdate, after the new view layout size 11 has been applied to the viewport configuration but before we've issued a resize event to the page. 12 13 Thus, on pages that use listen to the resize event and adjust their content accordingly to fit within the new 14 layout width, we prematurely declare that the page has horizontally overflowed, and try to lay out at a larger 15 width and scale down. This causes the page to unnecessarily shrink after rotating to landscale orientation and 16 back. 17 18 To fix this, we simply move the call to shrink-to-fit-content to the end of the dynamic viewport size update, 19 such that the page has had a chance to adjust to the new layout size. 20 21 Test: fast/events/ios/rotation/do-not-shrink-to-fit-content-after-rotation.html 22 23 * WebProcess/WebPage/ios/WebPageIOS.mm: 24 (WebKit::WebPage::dynamicViewportSizeUpdate): 25 1 26 2019-05-20 Ross Kirsling <ross.kirsling@sony.com> 2 27 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r245543 r245561 3003 3003 viewportConfigurationChanged(); 3004 3004 3005 #if ENABLE(VIEWPORT_RESIZING)3006 if (immediatelyShrinkToFitContent())3007 viewportConfigurationChanged();3008 #endif3009 3010 3005 IntSize newLayoutSize = m_viewportConfiguration.layoutSize(); 3011 3006 … … 3139 3134 frameView.setScrollOffset(roundedUnobscuredContentRectPosition); 3140 3135 3136 #if ENABLE(VIEWPORT_RESIZING) 3137 if (immediatelyShrinkToFitContent()) 3138 viewportConfigurationChanged(); 3139 #endif 3140 3141 3141 m_drawingArea->scheduleCompositingLayerFlush(); 3142 3142
Note:
See TracChangeset
for help on using the changeset viewer.