From 8d93c66cb0dc81e6ac18fb2a6049e3844513a536 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Wed, 28 Jan 2015 17:42:23 -0500 Subject: [PATCH] Bug 1116588 - Don't optimize away opacity:0 items if we're building event regions, unless the frame also has pointer-events:none. r=tn --- layout/base/nsDisplayList.cpp | 4 ---- layout/generic/nsFrame.cpp | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 2090e2441670..9d3948e87263 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -3735,10 +3735,6 @@ already_AddRefed nsDisplayOpacity::BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const ContainerLayerParameters& aContainerParameters) { - if (mOpacity == 0 && mFrame->GetContent() && - !nsLayoutUtils::HasAnimations(mFrame->GetContent(), eCSSProperty_opacity)) { - return nullptr; - } nsRefPtr container = aManager->GetLayerBuilder()-> BuildContainerLayerFor(aBuilder, aManager, mFrame, this, &mList, aContainerParameters, nullptr); diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index fb8f705c2be8..a26dff22b199 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1952,10 +1952,13 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder, // we're painting, and we're not animating opacity. Don't do this // if we're going to compute plugin geometry, since opacity-0 plugins // need to have display items built for them. + bool needEventRegions = aBuilder->IsBuildingLayerEventRegions() && + StyleVisibility()->GetEffectivePointerEvents(this) != NS_STYLE_POINTER_EVENTS_NONE; if (disp->mOpacity == 0.0 && aBuilder->IsForPainting() && !aBuilder->WillComputePluginGeometry() && !(disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_OPACITY) && - !nsLayoutUtils::HasAnimations(mContent, eCSSProperty_opacity)) { + !nsLayoutUtils::HasAnimations(mContent, eCSSProperty_opacity) && + !needEventRegions) { return; }