[iOS] Propagate visibility during fullscreen video layer hosting#66351
Merged
webkit-commit-queue merged 1 commit intoJun 4, 2026
Conversation
Collaborator
|
EWS run on previous version of this PR (hash ec7b139) Details
|
Collaborator
iOS Safer C++ Build #30645 (ec7b139)❌ Found 1 failing file with 3 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming. |
ec7b139 to
eea23f3
Compare
Collaborator
|
EWS run on previous version of this PR (hash eea23f3) Details |
jernoble
approved these changes
Jun 3, 2026
Collaborator
iOS Safer C++ Build #30751 (eea23f3)❌ Found 1 failing file with 3 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming. |
eea23f3 to
6895f50
Compare
Collaborator
|
EWS run on current version of this PR (hash 6895f50) Details |
https://bugs.webkit.org/show_bug.cgi?id=316184 rdar://175469152 Reviewed by Jer Noble. When WebKit's fullscreen video layer is hosted in another process, the UI process and auxiliary processes should be considered visible for the duration of the fullscreen presentation. The existing mechanism for visibility propagation (WKVisibilityPropagationView) relies on the web view being in a visible scene, and while the app hosting the video layer does propagate a visibility endowment to the UI process, WKVisibilityPropagationView does not further propagate visibility to the auxiliary processes if the web view itself is not visible. To address this, introduced LayerHostingVisibilityPropagator. It propagates a hereditary visibility endowment grant to each auxiliary process for every visibility endowment granted to the UI process. It also takes a MediaPlayback process assertion on the UI process for the duration of the fullscreen layer presentation (to account for the lack of a visible scene assertion). To detect which source environments currently hold the endowment, EndowmentStateTracker now requests RBSProcessStateValueEndowmentInfos and walks RBSProcessEndowmentInfo entries instead of just namespaces, allowing it to record the source environment per visibility grant and notify clients via a new visibilityEndowmentEnvironmentsChanged() callback. VideoPresentationManagerProxy creates a propagator during fullscreen setup, attaches it to the VideoPresentationModel, and removes it during cleanup. WKContentView keeps a WeakHashSet of active propagators and updates them alongside the existing WKVisibilityPropagationViews as auxiliary processes launch and exit. * Source/WebKit/Platform/spi/ios/BaseBoardSPI.h: * Source/WebKit/Platform/spi/ios/RunningBoardServicesSPI.h: (+[RBSProcessPredicate predicateMatchingHandle:]): * Source/WebKit/SourcesCocoa.txt: * Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.h: * Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.mm: (WebKit::VideoPresentationModelContext::setLayerHostingVisibilityPropagator): (WebKit::VideoPresentationManagerProxy::setupFullscreenWithID): (WebKit::VideoPresentationManagerProxy::didCleanupFullscreen): * Source/WebKit/UIProcess/EndowmentStateTracker.h: (WebKit::EndowmentStateTrackerClient::visibilityEndowmentEnvironmentsChanged): (WebKit::EndowmentStateTracker::visibilityEndowmentEnvironments const): * Source/WebKit/UIProcess/EndowmentStateTracker.mm: (WebKit::handleForPID): (WebKit::EndowmentStateTracker::stateFromProcessState): (WebKit::EndowmentStateTracker::isApplicationForeground): (WebKit::EndowmentStateTracker::stateForHandle): (WebKit::EndowmentStateTracker::registerMonitorIfNecessary): (WebKit::EndowmentStateTracker::ensureState const const): (WebKit::EndowmentStateTracker::setState): (): Deleted. (WebKit::EndowmentStateTracker::stateFromEndowments): Deleted. * Source/WebKit/UIProcess/PageClient.h: (WebKit::PageClient::createLayerHostingVisibilityPropagator): * Source/WebKit/UIProcess/ios/LayerHostingVisibilityPropagator.h: Added. * Source/WebKit/UIProcess/ios/LayerHostingVisibilityPropagator.mm: Added. (WebKit::invalidateInjectors): (WebKit::LayerHostingVisibilityPropagator::create): (WebKit::LayerHostingVisibilityPropagator::LayerHostingVisibilityPropagator): (WebKit::LayerHostingVisibilityPropagator::~LayerHostingVisibilityPropagator): (WebKit::LayerHostingVisibilityPropagator::propagateVisibilityToProcess): (WebKit::LayerHostingVisibilityPropagator::stopPropagatingVisibilityToProcess): (WebKit::LayerHostingVisibilityPropagator::clear): (WebKit::LayerHostingVisibilityPropagator::visibilityEndowmentEnvironmentsChanged): (WebKit::LayerHostingVisibilityPropagator::refreshInjectorsAtIndex): * Source/WebKit/UIProcess/ios/PageClientImplIOS.h: * Source/WebKit/UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::createLayerHostingVisibilityPropagator): * Source/WebKit/UIProcess/ios/WKContentView.h: * Source/WebKit/UIProcess/ios/WKContentView.mm: (-[WKContentView _setupVisibilityPropagationForWebProcess:contextID:]): (-[WKContentView _removeVisibilityPropagationForWebProcess:]): (-[WKContentView _setupVisibilityPropagationForGPUProcess]): (-[WKContentView _setupVisibilityPropagationForModelProcess]): (-[WKContentView _removeVisibilityPropagationViewForGPUProcess]): (-[WKContentView _removeVisibilityPropagationViewForModelProcess]): (-[WKContentView _resetVisibilityPropagation]): (-[WKContentView _createLayerHostingVisibilityPropagator]): * Source/WebKit/WebKit.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/314516@main
6895f50 to
23a2f28
Compare
Collaborator
|
Committed 314516@main (23a2f28): https://commits.webkit.org/314516@main Reviewed commits have been landed. Closing PR #66351 and removing active labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
23a2f28
6895f50
🧪 win-tests🧪 ios-wk2-wpt