[webkit-changes] [WebKit/WebKit] ea2802: REGRESSION (268069 at main): [iOS] Rotating from land...

Aditya Keerthi noreply at github.com
Thu Jan 11 09:57:54 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ea28020d4d412557991fa342390443d323a3805a
      https://github.com/WebKit/WebKit/commit/ea28020d4d412557991fa342390443d323a3805a
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2024-01-11 (Thu, 11 Jan 2024)

  Changed paths:
    A LayoutTests/fast/forms/ios/dismiss-date-picker-on-rotation-expected.txt
    A LayoutTests/fast/forms/ios/dismiss-date-picker-on-rotation.html
    M Source/WebKit/UIProcess/ios/forms/WKDatePickerPopoverController.mm

  Log Message:
  -----------
  REGRESSION (268069 at main): [iOS] Rotating from landscape to portrait causes date picker to run off screen
https://bugs.webkit.org/show_bug.cgi?id=267397
rdar://118972687

Reviewed by Wenson Hsieh.

268069 at 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




More information about the webkit-changes mailing list