Bug 186333

Summary: Selecting a line in a contenteditable in WKWebView breaks scrolling (iOS 11.3 and 11.4)
Product: WebKit Reporter: hongping
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED MOVED    
Severity: Normal CC: bruno.onlyme, megan_gardner, simon.fraser, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: iPhone / iPad   
OS: iOS 11   
Attachments:
Description Flags
Project to reproduce the issue none

Description hongping 2018-06-05 19:47:50 PDT
Created attachment 342023 [details]
Project to reproduce the issue

To reproduce the bug:

1. unzip and open the project in Xcode 9.4
2. run the app using iOS simulator 11.3
3. click on the text "testing"
4. type about 15 lines or so with multiple words
5. On the last line with multiple words, select the entire line
6. With the line still selected, try to scroll upwards

Expected
Able to scroll up

Actual
The scrolling keeps jumping back down, as if to keep the selection in view. Even after removing the selection, scrolling upwards still keeps jumping back down.

Screen recording:
https://cl.ly/2e1j1P0D2h0u

Additional details

The issue doesn't happen on iOS 11.2, only 11.3 and 11.4 currently.

In the attached zip file, the view controller creates a WKWebView instance that loads the following HTML string to construct a contenteditable div.

        let html = "<div contenteditable=\"true\">Testing</div>";
        webView.loadHTMLString(html, baseURL: nil)
Comment 1 Radar WebKit Bug Importer 2018-06-05 19:49:55 PDT
<rdar://problem/40834726>
Comment 3 bruno.onlyme 2018-06-24 17:21:38 PDT
Q can anybody tell us what we "call to refresh" standard behaviour?
Comment 4 Simon Fraser (smfr) 2019-04-09 11:09:08 PDT
This is a bug in another framework, not WebKit, and will be fixed in a future OS update.