Bug 306569
| Summary: | [Form Controls][iOS] Form controls in cross-origin subframes have incorrect interaction rects | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | zak ridouh <zakr> |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
zak ridouh
When a form control (such as a <select> or <input>) is focused inside a site-isolated cross-origin iframe, the `FocusedElementInformation` struct sent from the WebContent Process contains coordinates relative to that subframe's viewport.
On iOS, `WebPageProxy` passes this information to `PageClient` (and eventually `WKContentView`) to manage native UI overlays such as the form accessory bar, keyboard interactions, and selection handles. Because the UIProcess expects these coordinates to be relative to the main frame, the UI elements are positioned incorrectly. They are usually offset by the iframe's position within the main page, causing the form assistant to appear in the wrong location or not appear at all.
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`.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
zak ridouh
<rdar://168716669>
zak ridouh
Pull request: https://github.com/WebKit/WebKit/pull/57510
EWS
Committed 311229@main (4597139ad795): <https://commits.webkit.org/311229@main>
Reviewed commits have been landed. Closing PR #57510 and removing active labels.