MarshallOfSound

#50579: fix: re-enable MacWebContentsOcclusion with embedder window fix

Merged
Created: Mar 30, 2026, 5:07:14 AM
Merged: Mar 30, 2026, 4:13:01 PM
4 comments
Target: main

Replaces the full revert of Chromium's MacWebContentsOcclusion cleanup (revert_code_health_clean_up_stale_macwebcontentsocclusion.patch) with a targeted patch that handles embedder windows shown after WebContentsViewCocoa attachment.

Previously we carried the revert and force-disabled kMacWebContentsOcclusion in feature_list.cc because the upstream occlusion checker caused odd visibility behavior with multiple web contents. This PR fixes the root cause instead, so we can drop the revert and re-enable the feature.

  • Removes revert_code_health_clean_up_stale_macwebcontentsocclusion.patch
  • Adds fix_handle_embedder_windows_shown_after_webcontentsviewcocoa_attach.patch
  • Removes the kMacWebContentsOcclusion disable from shell/browser/feature_list.cc
  • Adds spec coverage for show/hide event counts on macOS and visibility tracking across multiple child WebContentsViews

Closes #45776

Notes: Fixed an issue on macOS where show/hide events and WebContents visibility state could be reported incorrectly when multiple WebContentsViews were attached to a window.

Backports

40-x-y
Pending
Waiting for a manual backport
41-x-y
Pending
Waiting for a manual backport
42-x-y
Pending
Waiting for a manual backport

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron