Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5823931432ec3a8d8e9f6f9f1cced841f723a61d
      
https://github.com/WebKit/WebKit/commit/5823931432ec3a8d8e9f6f9f1cced841f723a61d
  Author: Wenson Hsieh <[email protected]>
  Date:   2025-10-15 (Wed, 15 Oct 2025)

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

  Log Message:
  -----------
  [Liquid Glass] Scroll pocket can get stuck with previous color if its style 
is changed from hard to soft
https://bugs.webkit.org/show_bug.cgi?id=300770
rdar://162558490

Reviewed by Abrar Rahman Protyasha.

In the case where the top scroll pocket (scroll edge effect) is changing from 
`.hard` to `.soft`
style, our current logic in `-_updateTopScrollPocketCaptureColor` to update the 
internal top pocket
color will just bail instead of making any changes to the scroll pocket.

As a result, if the top scroll pocket starts out as a hard pocket and the 
website contains a fixed
position header that triggers top fixed color extension and then later becomes 
a soft pocket, and
then the fixed header is removed, the pocket will get stuck with its old pocket 
color from when the
header was in the DOM.

Fix this by resetting `_internalTopPocketColor` to `nil` when the pocket style 
changes to soft.

Test: added to 
WKScrollViewTests.TopScrollPocketCaptureColorAfterSettingHardStyle

* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateTopScrollPocketCaptureColor]):
* Source/WebKit/UIProcess/ios/WKScrollView.mm:
(-[WKScrollView _setInternalTopPocketColor:]):

Additionally bail if the incoming internal top pocket color is exactly equal to 
the current value,
to avoid calling into UIKit to update the pocket unnecessarily.

* Tools/TestWebKitAPI/Tests/ios/WKScrollViewTests.mm:
(TestWebKitAPI::TEST(WKScrollViewTests, 
TopScrollPocketCaptureColorAfterSettingHardStyle)):

Augment an existing API test to verify that if the pocket style changes to 
`Soft` and the fixed
header is removed, the top pocket color correctly resets to `nil` to reflect 
this.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to