Make preserve and restore focus more likely to be symmetrical
authormegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jan 2018 22:16:08 +0000 (22:16 +0000)
committermegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jan 2018 22:16:08 +0000 (22:16 +0000)
commit2e3f3118cc1938d2161605a27b736315e0cce0f9
treee23228d26ce44d4a7ea451c16bfc3b82749ccca5
parent6794714baa4c6f52bd2e626797af080d9e5eacb9
Make preserve and restore focus more likely to be symmetrical
https://bugs.webkit.org/show_bug.cgi?id=182264
Source/WebKit:

<rdar://problem/36948473>

Reviewed by Tim Horton.

Keep a stack of if we actually increment the focusState, so that
changes to the web content do not result in asymmetric decrements to the focus state.
To work around problems associated with <rdar://problem/37000122>.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _restoreFocusWithToken:]):
(-[WKContentView _preserveFocusWithToken:destructively:]):

LayoutTests:

Reviewed by Tim Horton.

Added new test to verify that opening a selection form twice works.

* fast/forms/ios/ipad/select-form-run-twice-expected.txt: Added.
* fast/forms/ios/ipad/select-form-run-twice.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/ios/ipad/select-form-run-twice-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/ios/ipad/select-form-run-twice.html [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm