Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 486ead1df3a801a8d683382e51a4d4370d7e51a7
      
https://github.com/WebKit/WebKit/commit/486ead1df3a801a8d683382e51a4d4370d7e51a7
  Author: Kiet Ho <[email protected]>
  Date:   2026-09-24 (Thu, 24 Sep 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/http/tests/site-isolation/date-time-picker-in-cross-origin-iframe-001-expected.txt
    A 
LayoutTests/http/tests/site-isolation/date-time-picker-in-cross-origin-iframe-001.html
    A 
LayoutTests/http/tests/site-isolation/date-time-picker-in-cross-origin-iframe-002-expected.txt
    A 
LayoutTests/http/tests/site-isolation/date-time-picker-in-cross-origin-iframe-002.html
    A 
LayoutTests/http/tests/site-isolation/resources/date-time-picker-subframe.html
    M LayoutTests/platform/mac/TestExpectations
    M LayoutTests/resources/ui-helper.js
    M Source/WebCore/html/BaseDateAndTimeInputType.cpp
    M Source/WebCore/platform/DateTimeChooserParameters.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/gtk/WebDateTimePickerGtk.cpp
    M Source/WebKit/UIProcess/mac/WebDateTimePickerMac.mm
    M Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
    M Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
    M Tools/WebKitTestRunner/mac/UIScriptControllerMac.h
    M Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm

  Log Message:
  -----------
  [Site Isolation] Fix location of date picker in cross-origin iframe
rdar://187314668
https://bugs.webkit.org/show_bug.cgi?id=324098

Reviewed by Aditya Keerthi.

Following the same line as 320835@main, this fixes the location of the date
picker in cross-origin iframes. The old code incorrectly computes the location,
such that if the date input element is in the middle of the page, the date 
picker
will be located outside of the screen (negative Y coordinate)

The main changes is: on the web process side, use contentsToMainFrameView to
compute the location of the date picker. Then on the UI process, directly use
the converted location instead of using convertRectToMainFrameCoordinates to
convert again.

To aid testing, add a UIScriptController property named `dateTimePickerRect`.
It returns the date picker rectangle in the main frame view coordinates. The
added layout tests invoke the date picker and check if the picker is at the
expected location. `dateTimePickerRect` is only implemented on macOS, so the
tests are gated to only run on macOS too.

The bug occurs on iOS too, but the date picker goes through a different
route on iOS, so it'll be address in a future patch. Bugzilla is at
https://bugs.webkit.org/show_bug.cgi?id=324206

Tests: 
http/tests/site-isolation/date-time-picker-in-cross-origin-iframe-001.html
       
http/tests/site-isolation/date-time-picker-in-cross-origin-iframe-002.html

* LayoutTests/TestExpectations:
* 
LayoutTests/http/tests/site-isolation/date-time-picker-in-cross-origin-iframe-001-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/date-time-picker-in-cross-origin-iframe-001.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/date-time-picker-in-cross-origin-iframe-002-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/date-time-picker-in-cross-origin-iframe-002.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/resources/date-time-picker-subframe.html: 
Added.
* LayoutTests/platform/mac/TestExpectations:
* LayoutTests/resources/ui-helper.js:
(window.UIHelper.async isShowingDateTimePicker):
(window.UIHelper.dateTimePickerRect):
* Source/WebCore/html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::setupDateTimeChooserParameters):
* Source/WebCore/platform/DateTimeChooserParameters.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showDateTimePicker):
* Source/WebKit/UIProcess/gtk/WebDateTimePickerGtk.cpp:
(WebKit::WebDateTimePickerGtk::platformShowDateTimePicker):
* Source/WebKit/UIProcess/mac/WebDateTimePickerMac.mm:
(-[WKDateTimePicker initWithParams:inView:]):
* Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* Tools/TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::dateTimePickerRect const):
* Tools/WebKitTestRunner/mac/UIScriptControllerMac.h:
* Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptControllerMac::dateTimePickerRect const):

Canonical link: https://commits.webkit.org/321820@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to