Closed Bug 940090 Opened 11 years ago Closed 6 years ago

Upscaled snapshot is visible for a brief moment when you start a swipe gesture

Categories

(Core :: Widget: Cocoa, defect, P2)

All
macOS
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: reuben, Unassigned)

References

Details

(Whiteboard: tpi:+)

After bug 836430 landed, you can see the upscaled snapshot for a brief moment as you start swiping.

Here's a video: https://dl.dropboxusercontent.com/u/10968786/swipe.mov
We clearly set the style.backgroundSize on the box element before assigning the snapshot to it, so I'm not quite sure why this happens. Also, I'm unable to reproduce myself. Is there anything special about your setup that could be the difference?
Flags: needinfo?(reuben.bmo)
Probably, I tried on a new profile and couldn't reproduce :(
I have no idea how this could be profile specific.
Flags: needinfo?(reuben.bmo)
FWIW, Christian can also reproduce this bug.
I'm able to reproduce it too (not everytime but often). I added a breakpoint in _scaleSnapshot and it was taking the HTMLImageElement path, meaning that there's the load listener delay in properly scaling it. Is it expected to take that path for normal pages (I thought it would be only for image documents)?

Strangely, even before the load event, it appears that aSnapshot had the correct width/height, but I'm not so sure on that because I was using the debugger and it was acting strange and crashed after some more testing.
(In reply to :Felipe Gomes from comment #4)
> Is it expected to take that path for normal pages (I thought it would be only for image
> documents)?

I think it is, it's called from installPrevAndNextSnapshots and the saved snapshots are converted from Blobs to ImageElements there.
(In reply to Reuben Morais [:reuben] from comment #5)
> (In reply to :Felipe Gomes from comment #4)
> > Is it expected to take that path for normal pages (I thought it would be only for image
> > documents)?
> 
> I think it is, it's called from installPrevAndNextSnapshots and the saved
> snapshots are converted from Blobs to ImageElements there.

That's right, both previous and next snapshots are Blobs and go the path of the load listener for scaling. Not exactly sure what to do here...
What about caching the width and height values on the snapshot object instead of having to wait for the image to load?
Blocks: 1382560
No longer blocks: 1382560
Priority: -- → P2
Whiteboard: tpi:+
The code in question here has been removed in bug 860493.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.