Closed Bug 1111632 Opened 10 years ago Closed 8 years ago

Cache background color of each tab

Categories

(Firefox :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX
Tracking Status
e10s + ---

People

(Reporter: blassey, Unassigned)

References

Details

We've talked about caching a screenshot of each tab to use during the transition of switching tabs but dismissed the idea as being too memory intensive. Perhaps as an in between step we can cache the background color of each tab and paint the surface that color during the transition between pages.

As a further note, I was thinking that the spinner would be overlayed on top of this background color if painting takes too long.
Alternatively, we could cache a lower-resolution greyscale screenshot, and put the spinner over top of it?
Discussion for this sort of thing already happened in bug 986782 (see comment 14, for example).

phlsa - what would be UX's preferred behaviour if the content process is blocked? Is comment 14 still the preferred approach? (Blue-sky it - pretend there are no graphics-layer limitations like comment 15 in tha tbug).
Flags: needinfo?(philipp)
Yes, I think the answer there still stands.

- Switch chrome immediately
- Wait for ~200ms with the content of the old tab still visible (we might want to experiment with that value)
- Show the cached content of the new tab (non-interactive) until it responds

We should be very careful with loading indicators here, since they are often making people »watch the clock«. Perhaps we should show one if the new tab takes longer than a few seconds to display, but that really shouldn't happen anyway…
Flags: needinfo?(philipp)
(In reply to Philipp Sackl [:phlsa] please use needinfo to make me respond from comment #3)
> Yes, I think the answer there still stands.
> 
> - Switch chrome immediately
> - Wait for ~200ms with the content of the old tab still visible (we might
> want to experiment with that value)
> - Show the cached content of the new tab (non-interactive) until it responds
By cached content I assume you mean a screen shot. There are several problems with this. The first being that keeping a screenshot around for all of your tabs (for a moderate to heavy user of tabs) will take up a massive amount of memory. The second being that if the window has changed size, the screenshot will not line up with the newly laid out page and that will be quite jarring.

We spent a lot of time trying to make caching screen shots work for fennec before finally concluding that the cases where it improves the user experience are actually quite narrow and the negatives far outweigh the positives. We can still try to make screenshots work for those narrow circumstances, but I'd strongly suggest you consider the cases where it'll work as the edge case and have a good story for general case.

> We should be very careful with loading indicators here, since they are often
> making people »watch the clock«. Perhaps we should show one if the new tab
> takes longer than a few seconds to display, but that really shouldn't happen
> anyway…
Flags: needinfo?(philipp)
Screen shots would be the ideal state (mobile Safari seems to make good use of them), so I included them since mconley said I should pretend limitations didn't exist ;)

The approach of using just the background color is a good step there
Flags: needinfo?(philipp)
Blocks: e10s-spinner
Flags: firefox-backlog+
PresShell's already have a GetCanvasBackground() function, and docshells try to propagate it from an existing document to a new document when it's setting up the new document. That might be a good starting point.
We instead got tab switching perf to be better, won't fix
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.