Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 793fd9fdac661cae17ead6122323cc296ea552ea
      
https://github.com/WebKit/WebKit/commit/793fd9fdac661cae17ead6122323cc296ea552ea
  Author: Jessica Cheung <[email protected]>
  Date:   2026-07-31 (Fri, 31 Jul 2026)

  Changed paths:
    A 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-bottom-obscured-insets-expected.txt
    A 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-bottom-obscured-insets.html
    A 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-inputmode-none-expected.txt
    A 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-inputmode-none.html
    A 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-keyboard-scroll-expected.txt
    A 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-keyboard-scroll.html
    A 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-top-obscured-insets-expected.txt
    A 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-top-obscured-insets.html
    A 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-zoom-disabled-expected.txt
    A 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-zoom-disabled.html
    A 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-zoom-enabled-expected.txt
    A 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-zoom-enabled.html
    M LayoutTests/resources/ui-helper.js
    M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
    M Source/WebKit/UIProcess/PageClient.h
    M Source/WebKit/UIProcess/ios/PageClientImplIOS.h
    M Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
    M Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
    M Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
    M Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
    M Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h
    M Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm

  Log Message:
  -----------
  [interactive-widget] Implement logic to support resizes-content
https://bugs.webkit.org/show_bug.cgi?id=319903
rdar://182828312

Reviewed by Aditya Keerthi and Abrar Rahman Protyasha.

Implement `interactive-widget=resizes-content`, in which the visual
viewport and the layout viewport should both resize as widgets
appear on the screen (e.g. the virtual keyboard here). By default,
the visual viewport clamps to the top of the keyboard, so no work is
needed here.

To ensure the layout viewport clamps accordingly, these changes
are necessary:
1. The changes in _dispatchSetViewLayoutSize alter baseLayoutViewportSize,
which will be utilized to report the layout viewport size.
2. The changes in computeLayoutViewportRect alter unobscuredContentSize,
which is used as the floor for the constrainedSize.
3. Wire the interactive-widget value through PageClient.

If only the floor was clamped, computeLayoutViewportRect would have
max(fullBaseHeight, clampedSize) which gives us the incorrect value. If only
the base size was clamped, the calculation would be max(clampedSize, fullHeight)
and the full height would take over. Thus, both changes are needed for the
layout viewport to actually take the height of the area between the keyboard
and any insets. If there is a bottom inset above the keyboard, the layout 
viewport
clamps accordingly to the bottom and top inset, if any.

Add layout tests that fail without the implementation changes. Ensure the tests 
are
device-agnostic by adding support for inputViewBoundsInWebView which converts 
the
keyboard rect from window coordinates to WKWebView's coordinate space.

The layout tests cover these cases with resizes-content:
- Zoom (disabled and enabled)
- Obscured insets (bottom and top)
- inputmode=none
- Keyboard showing, hiding and scrolling

* 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-bottom-obscured-insets-expected.txt:
 Added.
* 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-bottom-obscured-insets.html:
 Added.
* 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-inputmode-none-expected.txt:
 Added.
* 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-inputmode-none.html:
 Added.
* 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-keyboard-scroll-expected.txt:
 Added.
* 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-keyboard-scroll.html:
 Added.
* 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-top-obscured-insets-expected.txt:
 Added.
* 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-top-obscured-insets.html:
 Added.
* 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-zoom-disabled-expected.txt:
 Added.
* 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-zoom-disabled.html:
 Added.
* 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-zoom-enabled-expected.txt:
 Added.
* 
LayoutTests/fast/visual-viewport/ios/interactive-widget-resizes-content-zoom-enabled.html:
 Added.
* LayoutTests/resources/ui-helper.js:
(window.UIHelper.inputViewBoundsInWebView):
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _dispatchSetViewLayoutSize:]):
(-[WKWebView _viewportMetaTagInteractiveWidget]):
(-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
* Source/WebKit/UIProcess/PageClient.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::viewportMetaTagInteractiveWidget const):
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeLayoutViewportRect const):
* Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* Tools/TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::inputViewBoundsInWebView const):
* Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h:
* Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptControllerIOS::inputViewBoundsInWebView const):

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



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

Reply via email to