Bug 1469220 - Backed out changeset 7fc66c715a0f and 39cb4d5f6602. r=mattwoodrow

Those changesets which are related to animations introduced in bug 1462497
seems to cause new crashes.  I think the first two changesets for the bug fixed
the original crash cases but the last two (i.e. these changesets) introduced
other crashes unfortunately.

MozReview-Commit-ID: 9LD2hIIXA2y

--HG--
extra : rebase_source : 102c5532128039dcf8274c214e17d58d9a1aa483
This commit is contained in:
Hiroyuki Ikezoe 2018-06-18 06:16:07 +09:00
parent b30ac6aacd
commit afa2fcd95a
7 changed files with 7 additions and 37 deletions

View File

@ -259,9 +259,8 @@ MayHaveAnimationOfProperty(EffectSet* effects, nsCSSPropertyID aProperty)
return true;
}
bool
nsLayoutUtils::MayHaveAnimationOfProperty(const nsIFrame* aFrame,
nsCSSPropertyID aProperty)
static bool
MayHaveAnimationOfProperty(const nsIFrame* aFrame, nsCSSPropertyID aProperty)
{
switch (aProperty) {
case eCSSProperty_transform:
@ -278,7 +277,7 @@ bool
nsLayoutUtils::HasAnimationOfProperty(EffectSet* aEffectSet,
nsCSSPropertyID aProperty)
{
if (!aEffectSet || !::MayHaveAnimationOfProperty(aEffectSet, aProperty)) {
if (!aEffectSet || !MayHaveAnimationOfProperty(aEffectSet, aProperty)) {
return false;
}
@ -314,7 +313,7 @@ nsLayoutUtils::HasEffectiveAnimation(const nsIFrame* aFrame,
nsCSSPropertyID aProperty)
{
EffectSet* effects = EffectSet::GetEffectSet(aFrame);
if (!effects || !::MayHaveAnimationOfProperty(effects, aProperty)) {
if (!effects || !MayHaveAnimationOfProperty(effects, aProperty)) {
return false;
}
@ -328,17 +327,6 @@ nsLayoutUtils::HasEffectiveAnimation(const nsIFrame* aFrame,
);
}
bool
nsLayoutUtils::MayHaveEffectiveAnimation(const nsIFrame* aFrame,
nsCSSPropertyID aProperty)
{
EffectSet* effects = EffectSet::GetEffectSet(aFrame);
if (!effects || !::MayHaveAnimationOfProperty(effects, aProperty)) {
return false;
}
return true;
}
static float
GetSuitableScale(float aMaxScale, float aMinScale,
nscoord aVisibleDimension, nscoord aDisplayDimension)

View File

@ -2334,8 +2334,6 @@ public:
*/
static bool HasAnimationOfProperty(const nsIFrame* aFrame,
nsCSSPropertyID aProperty);
static bool MayHaveAnimationOfProperty(const nsIFrame* aFrame,
nsCSSPropertyID aProperty);
/**
* Returns true if |aEffectSet| has an animation of |aProperty| regardless of
@ -2350,8 +2348,6 @@ public:
*/
static bool HasEffectiveAnimation(const nsIFrame* aFrame,
nsCSSPropertyID aProperty);
static bool MayHaveEffectiveAnimation(const nsIFrame* aFrame,
nsCSSPropertyID aProperty);
/**
* Checks if off-main-thread animations are enabled.

View File

@ -2952,12 +2952,9 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
// layer (for async animations), see
// nsSVGIntegrationsUtils::PaintMaskAndClipPath or
// nsSVGIntegrationsUtils::PaintFilter.
// Use MayNeedActiveLayer to decide, since we don't want to condition the wrapping
// display item on values that might change silently between paints (opacity activity
// can depend on the will-change budget).
bool useOpacity = HasVisualOpacity(effectSet) &&
!nsSVGUtils::CanOptimizeOpacity(this) &&
(!usingSVGEffects || nsDisplayOpacity::MayNeedActiveLayer(this));
(!usingSVGEffects || nsDisplayOpacity::NeedsActiveLayer(aBuilder, this));
bool useBlendMode = effects->mMixBlendMode != NS_STYLE_BLEND_NORMAL;
bool useStickyPosition = disp->mPosition == NS_STYLE_POSITION_STICKY &&
IsScrollFrameActive(aBuilder,

View File

@ -458,11 +458,7 @@ ActiveLayerTracker::IsStyleAnimated(nsDisplayListBuilder* aBuilder,
if (aProperty == eCSSProperty_transform && aFrame->Combines3DTransformWithAncestors()) {
return IsStyleAnimated(aBuilder, aFrame->GetParent(), aProperty);
}
if (aBuilder) {
return nsLayoutUtils::HasEffectiveAnimation(aFrame, aProperty);
} else {
return nsLayoutUtils::MayHaveEffectiveAnimation(aFrame, aProperty);
}
return nsLayoutUtils::HasEffectiveAnimation(aFrame, aProperty);
}
/* static */ bool

View File

@ -6309,12 +6309,6 @@ nsDisplayOpacity::NeedsActiveLayer(nsDisplayListBuilder* aBuilder, nsIFrame* aFr
return false;
}
/* static */ bool
nsDisplayOpacity::MayNeedActiveLayer(nsIFrame* aFrame)
{
return ActiveLayerTracker::IsStyleMaybeAnimated(aFrame, eCSSProperty_opacity);
}
void
nsDisplayOpacity::ApplyOpacity(nsDisplayListBuilder* aBuilder,
float aOpacity,

View File

@ -5186,7 +5186,6 @@ public:
bool OpacityAppliedToChildren() const { return mOpacityAppliedToChildren; }
static bool NeedsActiveLayer(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame);
static bool MayNeedActiveLayer(nsIFrame* aFrame);
NS_DISPLAY_DECL_NAME("Opacity", TYPE_OPACITY)
virtual void WriteDebugInfo(std::stringstream& aStream) override;

View File

@ -1295,7 +1295,7 @@ nsSVGUtils::CanOptimizeOpacity(nsIFrame *aFrame)
return false;
}
if (nsLayoutUtils::MayHaveAnimationOfProperty(aFrame, eCSSProperty_opacity)) {
if (nsLayoutUtils::HasAnimationOfProperty(aFrame, eCSSProperty_opacity)) {
return false;
}