If we always align the new scroll position with the previous scroll position, we can accumulate error and
gradually drift out of alignment with the layer pixels until we exceed the tolerance and are forced to
rerender everything.
Fix the size check in nsDisplayBackground::ShouldFixToViewport so that async
scrolling of fixed backgrounds works correctly when zoomed in on Firefox
Mobile. Also make IsFixedItem in nsDisplayList public and use it in
FrameLayerBuilder, so that fixed items are determined and treated consistently.
The underlying frame of an nsDisplayScrollLayer can change and end up returning
different values when finding the active scrolled root. Instead of relying on
display-item ordering/merging, get the scrolled frame from the item (which was
already storing it).
This changes the display-item storage to store layers against the underlying
frame and all merged frames of an item (and similarly, to retrieve them against
all frames of an item).
As well as storing the container layer against the underlying frame of the
container item, store it against its merged frames as well. In addition, check
for old container layers against merged frames when building a container layer.
This protects against losing the layer when the underlying frame of a container
item changes to either a new frame or an existing, merged frame.
Rather than relying on a particular ordering of layers in
ContainerState::Finish, use ContainerLayer::Reposition to more reliably remove
old, unused layers.
This changes the display-item storage to store layers against the underlying
frame and all merged frames of an item (and similarly, to retrieve them against
all frames of an item).
As well as storing the container layer against the underlying frame of the
container item, store it against its merged frames as well. In addition, check
for old container layers against merged frames when building a container layer.
This protects against losing the layer when the underlying frame of a container
item changes to either a new frame or an existing, merged frame.
Instead of forcing a full-layer invalidation when new frames appear, invalidate
only the bounds of the frame. Invalidating untrusted geometry still causes a
full-layer invalidation.
As clip items aren't processed, they have no associated layer entries. This is
a problem when a clip item's underlying frame is the same as one that gets
merged into a container layer, as display-item data will be created, but no
layer entry will be added. This will cause it to be removed on the next
layer-build, and cause a full invalidation.
Fix this by adding an 'mIsMergedFrame' entry to DisplayItemDataEntry and setting
it on all merged frames in BuildContainerLayerFor. This property stops the
entry from being removed when it gets updated.
Since Bug 758620, it's possible for an nsDisplayTransform to appear as the
child of a container layer. This caused problems when it was inactive, as the
invalidation would not be transformed in this case.
Fix this in FrameLayerBuilder by mandating that InvalidateThebesLayerContents
takes the untransformed invalidation and apply the transform in
BuildContainerLayer.