Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 80c3a241b03b8d60167b12567351a2c9a8cd75b7
https://github.com/WebKit/WebKit/commit/80c3a241b03b8d60167b12567351a2c9a8cd75b7
Author: Jessica Cheung <[email protected]>
Date: 2026-07-14 (Tue, 14 Jul 2026)
Changed paths:
A
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-keyboard-scroll-expected.txt
A
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-keyboard-scroll.html
A
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-obscured-insets-expected.txt
A
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-obscured-insets.html
A
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-zoom-disabled-expected.txt
A
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-zoom-disabled.html
A
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-zoom-enabled-expected.txt
A
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-zoom-enabled.html
M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
Log Message:
-----------
[interactive-widget] Implement logic to support overlays-content
https://bugs.webkit.org/show_bug.cgi?id=297473
rdar://158431078
Reviewed by Wenson Hsieh, Abrar Rahman Protyasha, Aditya Keerthi, and Richard
Robinson.
Add support for the overlays-content value for interactive-widgets.
To do so, the virtual keyboard should not contribute to the visual
viewport calculations and simply overlay the page. So, create a new
helper `_inputViewBoundsForViewportCalculations` that returns CGRectZero
if the value is overlays-content and `_inputViewBoundsInWindow` otherwise.
The value of `_computeUnobscuredContentRectRespectingInputViewBounds` is
now in respect to `_inputViewBoundsForViewportCalculations`.
Additionally when the virtual keyboard is up, it is possible that the page
is adjusted via scrolling + clamping (`_adjustForAutomaticKeyboardInfo`). If
overlays-content, the keyboard should not contribute to scrollable extent which
will change the visual viewport, so gate this based on the interactive-widget
value.
Add layout tests that ensure the visual viewport does not change and test that
they fail without overlays-content mode.
Alternatives tried and considered before include directly altering
`_inputViewBoundsInWindow`.
While it worked and prevented the visual viewport from resizing, it broke
context menus and
other calculations that relied on `_inputViewBoundsInWindow`. In those cases,
WebKit still
needs to know the size of and factor in the virtual keyboard being up.
*
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-keyboard-scroll-expected.txt:
Added.
*
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-keyboard-scroll.html:
Added.
*
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-obscured-insets-expected.txt:
Added.
*
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-obscured-insets.html:
Added.
*
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-zoom-disabled-expected.txt:
Added.
*
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-zoom-disabled.html:
Added.
*
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-zoom-enabled-expected.txt:
Added.
*
LayoutTests/fast/visual-viewport/ios/interactive-widget-overlays-content-zoom-enabled.html:
Added.
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _inputViewBoundsForViewportCalculations]):
(-[WKWebView _createVisibleContentRectUpdate]):
(-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
Canonical link: https://commits.webkit.org/317200@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications