[iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jul 2018 20:19:08 +0000 (20:19 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jul 2018 20:19:08 +0000 (20:19 +0000)
commit3a5eacdf83deb736aab701341837d36558aee5ec
tree21b181e2d1aff89cbbea81fc2db1852b39983208
parent1aeb7bb5cd8d5fcfb7328fc771a7fb4c6e0cd450
[iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in
https://bugs.webkit.org/show_bug.cgi?id=188107
<rdar://problem/42354250>

Reviewed by Tim Horton.

Source/WebCore:

After r232040, the synthetic click gesture recognizer was enabled when tapping inside of the focused element,
which allows the page to handle click events inside editable content. However, this means that codepaths in
EventHandler that are responsible for changing selection due to default click event behaviors on macOS are now
active on iOS; this conflicts with selection changes due to text interaction gestures, which are the existing
mechanism for modifying the selection on iOS.

To address this, we defer selection changes when clicking to text interaction gestures on iOS by tweaking the
default behavior of a click on iOS to /not/ change selection when moving within the same editable root. This is
similar to r233311, but in a different codepath that specifically handles selection changes when clicking on
content that is already selected.

Test: fast/forms/ios/click-should-not-suppress-misspelling.html

* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseReleaseEvent):

LayoutTests:

Adds a new test to verify that tapping in a misspelled word to bring up the spelling correction callout and
selection view does not immediately cause the selection to dismiss.

* fast/forms/ios/click-should-not-suppress-misspelling-expected.txt: Added.
* fast/forms/ios/click-should-not-suppress-misspelling.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/ios/click-should-not-suppress-misspelling-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/ios/click-should-not-suppress-misspelling.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp