New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: replace BrowserView with WebContentsView #35658
Conversation
…es to webcontentsview
da434ce
to
b1c7457
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very much in favor of the direction these changes are taking the view-related classes. Cool to see classes move directly into JS. 👍👍
Do you happen to know whether the View
class is at all compatible with the design of BaseView
in #32890? Would be great if these two proposals could build off of each other.
My main comment on #32890 is that |
Release Notes Persisted
|
/trop run backport |
The backport process for this PR has been manually initiated - here we go! :D |
I have automatically backported this PR to "29-x-y", please check out #40759 |
@nornagon According to @BrandonXLF at #40301 (comment) this PR included a breaking change that made webviews non-transparent by default, are you fine if we merge #40301 which would revert the behavior change? |
I' ve reported issue for WebContentsView visibility on macOS: #41276 |
Why didn't I see any related documentation? |
In changelog:
But, |
@panther7, |
Description of Change
Replaces the experimental BrowserView API with a new WebContentsView API.
BaseWindow
, whichBrowserWindow
extends.the
BrowserWindow
docs. Ideally we could deduplicate this, but forusability and consistency (avoiding "where did all the BrowserWindow
methods go???" type questions), we should probably change the docs site to
account for that change, e.g. to have the duplication of docs for inherited
methods happen at render time.
BaseWindow
read-write property,contentView
.View
andWebContentsView
.WebContentsView
is the replacement for the oldBrowserView
class. Wealso expose and document the
View
class, because that is the typeof
BaseWindow.contentView
, to whichWebContentsView
s are added.View
properties and methods.removeChildView()
,children
,setBounds()
,getBounds()
,setBackgroundColor()
,setVisible()
.BrowserView
API and updates all references to it to point toWebContentsView
instead.WebContentsView
.BrowserView
API, whichunder the hood delegates to the new
WebContentsView
API.BrowserView
-specific draggable region handling. This will bereplaced with refactor: use views NonClientHitTest for draggable regions on mac #35603, but may need some more holes poked to enable draggable
regions to work correctly on all platforms in
WebContentsView
s.setAutoResize
to behave consistently on all platforms. (The behavior on macOS has been changed to match the behavior on Windows.)Still TODO:
This is done, I ported the autoresizing logic from C++ to JS.BrowserView
had options for auto-sizing. This isn't yet possible with thecurrently exposed APIs of
WebContentsView
/View
, but it should bedoable!
There is some code about compositor recycling for BrowserViews that I glazedI tested this using the example from fix: Disable new fade animation for BrowserViews #14911 and it seems like things are okay (no flickering)!over and removed in this PR. I'm not really sure how to test "is this still
working properly", but it deserves investigation.
Test that background colors are working properly.as far as I can tell, they are.Test that onbeforeunload works properly inWebContentsView
.Draggable regions are broken inWebContentsView
. I think this should be fixed with chore: Move draggable regions implementation from NativeBrowserView into InspectableWebContentsView #35007, so I'm going to say that doesn't block this PR from landing.Checklist
npm test
passesRelease Notes
Notes: Added
WebContentsView
andBaseWindow
, replacing the now-deprecatedBrowserView
APIs.