Closed Bug 1019737 Opened 10 years ago Closed 10 years ago

Only layerize the scrollbar thumb if the target scroll frame has active scrolling

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(1 file)

Bug 1009679 made it so that all scrollbar thumbs always get their own layer, and somewhat accidentally also enabled layerizing for the video controls scrubber.

However, we don't actually need to give the thumbs their own layers until their scroll frame has active scrolling. With APZ, the compositor won't even attempt to move them until the scroll frame has its own scroll layer. And as soon as a display port has been set, ScrollFrameHelper::mShouldBuildScrollableLayer is set to true, and that makes IsScrollingActive() return true, so with this patch we'll keep layerizing the thumb as soon as a display port has been set.

nsLayoutUtils::GetAnimatedGeometryRootFor needs to know whether to build a layer for a thumb frame, and finding the target scroll frame from the thumb seems complicated, so this patch sets a frame property on the thumb frame while ScrollFrameHelper::AppendScrollPartsTo builds the scrollbar display items. 

scrollTargetId is NULL_SCROLL_ID iff the scroll frame is inactive.
Attachment #8433456 - Flags: review?(roc)
Comment on attachment 8433456 [details] [diff] [review]
v1

>diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpphumbLayerized, nullptr)

>+static bool
>+IsScrollbarThumbLayerized(nsIFrame* aThumbFrame)
>+{
>+  return reinterpret_cast<intptr_t>(f->Properties().Get(ScrollbarThumbLayerized()));

this should be aThumbFrame->Properties of course
Comment on attachment 8433456 [details] [diff] [review]
v1

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

::: layout/base/nsLayoutUtils.h
@@ +484,5 @@
>    /**
> +   * Store whether aThumbFrame wants its own layer. This sets a property on
> +   * the frame.
> +   */
> +  static void ToggleScrollbarThumbLayerization(nsIFrame* aThumbFrame, bool aLayerize);

You mean "SetScrollbarThumbLayerization".
Attachment #8433456 - Flags: review?(roc) → review+
https://hg.mozilla.org/mozilla-central/rev/083854f3d590
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Depends on: 1021420
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: