Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7aa2c5c2159457a055b3de29283644fff1b7cb35
      
https://github.com/WebKit/WebKit/commit/7aa2c5c2159457a055b3de29283644fff1b7cb35
  Author: Lily Spiniolas <[email protected]>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SampledPageTopColor.mm

  Log Message:
  -----------
  [iOS] Fixed headers in web apps may be obscured during top scroll stretch
https://bugs.webkit.org/show_bug.cgi?id=314720
rdar://175917998

Reviewed by Abrar Rahman Protyasha and Wenson Hsieh.

When a WKWebView with no refresh control loads a page with a fixed top
header, the header remains at the top of the view during top scroll
stretching. By contrast, when a WKWebView does have a refresh control,
the entirety of the page shifts down during top scroll stretching, including
any fixed top headers.

If a color extension is created for a web view as a result of its top fixed
header, and that web view does not have a refresh control, the color extension
still grows regardless, and thus covers the fixed top header.

Resolve this issue by not adding the scroll stretch amount to color extension
height in `_obscuredInsetsForFixedColorExtension` if the scroll view does not
have a refresh control.

Add a new API test for this behavior, and refactor a few tests to reduce
code duplication between those tests and the new one. Add a refresh
control to the web view in 
SampledPageTopColor.TopColorExtensionWhenRubberBanding
so that the test continues to demonstrate color extension growth during
rubberbanding.

Test: 
SampledPageTopColor.TopColorExtensionHeightDoesNotIncreaseWithoutRefreshControl

* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _obscuredInsetsForFixedColorExtension]):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SampledPageTopColor.mm:
(TestWebKitAPI::TEST(SampledPageTopColor, TopColorExtensionWhenRubberBanding)):
(TestWebKitAPI::webViewForColorExtensionGrowthTests):
(TestWebKitAPI::TEST(SampledPageTopColor, 
TopColorExtensionGrowsDuringRubberBandingWithoutSampledPageTopColor)):
(TestWebKitAPI::TEST(SampledPageTopColor, 
TopColorExtensionHeightIncreasesWithRubberBandAmount)):
(TestWebKitAPI::TEST(SampledPageTopColor, 
TopColorExtensionHeightDoesNotIncreaseWithoutRefreshControl)):

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



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

Reply via email to