Bug 197188

Summary: [iOS] element.focus() sometimes fails to reveal the focused element when it becomes editable dynamically
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, cmarcelo, dbates, esprehn+autocc, ews-watchlist, kangil.han, megan_gardner, simon.fraser, thorton, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 197145    
Bug Blocks:    
Attachments:
Description Flags
Fixes the bug wenson_hsieh: review+

Description Ryosuke Niwa 2019-04-22 23:24:27 PDT
When an element becomes editable and then immediately focused via element.focus(),
WebKit fails to reveal the element due to the conflicts between scroll-to-reveal code
in WeCore / WebContent process and UI process.

<rdar://problem/43613941>
Comment 1 Ryosuke Niwa 2019-04-22 23:38:54 PDT
Created attachment 368015 [details]
Fixes the bug
Comment 2 Wenson Hsieh 2019-04-23 07:57:32 PDT
Comment on attachment 368015 [details]
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=368015&action=review

> Source/WebCore/ChangeLog:8
> +        The bug was caused by the scroll-to-reveal code trgiggered by Element::updateFocusAppearance updating

Nit - "trgiggered" => triggered

> Source/WebCore/ChangeLog:10
> +        _zoomToRevealFocusedElement in WKWebContent view had already scrolled the frame view.

Nit - "WKWebContent view" => WKContentView
Comment 3 Ryosuke Niwa 2019-04-23 10:10:13 PDT
Committed r244546: <https://trac.webkit.org/changeset/244546>