Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fdce102465d769a6932598d2815c0024a2598870
      
https://github.com/WebKit/WebKit/commit/fdce102465d769a6932598d2815c0024a2598870
  Author: Wenson Hsieh <[email protected]>
  Date:   2025-05-30 (Fri, 30 May 2025)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
    M Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm
    M Source/WebKit/UIProcess/Cocoa/FullscreenClient.mm
    M Source/WebKit/UIProcess/ios/WKScrollView.h
    M Source/WebKit/UIProcess/ios/WKScrollView.mm
    M Source/WebKit/UIProcess/mac/WebViewImpl.h
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm

  Log Message:
  -----------
  Content inset fill view obscures media controls in element fullscreen
https://bugs.webkit.org/show_bug.cgi?id=293833
rdar://152166931

Reviewed by Abrar Rahman Protyasha, Megan Gardner, and Tim Horton.

Refactor logic for hiding content inset fill views, such that we can hide them 
in element fullscreen
mode. To do this, we introduce a new options enum — 
`HideContentInsetFillReason` — to keep track of
reasons for suppressing visibility for the content inset fill. We then use this 
mechanism to hide
the view when we're about to enter element fullscreen, and show it again when 
we're about to exit.

Using an option set of reason flags here allows us to both:

1.  Reconcile logic for hiding the top inset fill view in element fullscreen 
with existing logic to
    hide the inset fill view when automatic appearance is enabled on macOS.

2.  Allows us to easily add more reasons in the future.

See below for more details.

* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateFixedColorExtensionEdges]):

Rename `-_setFixedColorExtensionEdges:` to `-_setHiddenContentInsetFillEdges:`, 
which better
encapsulates the underlying behavior. Also check for 
`_reasonsToHideTopContentInsetFill` when
determining whether we need to suppress the inset fill view along the top edge.

(-[WKWebView _addReasonToHideTopContentInsetFill:]):
(-[WKWebView _removeReasonToHideTopContentInsetFill:]):

Add the two new helper methods to (respectively) add or remove 
`HideContentInsetFillReason`s.

(-[WKWebView _setTopContentInsetFillHidden:]):

Called when the reasons `OptionSet` goes from being empty to non-empty, or vice 
versa.

* Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h:
* Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm:
(-[WKWebView _setUsesAutomaticContentInsetBackgroundFill:]):

Call into `updateTopContentInsetFillDueToScrolling()`. This is called here 
because whether or not we
should suppress the top content inset fill view when we're scrolled to the top 
also depends on
whether or not the client is opting into the automatic content inset fill 
appearance.

* Source/WebKit/UIProcess/Cocoa/FullscreenClient.mm:
(WebKit::FullscreenClient::willEnterFullscreen):
(WebKit::FullscreenClient::willExitFullscreen):

Add or remove `HideContentInsetFillReason::FullScreen` when entering or exiting 
fullscreen.

* Source/WebKit/UIProcess/ios/WKScrollView.h:
* Source/WebKit/UIProcess/ios/WKScrollView.mm:
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::pageDidScroll):
(WebKit::WebViewImpl::updateTopContentInsetFillDueToScrolling):

Canonical link: https://commits.webkit.org/295638@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