#50579: fix: re-enable MacWebContentsOcclusion with embedder window fix
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
kMacWebContentsOcclusiondisable fromshell/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
Semver Impact
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