Closed Bug 1209964 Opened 9 years ago Closed 9 years ago

Async adjustment of ImageLayers gets confused by ImageLayer transform (fixed background-image jiggles)

Categories

(Core :: Panning and Zooming, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: mstange, Assigned: botond)

References

Details

Attachments

(3 files)

Attached file testcase
STR:
 1. Load the testcase.
 2. Ensure the image is completely visible (not clipped), resize your window if necessary.
 3. Scroll.

The image should stay fixed, but it jiggles up and down.

The 256x256 image gets turned into an ImageLayer which has a transform to scale it up to 512x512 CSS pixels, as required by the background-size value.
Blocks: 1206096
Assignee: nobody → botond
The problem is with the calculations inside AlignedFixedAndStickyLayers(). They assume that the calculated cumulative transforms (|oldCumulativeTransform| and |newCumulativeTransform|) apply on top of the fixed layer's own transform, but in the case where the fixed layer is the same as the subtree root (as here), the cumulative transforms already include the layer's own transform.
(In reply to Botond Ballo [:botond] from comment #1)
> but in the case where the fixed layer is the
> same as the subtree root (as here), the cumulative transforms already
> include the layer's own transform.

(because they are part of the incoming |aPreviousTransformForRoot| and |aCurrentTransformForRoot|).
I took this opportunity to rework the code that calculates |translation| in AlignFixedAndStickyLayers(). It still does the same thing (modulo the fix for this bug), but I think it's expressed a bit more clearly now.
Bug 1209964 - In AlignFixedAndStickyLayers(), properly handle the case where a fixed or sticky layer is its own subtree root and has a local transform. r=kats
Attachment #8669244 - Flags: review?(bugmail.mozilla)
Bug 1209964 - Reftest. r=mstange
Attachment #8669245 - Flags: review?(mstange)
Comment on attachment 8669244 [details]
MozReview Request: Bug 1209964 - In AlignFixedAndStickyLayers(), properly handle the case where a fixed or sticky layer is its own subtree root and has a local transform. r=kats

https://reviewboard.mozilla.org/r/21173/#review19059

Thanks! This code is much easier to follow than the old code (which I'm not ashamed to admit I fall asleep trying to understand).

::: gfx/layers/composite/AsyncCompositionManager.cpp:401
(Diff revision 1)
> -
> +  // Offset the layer's anchor point to make sure to make sure fixed position

"to make sure" is repeated
Attachment #8669244 - Flags: review?(bugmail.mozilla) → review+
Comment on attachment 8669245 [details]
MozReview Request: Bug 1209964 - Reftest. r=mstange

https://reviewboard.mozilla.org/r/21175/#review19103
Attachment #8669245 - Flags: review?(mstange) → review+
(In reply to Pulsebot from comment #11)
> https://hg.mozilla.org/integration/mozilla-inbound/rev/6899c815160c

This was a follow-up to fuzz the reftest on B2G, where it was failing due to some one-pixel differences in the enlarged image.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: