Bug 199662

Summary: [iOS] REGRESSION(r244851): Revealing caret sometimes fails when content inset is used
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: ScrollingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, megan_gardner, simon.fraser, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Fixes the bug
none
Patch for landing none

Description Ryosuke Niwa 2019-07-09 23:47:42 PDT
When WKWebView's content inset is used, we sometimes fail to reveal the caret as the user types.

<rdar://problem/52103924>
Comment 1 Ryosuke Niwa 2019-07-09 23:53:04 PDT
Created attachment 373825 [details]
Fixes the bug
Comment 2 Simon Fraser (smfr) 2019-07-10 11:47:15 PDT
Comment on attachment 373825 [details]
Fixes the bug

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

> Source/WebCore/rendering/RenderLayer.cpp:2685
>              LayoutRect viewRect = frameView.visualViewportRectExpandedByContentInsets();
>  
> +            maxScrollPosition = frameView.scrollPositionFromOffset(ScrollPosition(frameView.totalContentsSize() - flooredIntSize(viewRect.size())));

We need to clean this up so that webcore code doesn't have to get muddied with inset complexity.
Comment 3 Ryosuke Niwa 2019-07-10 13:29:56 PDT
Filed https://bugs.webkit.org/show_bug.cgi?id=199682
and https://bugs.webkit.org/show_bug.cgi?id=199683

Will add links as comments.
Comment 4 Ryosuke Niwa 2019-07-10 13:30:48 PDT
Created attachment 373861 [details]
Patch for landing
Comment 5 WebKit Commit Bot 2019-07-10 14:12:54 PDT
Comment on attachment 373861 [details]
Patch for landing

Clearing flags on attachment: 373861

Committed r247327: <https://trac.webkit.org/changeset/247327>
Comment 6 WebKit Commit Bot 2019-07-10 14:14:04 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Ryosuke Niwa 2019-07-11 16:30:16 PDT
Fixed the test in https://trac.webkit.org/changeset/247373.