Bug 1019737 - Only layerize the scrollbar thumb if the target scroll frame has active scrolling. r=roc

This commit is contained in:
Markus Stange
2014-06-04 14:44:26 +02:00
parent 6d04354113
commit 41ca71f4d4
4 changed files with 30 additions and 6 deletions

View File

@@ -1604,6 +1604,21 @@ nsLayoutUtils::IsFixedPosFrameInDisplayPort(const nsIFrame* aFrame, nsRect* aDis
return ViewportHasDisplayPort(aFrame->PresContext(), aDisplayPort);
}
NS_DECLARE_FRAME_PROPERTY(ScrollbarThumbLayerized, nullptr)
/* static */ void
nsLayoutUtils::SetScrollbarThumbLayerization(nsIFrame* aThumbFrame, bool aLayerize)
{
aThumbFrame->Properties().Set(ScrollbarThumbLayerized(),
reinterpret_cast<void*>(intptr_t(aLayerize)));
}
static bool
IsScrollbarThumbLayerized(nsIFrame* aThumbFrame)
{
return reinterpret_cast<intptr_t>(aThumbFrame->Properties().Get(ScrollbarThumbLayerized()));
}
static nsIFrame*
GetAnimatedGeometryRootForFrame(nsIFrame* aFrame,
const nsIFrame* aStopAtAncestor)
@@ -1625,10 +1640,11 @@ GetAnimatedGeometryRootForFrame(nsIFrame* aFrame,
if (!parent)
break;
nsIAtom* parentType = parent->GetType();
// Treat the slider thumb as being as an active scrolled root
// so that it can move without repainting.
if (parentType == nsGkAtoms::sliderFrame)
// Treat the slider thumb as being as an active scrolled root when it wants
// its own layer so that it can move without repainting.
if (parentType == nsGkAtoms::sliderFrame && IsScrollbarThumbLayerized(f)) {
break;
}
// Sticky frames are active if their nearest scrollable frame
// is also active, just keep a record of sticky frames that we
// encounter for now.