Changeset 242059 in webkit
- Timestamp:
- Feb 25, 2019 4:19:49 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r242052 r242059 1 2019-02-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Adjust initial scale zooming heuristics when changing view scale 4 https://bugs.webkit.org/show_bug.cgi?id=194995 5 6 Reviewed by Tim Horton. 7 8 Rebaseline and adjust an existing layout test. 9 10 * fast/viewport/ios/initial-scale-after-changing-view-scale-expected.txt: 11 * fast/viewport/ios/initial-scale-after-changing-view-scale.html: 12 * platform/ipad/fast/viewport/ios/initial-scale-after-changing-view-scale-expected.txt: Removed. 13 14 Removed an iPad-specific test expectation, since initial scale zooming behavior should be the same now at both 15 device dimensions. 16 1 17 2019-02-25 Frederic Wang <fwang@igalia.com> 2 18 -
trunk/LayoutTests/fast/viewport/ios/initial-scale-after-changing-view-scale-expected.txt
r237127 r242059 6 6 Page scale after double tapping to zoom in : 1.60 7 7 - Page scale after setViewScale(1.25) : 1.60 8 - Page scale after setViewScale(0.75) : 1.609 - Page scale after setViewScale(1) : 1.6010 11 Page scale after double tapping to zoom out : 1.0012 - Page scale after setViewScale(1.25) : 1.2513 8 - Page scale after setViewScale(0.75) : 0.75 14 9 - Page scale after setViewScale(1) : 1.00 15 10 11 Page scale after double tapping to zoom in again : 1.60 12 - Page scale after setViewScale(0.75) : 0.75 13 - Page scale after setViewScale(1.25) : 1.25 14 - Page scale after setViewScale(1) : 1.00 15 16 16 This test verifies that changing the view scale zooms the page to initial scale, but only if the page was already at initial scale. To manually test, (1) change the zoom scale without changing the page scale in any way, and check that the page zooms to initial scale; (2) now double tap on the box to zoom in, and check that changing zoom levels does not change the page scale; (3) finally, double tap on the box again to zoom back out to initial scale, and check that changing zoom levels automatically zooms the page to initial scale once again. -
trunk/LayoutTests/fast/viewport/ios/initial-scale-after-changing-view-scale.html
r237127 r242059 71 71 appendOutput(` - Page scale after setViewScale(1) : ${await pageScaleAfterSettingViewScale(1)}`); 72 72 appendOutput(""); 73 appendOutput(`Page scale after double tapping to zoom out: ${await pageScaleAfterDoubleTappingOnSquare()}`);74 appendOutput(` - Page scale after setViewScale( 1.25) : ${await pageScaleAfterSettingViewScale(1.25)}`);75 appendOutput(` - Page scale after setViewScale( 0.75) : ${await pageScaleAfterSettingViewScale(0.75)}`);76 appendOutput(` - Page scale after setViewScale(1) : ${await pageScaleAfterSettingViewScale(1)}`);73 appendOutput(`Page scale after double tapping to zoom in again : ${await pageScaleAfterDoubleTappingOnSquare()}`); 74 appendOutput(` - Page scale after setViewScale(0.75) : ${await pageScaleAfterSettingViewScale(0.75)}`); 75 appendOutput(` - Page scale after setViewScale(1.25) : ${await pageScaleAfterSettingViewScale(1.25)}`); 76 appendOutput(` - Page scale after setViewScale(1) : ${await pageScaleAfterSettingViewScale(1)}`); 77 77 appendOutput(""); 78 78 -
trunk/Source/WebKit/ChangeLog
r242056 r242059 1 2019-02-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Adjust initial scale zooming heuristics when changing view scale 4 https://bugs.webkit.org/show_bug.cgi?id=194995 5 6 Reviewed by Tim Horton. 7 8 Currently, we only zoom to the new initial scale iff we're exactly at initial scale before changing the view 9 scale. This was done so that if a user zoomed in really far and then increased the view scale, we wouldn't end 10 up zooming out as a result. However, this leads to confusing behavior in the case where the user has manually 11 changed the zoom scale to something close to (but not exactly) initial scale, and then attempts to zoom in 12 further using view scale. In this case, we'll end up keeping page scale the same, so it looks like nothing is 13 happening. 14 15 To fix this, we tweak our heuristics for determining whether to jump to initial scale; if the view scale is 16 increasing and the new initial scale is greater than the current scale, zoom to initial scale. Likewise, if the 17 view scale is decreasing and the new initial scale is less than the current scale, zoom to initial scale. 18 19 Test: fast/viewport/ios/initial-scale-after-changing-view-scale.html 20 21 * WebProcess/WebPage/ios/WebPageIOS.mm: 22 (WebKit::WebPage::setViewportConfigurationViewLayoutSize): 23 1 24 2019-02-25 John Wilander <wilander@apple.com> 2 25 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r242032 r242059 2677 2677 LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_pageID << " setViewportConfigurationViewLayoutSize " << size << " scaleFactor " << scaleFactor << " minimumEffectiveDeviceWidth " << minimumEffectiveDeviceWidth); 2678 2678 2679 ZoomToInitialScale shouldZoomToInitialScale = ZoomToInitialScale::No; 2680 if (m_viewportConfiguration.layoutSizeScaleFactor() != scaleFactor && areEssentiallyEqualAsFloat(m_viewportConfiguration.initialScale(), pageScaleFactor())) 2681 shouldZoomToInitialScale = ZoomToInitialScale::Yes; 2682 2683 if (m_viewportConfiguration.setViewLayoutSize(size, scaleFactor, minimumEffectiveDeviceWidth)) 2684 viewportConfigurationChanged(shouldZoomToInitialScale); 2679 auto previousLayoutSizeScaleFactor = m_viewportConfiguration.layoutSizeScaleFactor(); 2680 if (!m_viewportConfiguration.setViewLayoutSize(size, scaleFactor, minimumEffectiveDeviceWidth)) 2681 return; 2682 2683 auto zoomToInitialScale = ZoomToInitialScale::No; 2684 auto newInitialScale = m_viewportConfiguration.initialScale(); 2685 auto currentPageScaleFactor = pageScaleFactor(); 2686 if (scaleFactor > previousLayoutSizeScaleFactor && newInitialScale > currentPageScaleFactor) 2687 zoomToInitialScale = ZoomToInitialScale::Yes; 2688 else if (scaleFactor < previousLayoutSizeScaleFactor && newInitialScale < currentPageScaleFactor) 2689 zoomToInitialScale = ZoomToInitialScale::Yes; 2690 2691 viewportConfigurationChanged(zoomToInitialScale); 2685 2692 } 2686 2693
Note: See TracChangeset
for help on using the changeset viewer.