fix: crash when focusing WebView
webContents
(#43933)
fix: crash when focusing WebView Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
d8e3555e01
commit
a5f4f08a9e
2 changed files with 24 additions and 1 deletions
|
@ -3300,6 +3300,12 @@ void WebContents::Focus() {
|
|||
if (owner_window())
|
||||
owner_window()->Focus(true);
|
||||
#endif
|
||||
|
||||
// WebView uses WebContentsViewChildFrame, which doesn't have a Focus impl
|
||||
// and triggers a fatal NOTREACHED.
|
||||
if (is_guest())
|
||||
return;
|
||||
|
||||
web_contents()->Focus();
|
||||
}
|
||||
|
||||
|
@ -3728,7 +3734,8 @@ void WebContents::SetBackgroundColor(std::optional<SkColor> maybe_color) {
|
|||
|
||||
content::RenderWidgetHostView* rwhv = rfh->GetView();
|
||||
if (rwhv) {
|
||||
// RenderWidgetHostView doesn't allow setting an alpha that's not 0 or 255.
|
||||
// RenderWidgetHostView doesn't allow setting an alpha that's not 0 or
|
||||
// 255.
|
||||
rwhv->SetBackgroundColor(is_opaque ? color : SK_ColorTRANSPARENT);
|
||||
static_cast<content::RenderWidgetHostViewBase*>(rwhv)
|
||||
->SetContentBackgroundColor(color);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue