Tapping *below* some <input>s can focus them in Mobile Safari
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 17:15:38 +0000 (17:15 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 17:15:38 +0000 (17:15 +0000)
commit12f73c72a0d50bf58e4a68588ca24ffe74a3656b
treef7bde536deac2d562c86caa954842a62b4517c96
parent766ee4447c2c989264d089ea6bd40dd6f3e5d840
Tapping *below* some <input>s can focus them in Mobile Safari
https://bugs.webkit.org/show_bug.cgi?id=146244
<rdar://problem/21509310>

Reviewed by Darin Adler.

Source/WebCore:

Removes iOS-specific logic in positionForPointRespectingEditingBoundaries that was causing us to focus inputs by
tapping on the document element. We believe this logic, which causes VisiblePosition finding to recurse from a non-
editable element to an editable child, is not necessary to focus editable elements underneath non-editable elements,
since hit-testing will already have selected the contentEditable element prior to searching for a suitable
VisiblePosition. Further investigation shows that this logic was added to fix <rdar://problem/5545799>, in which the
first character in a Notes document could not be selected. However, I have not been able to reproduce this bug after
removing this logic.

As a result of this change, we can also enable a WK1 test, editing/selection/click-outside-editable-div.html, that
had also been marked as failing due to positionForPointRespectingEditingBoundaries recursing into a contentEditable
div.

Test: fast/events/ios/clicking-document-should-not-trigger-focus.html

* rendering/RenderBlock.cpp:
(WebCore::positionForPointRespectingEditingBoundaries): Deleted.

LayoutTests:

Enables a now-passing WK1 editing test (editing/selection/click-outside-editable-div.html) and also add a new
WK2 test that verifies an input node won't be focused by clicking anywhere in the document outside of the body.

* fast/events/ios/clicking-document-should-not-trigger-focus-expected.txt: Added.
* fast/events/ios/clicking-document-should-not-trigger-focus.html: Added.
* platform/ios-simulator-wk1/TestExpectations: No longer disable editing/selection/click-outside-editable-div.html.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/ios/clicking-document-should-not-trigger-focus-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/ios/clicking-document-should-not-trigger-focus.html [new file with mode: 0644]
LayoutTests/platform/ios-simulator-wk1/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp