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

This commit is contained in:
Kartikaya Gupta 2015-01-28 17:42:23 -05:00
Родитель b1a4f5854a
Коммит 8d93c66cb0
2 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -3735,10 +3735,6 @@ already_AddRefed<Layer>
nsDisplayOpacity::BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aContainerParameters) {
if (mOpacity == 0 && mFrame->GetContent() &&
!nsLayoutUtils::HasAnimations(mFrame->GetContent(), eCSSProperty_opacity)) {
return nullptr;
}
nsRefPtr<Layer> container = aManager->GetLayerBuilder()->
BuildContainerLayerFor(aBuilder, aManager, mFrame, this, &mList,
aContainerParameters, nullptr);

Просмотреть файл

@ -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;
}