Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0674c8cf2ddd8c5042c7ed01ddad21d93cf1bdaf
      
https://github.com/WebKit/WebKit/commit/0674c8cf2ddd8c5042c7ed01ddad21d93cf1bdaf
  Author: Aditya Keerthi <[email protected]>
  Date:   2026-10-07 (Wed, 07 Oct 2026)

  Changed paths:
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    A Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ios/ZoomToFocusedElement.mm

  Log Message:
  -----------
  Disable input zooming when iPhone Duo is unfolded
https://bugs.webkit.org/show_bug.cgi?id=326532
rdar://189197129

Reviewed by Abrar Rahman Protyasha and Wenson Hsieh.

On iPhone, when an editable element is focused, WebKit zooms in so that the
element's text appears at a legible size, as long as the page allows user
scaling. On iPad, the focused element is revealed without zooming.

When the iPhone Duo is unfolded, the web view has regular horizontal and
vertical size classes, like a full screen iPad. Match the iPad behavior in this
case, and do not zoom in when revealing the focused element. Only scaling is
affected, the focused element is still scrolled into view.

Add API tests that cover zooming to reveal a focused input on iPhone and iPad,
at each combination of horizontal and vertical size classes.

* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _allowScalingToRevealFocusedElement]):

Only allow scaling on iPhone, and only if the size classes are not both
regular.

(-[WKContentView _zoomToRevealFocusedElement]):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ios/ZoomToFocusedElement.mm: Added.
(-[ZoomToFocusedElementScrollViewDelegate 
scrollViewDidEndZooming:withView:atScale:]):
(TestWebKitAPI::createWebViewWithSizeClasses):

Refresh the cached user interface idiom, since tests in the same suite run in a
single process, and `UserInterfaceSwizzler` only swizzles
`-[UIDevice userInterfaceIdiom]`.

(TestWebKitAPI::focusedInputIsVisible):
(TestWebKitAPI::testZoomAfterFocusingInput):
(TestWebKitAPI::testNoZoomAfterFocusingInput):

Place the input outside the visible viewport, so that the resulting scroll
indicates that the focused input has been revealed, before checking that the
scale is unchanged.

(TestWebKitAPI::TEST(ZoomToFocusedElement, 
PhoneIdiomCompactWidthRegularHeight)):
(TestWebKitAPI::TEST(ZoomToFocusedElement, 
PhoneIdiomCompactWidthCompactHeight)):
(TestWebKitAPI::TEST(ZoomToFocusedElement, 
PhoneIdiomRegularWidthCompactHeight)):
(TestWebKitAPI::TEST(ZoomToFocusedElement, 
PhoneIdiomRegularWidthRegularHeight)):
(TestWebKitAPI::TEST(ZoomToFocusedElement, PadIdiomCompactWidthRegularHeight)):
(TestWebKitAPI::TEST(ZoomToFocusedElement, PadIdiomCompactWidthCompactHeight)):
(TestWebKitAPI::TEST(ZoomToFocusedElement, PadIdiomRegularWidthCompactHeight)):
(TestWebKitAPI::TEST(ZoomToFocusedElement, PadIdiomRegularWidthRegularHeight)):

Canonical link: https://commits.webkit.org/323006@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to