brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.73k stars 2.31k forks source link

Add an api to update newtab without flickering #20508

Open spylogsster opened 2 years ago

spylogsster commented 2 years ago

Description

In order to avoid flickering when opening a new tab we have to create an API to update background pages without flickering. I created a test branch rotation-test and recorded this video to show the problem:

https://user-images.githubusercontent.com/2965009/149548962-6e748639-b536-4351-a936-485850005a91.mp4

When we will have api to rotate new tab background images smoothly without white flash then we can update native side to call rotation instead of creation new tab every time in https://github.com/brave/brave-browser/issues/16078. This will also have a positive effect on the speed of opening new tabs for the user.

Steps to Reproduce

  1. Build rotation-test branch
  2. Call wireApiEventsToStore() in console
  3. See white flash of brackground on redraw

Actual result:

Expected result:

Reproduces how often:

100%

rebron commented 2 years ago

cc: @petemill @simonhong