Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4597139ad795447d6414c328e01fcea59df9de37
      
https://github.com/WebKit/WebKit/commit/4597139ad795447d6414c328e01fcea59df9de37
  Author: Zak Ridouh <[email protected]>
  Date:   2026-04-14 (Tue, 14 Apr 2026)

  Changed paths:
    M Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm

  Log Message:
  -----------
  [Form Controls][iOS] Form controls in cross-origin subframes have incorrect 
interaction rects
https://bugs.webkit.org/show_bug.cgi?id=306569
rdar://168716669

Reviewed by Aditya Keerthi.

When a form control is focused inside a site-isolated cross-origin iframe, the
FocusedElementInformation struct sent from the WebProcess contains coordinates
relative to that subframe's viewport. On iOS, the UIProcess expects these
coordinates to be relative to the main frame, causing native UI overlays (such 
as
the form accessory bar, selection handles, and picker positioning) to appear in
the wrong location.

This affects all iOS form controls that rely on FocusedElementInformation for
positioning, including:
- <select> element dropdown pickers
- <input type="color"> native color picker
- <input type="date/time/month/week/datetime-local"> date and time pickers
- <input type="text/email/url/tel/search/number/password"> keyboard accessory
  bar and input positioning
- <textarea> keyboard accessory bar and input positioning
- Form navigation (next/previous element) positioning

This patch introduces 
convertFocusedElementInformationRectsToMainFrameCoordinates
in WebPageProxy. This helper asynchronously converts the interactionRect,
nextNodeRect, and previousNodeRect from the focused frame's coordinate space to
the main frame's coordinate space using the existing geometry mapping logic in
WebFrameProxy.

We now wait for this conversion to complete before calling
pageClient->elementDidFocus or pageClient->updateFocusedElementInformation.

* Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm:
(-[WKWebView _focusedElementInteractionRect]):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::elementDidFocus):
(WebKit::WebPageProxy::updateFocusedElementInformation):
(WebKit::WebPageProxy::convertFocusedElementInformationRectsToMainFrameCoordinates):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::(SiteIsolation, 
SelectMultiplePickerLocationInCrossOriginIframe)):

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



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

Reply via email to