[webkit-changes] [WebKit/WebKit] 431487: [iOS] `svh`/`dvh` units are unexpectedly equal whe...

Abrar Rahman Protyasha noreply at github.com
Mon Nov 13 11:31:47 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 43148740f3bec5f9d3485d264699331f0faae884
      https://github.com/WebKit/WebKit/commit/43148740f3bec5f9d3485d264699331f0faae884
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2023-11-13 (Mon, 13 Nov 2023)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
    M Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/CSSViewportUnits.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/FixedLayoutSize.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/RestoreScrollPosition.mm
    M Tools/TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm
    M Tools/TestWebKitAPI/Tests/ios/ScrollViewScrollabilityTests.mm
    M Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm

  Log Message:
  -----------
  [iOS] `svh`/`dvh` units are unexpectedly equal when Safari tab bar is not visible
https://bugs.webkit.org/show_bug.cgi?id=261185
rdar://115085360

Reviewed by Wenson Hsieh.

The SPI `-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]`
is underspecified, and clients calling into this method conflate
`minimumLayoutSize` as _the_ current layout size. This is not appropriate
for us to use as the `minimumUnobscuredSizeOverride` because the current
layout size may not be computed in light of the fact that some dynamic
UI of a client is not visible.

To address this issue, we update the SPI signature to include a new
`minimumUnobscuredSizeOverride` argument, following the precedence set
by the `maximumUnobscuredSizeOverride` parameter, which callers should
populate with the minimum unobscured layout size assuming all dynamic UI
is expanded.

We also update some API tests that call this SPI and reflect the
semantics of the new argument in the updated test expectations.

* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
(-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumUnobscuredSizeOverride:maximumUnobscuredSizeOverride:]):
* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(WebKit::WKWebViewState::applyTo):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm:
(TEST):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/CSSViewportUnits.mm:
(TEST):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/FixedLayoutSize.mm:
(TEST):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/RestoreScrollPosition.mm:
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm:
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/Tests/ios/ScrollViewScrollabilityTests.mm:
(TestWebKitAPI::TEST):
* Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(-[PlatformWebViewController viewWillTransitionToSize:withTransitionCoordinator:]):

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




More information about the webkit-changes mailing list