Repository navigation
fix: move BrowserWindow's WebContentsView to be a child of rootview - #41256
Merged
Merged
Conversation
Member
|
Looks like the menu bar is expecting a different amount of children after this PR electron/shell/browser/ui/views/root_view.cc Lines 92 to 98 in 4367c5a |
3 tasks done
zcbenz
approved these changes
Feb 8, 2024
3 tasks done
nornagon
force-pushed
the
hide-browserwindow-webcontentsview
branch
from
February 20, 2024 00:58
03b1e5e to
3d3af28
Compare
nornagon
force-pushed
the
hide-browserwindow-webcontentsview
branch
from
February 20, 2024 01:11
3d3af28 to
aa66ce7
Compare
Contributor
|
The WoA CI consistently fails with a |
Contributor
|
WoA still crashes, maybe just remove the line? |
Member
|
/trop run backport-to 30-x-y |
Contributor
|
The backport process for this PR has been manually initiated - sending your PR to |
trop Bot
added a commit
that referenced
this pull request
Apr 8, 2024
…41256) Co-authored-by: Jeremy Rose <[email protected]>
Contributor
|
I was unable to backport this PR to "30-x-y" cleanly; |
codebytere
pushed a commit
that referenced
this pull request
Apr 10, 2024
…41802) fix: move BrowserWindow's WebContentsView to be a child of rootview (#41256) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Jeremy Rose <[email protected]>
2 tasks done
3 tasks done
3 tasks done
3 tasks done
markh-discord
added a commit
to discord/electron
that referenced
this pull request
Sep 12, 2024
Revert "fix: move BrowserWindow's WebContentsView to be a child of rootview (electron#41256)" This reverts commit 76f7bbb. Patch-Filename: fix_revert_change_that_broke_nvda_screen_reader.patch
3 tasks done
4 tasks done
chrisharris-discord
pushed a commit
to discord/electron
that referenced
this pull request
Feb 18, 2025
Revert "fix: move BrowserWindow's WebContentsView to be a child of rootview (electron#41256)" This reverts commit 76f7bbb. Patch-Filename: fix_revert_change_that_broke_nvda_screen_reader.patch
markh-discord
added a commit
to discord/electron
that referenced
this pull request
Aug 12, 2025
Revert "fix: move BrowserWindow's WebContentsView to be a child of rootview (electron#41256)" This reverts commit 76f7bbb. Additionally reverts commit 7d045dc to support prior revert. Patch-Filename: fix_revert_change_that_broke_nvda_screen_reader.patch
markh-discord
added a commit
to discord/electron
that referenced
this pull request
Nov 19, 2025
Revert "fix: move BrowserWindow's WebContentsView to be a child of rootview (electron#41256)" This reverts commit 76f7bbb. Additionally reverts commit 7d045dc to support prior revert. Patch-Filename: fix_revert_change_that_broke_nvda_screen_reader.patch
aconverse
pushed a commit
to discord/electron
that referenced
this pull request
Nov 21, 2025
Revert "fix: move BrowserWindow's WebContentsView to be a child of rootview (electron#41256)" This reverts commit 76f7bbb. Additionally reverts commit 7d045dc to support prior revert. Patch-Filename: fix_revert_change_that_broke_nvda_screen_reader.patch
wittjeff
added a commit
to wittjeff/electron
that referenced
this pull request
Sep 3, 2026
Since the BrowserWindow's WebContentsView became a sibling of the window's contentView painted beneath it (electron#41256), the empty contentView container has been exposed to assistive technology as an empty pane covering the whole window. ViewAXPlatformNodeDelegate::HitTestSync searches children topmost-first and returns the empty pane, so screen reader hit-tests (e.g. NVDA mouse tracking) can no longer reach the web contents beneath it. Mark a default-constructed api::View's plain container as ignored and invisible to accessibility while it has no children. Ignored removes the empty pane from the accessibility tree; invisible makes AX hit-tests skip it so they fall through to the web contents. The state is cleared as soon as child views are added, so contentView-based layouts (e.g. multiple WebContentsViews) are still fully exposed to assistive technology. This follows the pattern of Chromium's ash::NonAccessibleView. Fixes electron#42945 Co-Authored-By: Claude Fable 5 <[email protected]>
3 of 4 tasks
3 tasks done
dyc
pushed a commit
to discord/electron
that referenced
this pull request
Sep 9, 2026
Revert "fix: move BrowserWindow's WebContentsView to be a child of rootview (electron#41256)" This reverts commit 76f7bbb. Additionally reverts commit 7d045dc to support prior revert. Patch-Filename: fix_revert_change_that_broke_nvda_screen_reader.patch
This was referenced Oct 25, 2026
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.
Description of Change
Fixes #41141.
Previously, BrowserWindow#contentView was a reference to the BrowserWindow's
WebContentsView, and any child views that were added would be children of the
WebContentsView. This caused some strange behavior, including BrowserViews
sometimes being painted behind the BrowserWindow's web contents.
This PR has BrowserWindow's WebContentsView be a sibling to the content view,
inserted before it, so that the BrowserWindow's WebContents will always display
behind its children as intended.
It also prevents users from doing dangerous, unsupported and probably entirely
broken things like swapping out the BrowserWindow's contentView for another
view.
Checklist
npm testpassesRelease Notes
Notes: Fixed an issue where child views in a BrowserWindow could sometimes be
painted behind the main web content.