Closed Bug 1013392 Opened 6 years ago Closed 6 years ago

APZ should move the scrollbar thumb, not the whole scrollbar

Categories

(Core :: Panning and Zooming, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(2 files, 2 obsolete files)

On Mac, once an overlay scrollbars has been hovered, it shows the scrollbar track in its background. Async panning applies an async transform to the whole scrollbar, so the scrollbar track can shift during an async pan.
The scrollbar track should always stay in place and only the scrollbar thumb should be moved. This probably depends on bug 1009679.
Assignee: nobody → mstange
Status: NEW → ASSIGNED
This creates an nsDisplayOwnLayer for the scrollbar thumb and sets the scroll target ID and the scrollbar type on that instead of on the outer nsDisplayOwnLayer of the scrollbar.
Attachment #8429484 - Flags: review?(roc)
The annotated container layer can now be nested inside another container layer (the one for the scrollbar itself), and for non-overlay scrollbars it can even be below the scrolled layer in z-order.
This traversal looks expensive, but I'm not that worried about performance because layer trees are usually of a manageable size, and usually the scrolled layer is somewhere near the scrollbar layer, so the search should terminate quickly in almost all cases.
Attachment #8429490 - Flags: review?(bugmail.mozilla)
fix build after bug 508665
Attachment #8429484 - Attachment is obsolete: true
Attachment #8429484 - Flags: review?(roc)
Attachment #8429497 - Flags: review?(roc)
Comment on attachment 8429490 [details] [diff] [review]
part 2: find the scroll target in the layer tree

Review of attachment 8429490 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/composite/AsyncCompositionManager.cpp
@@ +684,5 @@
>  
> +static Layer*
> +FindScrolledLayerForScrollbar(ContainerLayer* aLayer, bool* aOutIsAncestor)
> +{
> +  // Search all siblings of aLayer and its ancestors.

nit: s/and its/and of its/ just to make it less ambiguous
Attachment #8429490 - Flags: review?(bugmail.mozilla) → review+
The reftest fails because the two bottom scrollboxes in the left half of layout/reftests/text-overflow/xulscroll.html get less intense subpixel antialiasing. I don't yet understand how that can happen - the scrollbar thumb should already have had its own layer due to bug 1009679, I'm not sure why an additional ContainerLayer could break something.
updated to apply on top of bug 1018309
Attachment #8429497 - Attachment is obsolete: true
Depends on: 1019737
With bug 1019737 the test will not fail any more, because the scroll frames in that test aren't actually scrolled, so we will no longer layerize the scrollbar thumbs, and no component alpha layers will be created.
I forgot to initialize the fields I added to nsDisplayListBuilder. I pushed https://hg.mozilla.org/integration/mozilla-inbound/rev/0044cb69854a to fix that.
You need to log in before you can comment on or make changes to this bug.