fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html does not work...
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Feb 2019 19:30:05 +0000 (19:30 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Feb 2019 19:30:05 +0000 (19:30 +0000)
commitcd5aa976f854daa8d5a3e5a11dd34bac6c553a1f
tree89b0aadb9765461251538356381754b6487658ab
parent19e5f66f3496f92146433cf27ad041560511c3df
fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html does not work on iPad
https://bugs.webkit.org/show_bug.cgi?id=194313

Reviewed by Tim Horton.

Source/WebKit:

Make `-dateTimePickerCalendarType` work on iPad by handling the case where the date picker control is a
WKDateTimePopover. This fixes UIScriptController::calendarType() returning null on iPad.

* UIProcess/ios/forms/WKFormInputControl.mm:
(-[WKFormInputControl dateTimePickerCalendarType]):
(-[WKDateTimePopover calendarType]):

Tools:

Add a helper to determine whether the web view is presenting modal UI.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::isPresentingModally const):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::isPresentingModally const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/UIScriptControllerCocoa.mm:
(WTR::UIScriptController::calendarType const): Deleted.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::isPresentingModally const):
(WTR::UIScriptController::calendarType const):
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::calendarType const):

LayoutTests:

Adjusts an existing layout test to work on both iPhone and iPad simulators.

* fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry-expected.txt:
* fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html:

Make this test wait after blurring the currently focused element, such that tapping to focus the next form
control doesn't fail. Notably on iPad, not waiting for the popover to dismiss meant that subsequent taps would
be dispatched too soon, and hit-test to the popover view being dismissed rather than WKWebView.

* platform/ipad/TestExpectations:

Unskip the test on iPad.

* resources/ui-helper.js:

Add helpers to query whether or not the keyboard is shown, and whether or not a view controller is being modally
presented over the current root view controller (this is the case when interacting with date pickers on iPad).

(window.UIHelper.isShowingKeyboard):
(window.UIHelper.isPresentingModally):
(window.UIHelper.deactivateFormControl):

Add a new helper method to blur the given form control element and wait for web view chrome to finish dismissing
(on iOS, this is either the date picker input view in the keyboard on iPhone, or the date picker popover view
controller on iPad).

(window.UIHelper.isShowingDataListSuggestions):

Drive-by fix: remove an extraneous ternary conditional statement.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry-expected.txt
LayoutTests/fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html
LayoutTests/platform/ipad/TestExpectations
LayoutTests/resources/ui-helper.js
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm
Tools/ChangeLog
Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm
Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp
Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
Tools/WebKitTestRunner/UIScriptControllerCocoa.mm
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm
Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm