Skip to content

Commit

Permalink
Page acts as zoomed even when it is not on visionOS.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=258991
rdar://111176298

Reviewed by Wenson Hsieh.

visionOS is at a constant scale factor, and scales coming from WebCore need to be compared with
WebKit::scalesAreEssentiallyEqual, not traditional comparison operators because
WebCore stores the page scale factor as float instead of double. When we get a scale from WebCore,
we need to ignore differences that are within a small rounding error, with enough leeway
to handle rounding differences that may result from round-tripping through UIScrollView.

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _updateScrollViewForTransaction:]):

Canonical link: https://commits.webkit.org/265864@main
  • Loading branch information
megangardner committed Jul 7, 2023
1 parent 442ba2e commit da53563
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ - (void)_updateScrollViewForTransaction:(const WebKit::RemoteLayerTreeTransactio
WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateScrollViewForOverscrollBehavior(_scrollView.get(), horizontalOverscrollBehavior, verticalOverscrollBehavior, WebKit::ScrollingTreeScrollingNodeDelegateIOS::AllowOverscrollToPreventScrollPropagation::No);

bool hasDockedInputView = !CGRectIsEmpty(_inputViewBoundsInWindow);
bool isZoomed = layerTreeTransaction.pageScaleFactor() > layerTreeTransaction.initialScaleFactor();
bool isZoomed = !WebKit::scalesAreEssentiallyEqual(layerTreeTransaction.pageScaleFactor(), layerTreeTransaction.initialScaleFactor()) && (layerTreeTransaction.pageScaleFactor() > layerTreeTransaction.initialScaleFactor());

bool scrollingNeededToRevealUI = false;
if (_maximumUnobscuredSizeOverride) {
Expand Down

0 comments on commit da53563

Please sign in to comment.