Bug 1166301 - Layerize background images fixed to child elements. r=mattwoodrow

--HG--
extra : source : d5e8112052b1de93f41e15ea1ed6ccf80b498815
This commit is contained in:
Botond Ballo 2015-08-28 15:13:50 -04:00
parent 692b08c7cb
commit d86a4b0d3f

View File

@ -2360,15 +2360,14 @@ nsDisplayBackgroundImage::IsSingleFixedPositionImage(nsDisplayListBuilder* aBuil
bool
nsDisplayBackgroundImage::ShouldFixToViewport(LayerManager* aManager)
{
// APZ doesn't (yet) know how to scroll the visible region for these type of
// items, so don't layerize them if it's enabled.
if (nsLayoutUtils::UsesAsyncScrolling(mFrame) ||
(aManager && aManager->ShouldAvoidComponentAlphaLayers())) {
// APZ needs background-attachment:fixed images layerized for correctness.
if (!nsLayoutUtils::UsesAsyncScrolling(mFrame) &&
aManager && aManager->ShouldAvoidComponentAlphaLayers()) {
return false;
}
// Put background-attachment:fixed background images in their own
// compositing layer, unless we have APZ enabled
// compositing layer.
return mBackgroundStyle->mLayers[mLayer].mAttachment == NS_STYLE_BG_ATTACHMENT_FIXED &&
!mBackgroundStyle->mLayers[mLayer].mImage.IsEmpty();
}