Backed out 9 changesets (bug 1430884) for frequently failing dom/animation/test/mozilla/test_restyles.html on android-em-4-3-armv7-api16 debug
Backed out changeset 262dbc8daac1 (bug 1430884) Backed out changeset c3f9f3f66a98 (bug 1430884) Backed out changeset 39e1c4e3c8c9 (bug 1430884) Backed out changeset 4505e3f87b2e (bug 1430884) Backed out changeset e7e8977e0e92 (bug 1430884) Backed out changeset 6dbae2b8957d (bug 1430884) Backed out changeset 1e047fbcae2a (bug 1430884) Backed out changeset 52be07f10eaa (bug 1430884) Backed out changeset cec68a5b01da (bug 1430884)
This commit is contained in:
@@ -170,13 +170,13 @@ public:
|
||||
size_t Count() const { return mEffects.Count(); }
|
||||
|
||||
|
||||
const TimeStamp& LastOverflowAnimationSyncTime() const
|
||||
const TimeStamp& LastTransformSyncTime() const
|
||||
{
|
||||
return mLastOverflowAnimationSyncTime;
|
||||
return mLastTransformSyncTime;
|
||||
}
|
||||
void UpdateLastOverflowAnimationSyncTime(const TimeStamp& aRefreshTime)
|
||||
void UpdateLastTransformSyncTime(const TimeStamp& aRefreshTime)
|
||||
{
|
||||
mLastOverflowAnimationSyncTime = aRefreshTime;
|
||||
mLastTransformSyncTime = aRefreshTime;
|
||||
}
|
||||
|
||||
bool CascadeNeedsUpdate() const { return mCascadeNeedsUpdate; }
|
||||
@@ -207,14 +207,11 @@ private:
|
||||
OwningEffectSet mEffects;
|
||||
|
||||
|
||||
// Refresh driver timestamp from the moment when the animations which produce
|
||||
// overflow change hints in this effect set were last updated.
|
||||
|
||||
// This is used for animations whose main-thread restyling is throttled either
|
||||
// because they are running on the compositor or because they are not visible.
|
||||
// We still need to update them on the main thread periodically, however (e.g.
|
||||
// so scrollbars can be updated), so this tracks the last time we did that.
|
||||
TimeStamp mLastOverflowAnimationSyncTime;
|
||||
// Refresh driver timestamp from the moment when transform animations in this
|
||||
// effect set were last updated and sent to the compositor. This is used for
|
||||
// transform animations that run on the compositor but need to be updated on
|
||||
// the main thread periodically (e.g. so scrollbars can be updated).
|
||||
TimeStamp mLastTransformSyncTime;
|
||||
|
||||
// Dirty flag to represent when the mPropertiesWithImportantRules and
|
||||
// mPropertiesForAnimationsLevel on effects in this set might need to be
|
||||
|
||||
@@ -511,11 +511,11 @@ KeyframeEffect::ComposeStyle(
|
||||
ComposeStyleRule(aComposeResult, prop, *segment, computedTiming);
|
||||
}
|
||||
|
||||
// If the animation produces a change hint that affects the overflow region,
|
||||
// we need to record the current time to unthrottle the animation
|
||||
// If the animation produces a transform change hint that affects the overflow
|
||||
// region, we need to record the current time to unthrottle the animation
|
||||
// periodically when the animation is being throttled because it's scrolled
|
||||
// out of view.
|
||||
if (HasPropertiesThatMightAffectOverflow()) {
|
||||
if (HasTransformThatMightAffectOverflow()) {
|
||||
nsPresContext* presContext =
|
||||
nsContentUtils::GetContextForContent(mTarget->mElement);
|
||||
if (presContext) {
|
||||
@@ -524,7 +524,7 @@ KeyframeEffect::ComposeStyle(
|
||||
EffectSet::GetEffectSet(mTarget->mElement, mTarget->mPseudoType);
|
||||
MOZ_ASSERT(effectSet, "ComposeStyle should only be called on an effect "
|
||||
"that is part of an effect set");
|
||||
effectSet->UpdateLastOverflowAnimationSyncTime(now);
|
||||
effectSet->UpdateLastTransformSyncTime(now);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1193,46 +1193,6 @@ KeyframeEffect::OverflowRegionRefreshInterval()
|
||||
return kOverflowRegionRefreshInterval;
|
||||
}
|
||||
|
||||
bool
|
||||
KeyframeEffect::CanThrottleIfNotVisible(nsIFrame& aFrame) const
|
||||
{
|
||||
// Unless we are newly in-effect, we can throttle the animation if the
|
||||
// animation is paint only and the target frame is out of view or the document
|
||||
// is in background tabs.
|
||||
if (!mInEffectOnLastAnimationTimingUpdate || !CanIgnoreIfNotVisible()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIPresShell* presShell = GetPresShell();
|
||||
if (presShell && !presShell->IsActive()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const bool isVisibilityHidden =
|
||||
!aFrame.IsVisibleOrMayHaveVisibleDescendants();
|
||||
if ((!isVisibilityHidden || HasVisibilityChange()) &&
|
||||
!aFrame.IsScrolledOutOfView()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If there are no overflow change hints, we don't need to worry about
|
||||
// unthrottling the animation periodically to update scrollbar positions for
|
||||
// the overflow region.
|
||||
if (!HasPropertiesThatMightAffectOverflow()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Don't throttle finite animations since the animation might suddenly
|
||||
// come into view and if it was throttled it will be out-of-sync.
|
||||
if (HasFiniteActiveDuration()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return isVisibilityHidden
|
||||
? CanThrottleOverflowChangesInScrollable(aFrame)
|
||||
: CanThrottleOverflowChanges(aFrame);
|
||||
}
|
||||
|
||||
bool
|
||||
KeyframeEffect::CanThrottle() const
|
||||
{
|
||||
@@ -1258,8 +1218,35 @@ KeyframeEffect::CanThrottle() const
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CanThrottleIfNotVisible(*frame)) {
|
||||
return true;
|
||||
// Unless we are newly in-effect, we can throttle the animation if the
|
||||
// animation is paint only and the target frame is out of view or the document
|
||||
// is in background tabs.
|
||||
if (mInEffectOnLastAnimationTimingUpdate && CanIgnoreIfNotVisible()) {
|
||||
nsIPresShell* presShell = GetPresShell();
|
||||
if (presShell && !presShell->IsActive()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const bool isVisibilityHidden =
|
||||
!frame->IsVisibleOrMayHaveVisibleDescendants();
|
||||
if ((isVisibilityHidden && !HasVisibilityChange()) ||
|
||||
frame->IsScrolledOutOfView()) {
|
||||
// If there are transform change hints, unthrottle the animation
|
||||
// periodically since it might affect the overflow region.
|
||||
if (HasTransformThatMightAffectOverflow()) {
|
||||
// Don't throttle finite transform animations since the animation might
|
||||
// suddenly come into view and if it was throttled it will be
|
||||
// out-of-sync.
|
||||
if (HasFiniteActiveDuration()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return isVisibilityHidden
|
||||
? CanThrottleTransformChangesInScrollable(*frame)
|
||||
: CanThrottleTransformChanges(*frame);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// First we need to check layer generation and transform overflow
|
||||
@@ -1292,8 +1279,8 @@ KeyframeEffect::CanThrottle() const
|
||||
|
||||
// If this is a transform animation that affects the overflow region,
|
||||
// we should unthrottle the animation periodically.
|
||||
if (HasPropertiesThatMightAffectOverflow() &&
|
||||
!CanThrottleOverflowChangesInScrollable(*frame)) {
|
||||
if (HasTransformThatMightAffectOverflow() &&
|
||||
!CanThrottleTransformChangesInScrollable(*frame)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1308,24 +1295,24 @@ KeyframeEffect::CanThrottle() const
|
||||
}
|
||||
|
||||
bool
|
||||
KeyframeEffect::CanThrottleOverflowChanges(const nsIFrame& aFrame) const
|
||||
KeyframeEffect::CanThrottleTransformChanges(const nsIFrame& aFrame) const
|
||||
{
|
||||
TimeStamp now = aFrame.PresContext()->RefreshDriver()->MostRecentRefresh();
|
||||
|
||||
EffectSet* effectSet = EffectSet::GetEffectSet(mTarget->mElement,
|
||||
mTarget->mPseudoType);
|
||||
MOZ_ASSERT(effectSet, "CanOverflowTransformChanges is expected to be called"
|
||||
MOZ_ASSERT(effectSet, "CanThrottleTransformChanges is expected to be called"
|
||||
" on an effect in an effect set");
|
||||
MOZ_ASSERT(mAnimation, "CanOverflowTransformChanges is expected to be called"
|
||||
MOZ_ASSERT(mAnimation, "CanThrottleTransformChanges is expected to be called"
|
||||
" on an effect with a parent animation");
|
||||
TimeStamp lastSyncTime = effectSet->LastOverflowAnimationSyncTime();
|
||||
TimeStamp lastSyncTime = effectSet->LastTransformSyncTime();
|
||||
// If this animation can cause overflow, we can throttle some of the ticks.
|
||||
return (!lastSyncTime.IsNull() &&
|
||||
(now - lastSyncTime) < OverflowRegionRefreshInterval());
|
||||
}
|
||||
|
||||
bool
|
||||
KeyframeEffect::CanThrottleOverflowChangesInScrollable(nsIFrame& aFrame) const
|
||||
KeyframeEffect::CanThrottleTransformChangesInScrollable(nsIFrame& aFrame) const
|
||||
{
|
||||
// If the target element is not associated with any documents, we don't care
|
||||
// it.
|
||||
@@ -1346,7 +1333,7 @@ KeyframeEffect::CanThrottleOverflowChangesInScrollable(nsIFrame& aFrame) const
|
||||
return true;
|
||||
}
|
||||
|
||||
if (CanThrottleOverflowChanges(aFrame)) {
|
||||
if (CanThrottleTransformChanges(aFrame)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1617,25 +1604,9 @@ KeyframeEffect::CalculateCumulativeChangeHint(const ComputedStyle* aComputedStyl
|
||||
// on invisible elements because we can't calculate the change hint for
|
||||
// such properties until we compose it.
|
||||
if (!segment.HasReplaceableValues()) {
|
||||
if (property.mProperty != eCSSProperty_transform) {
|
||||
mCumulativeChangeHint = ~nsChangeHint_Hints_CanIgnoreIfNotVisible;
|
||||
return;
|
||||
}
|
||||
// We try a little harder to optimize transform animations simply
|
||||
// because they are so common (the second-most commonly animated
|
||||
// property at the time of writing). So if we encounter a transform
|
||||
// segment that needs composing with the underlying value, we just add
|
||||
// all the change hints a transform animation is known to be able to
|
||||
// generate.
|
||||
mCumulativeChangeHint |= nsChangeHint_AddOrRemoveTransform |
|
||||
nsChangeHint_RepaintFrame |
|
||||
nsChangeHint_UpdateContainingBlock |
|
||||
nsChangeHint_UpdateOverflow |
|
||||
nsChangeHint_UpdatePostTransformOverflow |
|
||||
nsChangeHint_UpdateTransformLayer;
|
||||
continue;
|
||||
mCumulativeChangeHint = ~nsChangeHint_Hints_CanIgnoreIfNotVisible;
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<ComputedStyle> fromContext =
|
||||
CreateComputedStyleForAnimationValue(property.mProperty,
|
||||
segment.mFromValue,
|
||||
|
||||
@@ -421,9 +421,8 @@ private:
|
||||
nsIFrame* GetStyleFrame() const;
|
||||
|
||||
bool CanThrottle() const;
|
||||
bool CanThrottleOverflowChanges(const nsIFrame& aFrame) const;
|
||||
bool CanThrottleOverflowChangesInScrollable(nsIFrame& aFrame) const;
|
||||
bool CanThrottleIfNotVisible(nsIFrame& aFrame) const;
|
||||
bool CanThrottleTransformChanges(const nsIFrame& aFrame) const;
|
||||
bool CanThrottleTransformChangesInScrollable(nsIFrame& aFrame) const;
|
||||
|
||||
// Returns true if the computedTiming has changed since the last
|
||||
// composition.
|
||||
@@ -441,15 +440,14 @@ private:
|
||||
|
||||
void UpdateEffectSet(mozilla::EffectSet* aEffectSet = nullptr) const;
|
||||
|
||||
// Returns true if this effect has properties that might affect the overflow
|
||||
// region.
|
||||
// Returns true if this effect has transform and the transform might affect
|
||||
// the overflow region.
|
||||
// This function is used for updating scroll bars or notifying intersection
|
||||
// observers reflected by the transform.
|
||||
bool HasPropertiesThatMightAffectOverflow() const
|
||||
bool HasTransformThatMightAffectOverflow() const
|
||||
{
|
||||
return mCumulativeChangeHint & (nsChangeHint_AddOrRemoveTransform |
|
||||
nsChangeHint_UpdateOverflow |
|
||||
nsChangeHint_UpdatePostTransformOverflow |
|
||||
return mCumulativeChangeHint & (nsChangeHint_UpdatePostTransformOverflow |
|
||||
nsChangeHint_AddOrRemoveTransform |
|
||||
nsChangeHint_UpdateTransformLayer);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -461,8 +461,6 @@ static_assert(!(nsChangeHint_Hints_AlwaysHandledForDescendants &
|
||||
nsChangeHint_NeutralChange | \
|
||||
nsChangeHint_UpdateOpacityLayer | \
|
||||
nsChangeHint_AddOrRemoveTransform | \
|
||||
nsChangeHint_UpdateContainingBlock | \
|
||||
nsChangeHint_UpdateOverflow | \
|
||||
nsChangeHint_UpdatePostTransformOverflow | \
|
||||
nsChangeHint_UpdateTransformLayer | \
|
||||
nsChangeHint_UpdateUsesOpacity | \
|
||||
|
||||
@@ -722,12 +722,7 @@ nsFrame::Init(nsIContent* aContent,
|
||||
// Usually we update the state when the frame is restyled and has a
|
||||
// VisibilityChange change hint but we don't generate any change hints for
|
||||
// newly created frames.
|
||||
// Note: We don't need to do this for placeholders since placeholders have
|
||||
// different styles so that the styles don't have visibility:hidden even if
|
||||
// the parent has visibility:hidden style.
|
||||
if (!IsPlaceholderFrame()) {
|
||||
UpdateVisibleDescendantsState();
|
||||
}
|
||||
UpdateVisibleDescendantsState();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<style>
|
||||
#parent {
|
||||
visibility: hidden;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
#fixed {
|
||||
position: fixed;
|
||||
background-color: green;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
#scroll {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
height: 80px;
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<div id="scroll">
|
||||
<div id="parent">
|
||||
<div id="fixed"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,34 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<title>
|
||||
Transform animation generates a containing block for fixed-pos descendants
|
||||
even if the animation value is 'transform:none'
|
||||
</title>
|
||||
<style>
|
||||
#parent {
|
||||
visibility: hidden;
|
||||
animation: anim 100s step-end;
|
||||
}
|
||||
|
||||
#fixed {
|
||||
position: fixed;
|
||||
background-color: green;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
#scroll {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
height: 80px;
|
||||
width: 100px;
|
||||
}
|
||||
@keyframes anim {
|
||||
0% { transform: none; }
|
||||
100% { transform: translateX(0px); }
|
||||
}
|
||||
</style>
|
||||
<div id="scroll">
|
||||
<div id="parent">
|
||||
<div id="fixed"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,4 +70,3 @@ fails-if(layerChecksEnabled) == background-position-important.html background-po
|
||||
== opacity-animation-in-fixed-opacity-parent.html opacity-animation-in-fixed-opacity-parent-ref.html
|
||||
== opacity-animation-in-delay.html about:blank
|
||||
== transform-animation-in-delay.html transform-animation-in-delay-ref.html
|
||||
== containing-block-on-visibility-hidden.html containing-block-on-visibility-hidden-ref.html
|
||||
|
||||
@@ -3689,9 +3689,6 @@ CompareTransformValues(const RefPtr<nsCSSValueSharedList>& aList,
|
||||
const RefPtr<nsCSSValueSharedList>& aNewList)
|
||||
{
|
||||
nsChangeHint result = nsChangeHint(0);
|
||||
|
||||
// Note: If we add a new change hint for transform changes here, we have to
|
||||
// modify KeyframeEffect::CalculateCumulativeChangeHint too!
|
||||
if (!aList != !aNewList || (aList && *aList != *aNewList)) {
|
||||
result |= nsChangeHint_UpdateTransformLayer;
|
||||
if (aList && aNewList) {
|
||||
@@ -3816,10 +3813,6 @@ nsStyleDisplay::CalcDifference(const nsStyleDisplay& aNewData) const
|
||||
// We do not need to apply nsChangeHint_UpdateTransformLayer since
|
||||
// nsChangeHint_RepaintFrame will forcibly invalidate the frame area and
|
||||
// ensure layers are rebuilt (or removed).
|
||||
//
|
||||
// Note: If we add a new change hint for transform changes here or in
|
||||
// CompareTransformValues(), we have to modify
|
||||
// KeyframeEffect::CalculateCumulativeChangeHint too!
|
||||
hint |= nsChangeHint_UpdateContainingBlock |
|
||||
nsChangeHint_AddOrRemoveTransform |
|
||||
nsChangeHint_UpdateOverflow |
|
||||
|
||||
Reference in New Issue
Block a user