New issue
Advanced search Search tips

Issue 826286 link

Starred by 4 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug



Sign in to add a comment

MacViews: grey frames drawn for new tabs

Project Member Reported by ellyjo...@chromium.org, Mar 27 2018

Issue description

When creating a new tab, the first few drawn frames are a dark grey instead of white, which creates a strange grey flash.
 
My guess is that the browser window has this grey in the background, behind the RenderWidgetHostViewMac.

A thought: perhaps we should make RenderWidgetHostViewMac not create its own ui::Compositor, but rather insert its ui::Layer into the ui::Compositor of its browser window? The NSView for RenderWidgetHostViewMac can then just be transparent and be used only for events.
Owner: sdy@chromium.org
Assigning this overall to sdy@ - please work with ccameron@ on fixing this and the related frame-slinging issues.
To help visualize:

In the following picture, I lie to the RHWVMac's ui::Compositor and tell it that it's 1/2 the size that it is. You can see the grey background that is exposed where the RHWVMac has retreated from.

So that grey ui::Layer (wherever it is) should...
- should probably be set the theme background color!
- should be the parent of the ui::Layer allocated in BrowserCompositorMac

background.png
73.6 KB View Download
Alternatively... in the Cocoa version at [1] we have 
  // Make sure we do not draw any transient arrangements of views.
  gfx::ScopedCocoaDisableScreenUpdates cocoa_disabler;

While in the BrowserView::OnActiveTabChanged version at [2], we don't do anything like that.

It may be that we can get away with just doing a scoped disabler (for now).

[1] https://cs.chromium.org/chromium/src/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm?rcl=5c8eb661ff1eef3c0fb0d56061ff6ff990f4443c&l=602

[2] https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/browser_view.cc?rcl=eeed7dfe9a57495020586b071c56dec3590f83fb&l=741
Nope that didn't work (odd).

Btw, the grey background color comes from ContentsWebView::OnThemeChanged().

Comment 6 by sdy@chromium.org, Apr 4 2018

Components: Internals>Views
Labels: -Target-67 Proj-MacViews Target-68

Comment 7 by sdy@chromium.org, Apr 4 2018

Labels: -Target-68 Target-67
** Bulk Edit **

There is only one dev release left 04/10 before M67 branch on 04/12. Please try to land the fix ASAP to trunk so we can move forward with 50%-50% experiment on M67 Canary/Dev (if possible at all). Thank you.

FYI: Change/Fix has to be landed in trunk latest by 4:00 PM PT, Friday (04/06) so we can pick it up for next week dev release. 
Cc: samans@chromium.org
samans' work in  issue 815187  may help out here.
Project Member

Comment 10 by bugdroid1@chromium.org, Apr 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bca650f44b0a42e4faa87aaf09018a232dbac9f7

commit bca650f44b0a42e4faa87aaf09018a232dbac9f7
Author: Christopher Cameron <ccameron@chromium.org>
Date: Sat Apr 07 06:47:59 2018

mac: Fix flashing of grey at tab creation, destruction, etc

The ContentsWebView behind our WebContents is colored dark for tab
capture's letterbox mode.

On Aura, this is always covered up by the content::RenderWidgetHostView,
which adds its own ui::Layers into the heirarchy.

In MacViewsBrowser the content::RenderWidgetHostView is an NSView
which is updated asynchronously to the ui::Compositor, which can result
in flashes at any number of times (resize, creation, removal, etc).

Change ContentsWebView to receive a callback when we are in tab capture
letterbox mode, and only change its background to be dark when we are
in that mode.

Bug:  826286 
Change-Id: I89b3961da01d35f61da6717db659f87b9701ef5d
Reviewed-on: https://chromium-review.googlesource.com/999267
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Reviewed-by: ccameron <ccameron@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549045}
[modify] https://crrev.com/bca650f44b0a42e4faa87aaf09018a232dbac9f7/chrome/browser/ui/views/frame/contents_web_view.cc
[modify] https://crrev.com/bca650f44b0a42e4faa87aaf09018a232dbac9f7/chrome/browser/ui/views/frame/contents_web_view.h
[modify] https://crrev.com/bca650f44b0a42e4faa87aaf09018a232dbac9f7/ui/views/controls/webview/webview.cc
[modify] https://crrev.com/bca650f44b0a42e4faa87aaf09018a232dbac9f7/ui/views/controls/webview/webview.h

Labels: M-67
Can this be marked as fixed if nothing else is pending?
I'm waiting for a Canary to spin with this to make sure.
OK,SGTM. Thank you.
Labels: TE-Verified-M67 TE-Verified-67.0.3393.0
Able to reproduce this issue on Mac OS 10.13.3 on the build without fix 67.0.3386.0 and the issue is fixed on the latest Canary 67.0.3393.0 as per  issue 815187 .

By enabling #views-browser-windows flag, cannot observe flash while switching between two sites.
Attached is the screen cast for reference.

Hence adding TE verified labels as the fix is working as intended.

Thanks..
826286-M67.mp4
1.8 MB View Download

Comment 15 by sdy@chromium.org, Apr 10 2018

Cc: -ccameron@chromium.org sdy@chromium.org
Owner: ccameron@chromium.org
Status: Verified (was: Assigned)
Feel free to reassign this to me if more needs to happen, but assigning to ccameron@ for 'credit'.

Sign in to add a comment