Summary: | [iOS] REGRESSION (r239441): Tab cycling to offscreen <select> may not scroll it into view | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Daniel Bates <dbates> | ||||||
Component: | WebKit Misc. | Assignee: | Wenson Hsieh <wenson_hsieh> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bdakin, commit-queue, megan_gardner, simon.fraser, thorton, webkit-bug-importer, wenson_hsieh | ||||||
Priority: | P1 | Keywords: | InRadar, Regression | ||||||
Version: | WebKit Local Build | ||||||||
Hardware: | iPhone / iPad | ||||||||
OS: | iOS 12 | ||||||||
Bug Depends on: | 192802 | ||||||||
Bug Blocks: | |||||||||
Attachments: |
|
Description
Daniel Bates
2019-01-02 11:35:06 PST
It's interesting that the input accessory view buttons (˄ and ˅) do the right thing, but the keyboard does not. I think I overlooked a nuance in the way that _didAccessoryTabInitiateFocus state is maintained when tabbing/shift-tabbing via hardware keyboard. Ah, this broke in r239441 because I changed this (in WebPage::getFocusedElementInformation, formerly WebPage::getAssistedNodeInformation) from: if (!information.elementRect.contains(m_lastInteractionLocation)) information.selectionRect = IntRect(); ...to: if (!information.elementRect.contains(m_lastInteractionLocation)) information.elementInteractionLocation = { }; ...and in WKContentViewInteraction.mm, I then have this logic to determine where to zoom/scroll: WebCore::IntRect elementInteractionRect(elementInfo.elementInteractionLocation, { 1, 1 }); if (!shouldZoomToRevealSelectionRect(elementInfo.elementType)) return elementInteractionRect; So the net effect of this is that when zooming between form controls when the last interaction location is outside of the element bounding rect, we'll end up passing in a selection rect of {{ 0, 0 }, { 1, 1 }} instead of {{ 0, 0 }, { 0, 0 }} as we did before. Subsequently, -[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:] treats {{ 0, 0 }, { 0, 0 }} as a special case by not attempting to reveal that rect, whereas it happily will attempt to reveal {{ 0, 0 }, { 1, 1 }}, causing the page to scroll to the top. The fix is to revert this unintentional behavior change. Created attachment 358231 [details]
Patch
Comment on attachment 358231 [details] Patch Clearing flags on attachment: 358231 Committed r239590: <https://trac.webkit.org/changeset/239590> All reviewed patches have been landed. Closing bug. |