New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 815187 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug



Sign in to add a comment

Avoid solid color flash during cross-process navigation

Project Member Reported by samans@chromium.org, Feb 23 2018

Issue description

Currently if a navigation involves creating a new RenderWidget in a new process we see a flash before the new widget draws something.
 

Comment 1 by creis@chromium.org, Apr 5 2018

Cc: kinuko@chromium.org creis@chromium.org abdulsyed@chromium.org chrishtr@chromium.org nasko@chromium.org
Components: UI>Browser>Navigation Internals>Sandbox>SiteIsolation
Labels: -Pri-3 Target-67 M-67 OS-Chrome OS-Linux OS-Mac OS-Windows Pri-1
Adding Site Isolation and Navigation components, since Site Isolation will generate a much higher number of cross-process navigations.  Thanks for looking into this!  Sounds like you've got a start on it in https://chromium-review.googlesource.com/c/chromium/src/+/995915.

As discussed, let's try to aim for M67 if possible, since that's when we're trying to enable Site Isolation on desktop.
This proposal is great -- leaving the old content present until navigation is much better than flashing a "better solid color" during navigation.
ccameron: Unfortunately when I try the same approach on Mac I still see a flash. Please see this recording. The code is here:
https://chromium-review.googlesource.com/c/chromium/src/+/999212 
Do you know what the problem is?
macflash.mov
12.4 MB View Download
It may have to do with how we recycle ui::Compositors. I can take a look at it.
That would be great, thanks! I really don't want Mac to be left out.
Hmm, the flashed frame seems to be a solid color. I'll dig in a bit.
Here are some before/after videos. If you have a dark theme, the flashes are very visible and very annoying...
before.mp4
755 KB View Download
after.mp4
875 KB View Download
For macOS there are a couple of changes that need to be made to the patch
1. Update BrowserCompositorMac::TakeFallbackContentFrom to make |this| steal |other|'s ui::Compositor. Couple issues here
- the ui::Compositor recycling needs to be LIFO not FIFO
- we need to make sure that |this| doesn't request a ui::Compositor too soon
2. Add "don't blow away my content" mode to AcceleratedWidgetMac::ResetNSView
- this currently destroys all content on transitions
- needs to be updated to selectively not do that

Even with these changes, for some reason, my very first transition off of the NTP still has a flash ... I'll look into that.

Attaching a video of the result. Feel free to land your patch with macOS as NOTIMPLEMENTED and I can follow up with the various mac inanities...
no-flash3.mov
5.2 MB View Download
Summary: Avoid solid color flash during cross-process navigation (was: Content rendering timeout for cross-process navigation)
Awesome :)
Project Member

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

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

commit 26a1fcd6828003a59683b609476c03c71704a34e
Author: Saman Sami <samans@chromium.org>
Date: Tue Apr 10 17:12:21 2018

Avoid flash during cross-process navigation

During navigation, if the new page is rendered by the same RenderWidget
as the previous page, we don't hide the previous page until the new
page has something to show. However, when the new page has to be
rendered by a new RenderWidget we always show a flash during
navigation. Two common cases are:
- When user navigates by typing a new URL into the omnibox.
- Any cross-site navigation when site isolation is enabled.
Avoid the flash in these cases by showing the old page until the new
page paints. If the new page fails to paint within 4 seconds, we hide
the previous page for security reasons. This CL only applies to Aura
platforms and Android because no matter what I do on Mac I still see
a flash.

Bug:  815187 
Change-Id: I15345adcdfd8f8ef2ac2aedfe62958ba5621f6f6
Reviewed-on: https://chromium-review.googlesource.com/995915
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: ccameron <ccameron@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549566}
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/chrome/browser/ui/browser.cc
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/frame_host/render_frame_host_manager.cc
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/delegated_frame_host.cc
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/delegated_frame_host.h
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/input/timeout_monitor.cc
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/input/timeout_monitor.h
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/render_widget_host_impl.cc
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/render_widget_host_impl.h
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/render_widget_host_view_android.cc
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/render_widget_host_view_android.h
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/render_widget_host_view_aura.cc
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/render_widget_host_view_aura.h
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/render_widget_host_view_child_frame.cc
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/render_widget_host_view_child_frame.h
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/render_widget_host_view_mac.h
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/browser/renderer_host/render_widget_host_view_mac.mm
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/public/browser/render_widget_host_view.h
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/renderer/render_widget.cc
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/test/test_render_view_host.cc
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/content/test/test_render_view_host.h
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/ui/android/delegated_frame_host_android.cc
[modify] https://crrev.com/26a1fcd6828003a59683b609476c03c71704a34e/ui/android/delegated_frame_host_android.h

Project Member

Comment 11 by bugdroid1@chromium.org, Apr 11 2018

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

commit 6240437d9d5b78fb0e6126862d5c75753aab5d4c
Author: Saman Sami <samans@chromium.org>
Date: Wed Apr 11 00:18:55 2018

Add DCHECK to RWHVAndroid::DestroyDelegatedContent

I removed a DCHECK by mistake in crrev.com/c/995915. Also add a
comment.

Bug:  815187 
Change-Id: I5bffc2b23358a56ebf3a35621c6c9f2970519b58
Reviewed-on: https://chromium-review.googlesource.com/1005785
Reviewed-by: Khushal <khushalsagar@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Saman Sami <samans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549690}
[modify] https://crrev.com/6240437d9d5b78fb0e6126862d5c75753aab5d4c/content/browser/renderer_host/render_widget_host_view_android.cc
[modify] https://crrev.com/6240437d9d5b78fb0e6126862d5c75753aab5d4c/ui/android/delegated_frame_host_android.cc

Project Member

Comment 12 by bugdroid1@chromium.org, Apr 16 2018

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

commit e012b9d687352dc9a126f35c2c98b2a17af3ce1d
Author: Saman Sami <samans@chromium.org>
Date: Mon Apr 16 20:35:30 2018

content: Don't clear background page if rendering timeout is disabled

The behaviour changed in crrev.com/c/995915 and some headless tests
are failing as a result.

Bug:  815187 
Change-Id: Iff689a1a8ef0d0b464cf13701034bcca94ef0cf2
Reviewed-on: https://chromium-review.googlesource.com/1014015
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Saman Sami <samans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551100}
[modify] https://crrev.com/e012b9d687352dc9a126f35c2c98b2a17af3ce1d/content/browser/renderer_host/render_widget_host_impl.cc

Labels: TE-Verified-M68 TE-Verified-68.0.3398.0
Able to reproduce the issue on build without fix(checked on 66.0.3353.0) hence verifying the fix on latest canary 67.0.3398.0 on mac 10.13.3 , Linux and Windows 10.

Now no black flash is seen on navigating between pages when black theme is enabled. Attaching video for reference.

As fix is working as intended adding Verified labels.

Thanks!
815187.mp4
2.3 MB View Download
Project Member

Comment 14 by bugdroid1@chromium.org, Apr 17 2018

Labels: merge-merged-testbranch
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e012b9d687352dc9a126f35c2c98b2a17af3ce1d

commit e012b9d687352dc9a126f35c2c98b2a17af3ce1d
Author: Saman Sami <samans@chromium.org>
Date: Mon Apr 16 20:35:30 2018

content: Don't clear background page if rendering timeout is disabled

The behaviour changed in crrev.com/c/995915 and some headless tests
are failing as a result.

Bug:  815187 
Change-Id: Iff689a1a8ef0d0b464cf13701034bcca94ef0cf2
Reviewed-on: https://chromium-review.googlesource.com/1014015
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Saman Sami <samans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551100}
[modify] https://crrev.com/e012b9d687352dc9a126f35c2c98b2a17af3ce1d/content/browser/renderer_host/render_widget_host_impl.cc

Status: Fixed (was: Assigned)
Marking as fixed. Work on Mac can be tracked here:
https://bugs.chromium.org/p/chromium/issues/detail?id=829523

Comment 16 by creis@chromium.org, Apr 26 2018

Thanks samans@!  I notice that r551100 landed in 68.0.3398.0, after the branch.  Does it need to be merged to M67?
Labels: Merge-Request-67
I would like to merge this CL into M67 branch. https://chromium-review.googlesource.com/c/chromium/src/+/1010702

There is no risk associated with this CL whatsoever. Without this CL chrome will segfault if run with --disable-new-content-rendering-timeout.
16: I don't believe a merge is necessary for my CL, but the CL in #17 should probably be merged in.
Project Member

Comment 19 by sheriffbot@chromium.org, Apr 26 2018

Labels: -Merge-Request-67 Merge-Review-67 Hotlist-Merge-Review
This bug requires manual review: M67 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), kbleicher@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-67 Merge-Approved-67
Approving merge for CL : https://chromium-review.googlesource.com/c/chromium/src/+/1010702 to M67 branch 3396 based on comment #17. Please merge ASAP. Thank you.
Labels: -Merge-Approved-67 merge-merged-3396
Merged: https://chromium-review.googlesource.com/c/chromium/src/+/1030511

Sign in to add a comment