Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REGRESSION (268069@main): [iOS] Rotating from landscape to portrait c…
…auses date picker to run off screen https://bugs.webkit.org/show_bug.cgi?id=267397 rdar://118972687 Reviewed by Wenson Hsieh. 268069@main modified date picker presentation to use `UIPopoverPresentationController`, rather than `_UIDatePickerOverlayPresentation`. `_UIDatePickerOverlayPresentation` automatically handled dismissing the picker on rotation and view size changes, but `UIPopoverPresentationController` does not. This results in the date picker being presented at an incorrect location after rotation, as the view remains presented, and the old layout information is still used. Fix by explicitly dismissing the picker on rotation and view size changes, matching system date/time pickers. * LayoutTests/fast/forms/ios/dismiss-date-picker-on-rotation-expected.txt: Added. * LayoutTests/fast/forms/ios/dismiss-date-picker-on-rotation.html: Added. * Source/WebKit/UIProcess/ios/forms/WKDatePickerPopoverController.mm: (-[WKDatePickerPopoverController dismissDatePickerAnimated:]): (-[WKDatePickerPopoverController dismissDatePicker]): (-[WKDatePickerPopoverController viewWillTransitionToSize:withTransitionCoordinator:]): Only dismiss the date picker if it is already presented by checking for `isBeingPresented` and `isBeingDismissed`. Canonical link: https://commits.webkit.org/272922@main
- Loading branch information