Bug 1320608 - Use the primary frame for AnimationInfo::GetGenerationFromFrame. r=birtles

For table element nsDisplayTransform's mFrame is the primary frame not style
frame.

MozReview-Commit-ID: 9BMSpuGE7lC

--HG--
extra : rebase_source : 19edd8978165cfa3904dcabea3e382e9b7c16ee3
This commit is contained in:
Hiroyuki Ikezoe 2018-05-09 05:53:47 +09:00
Родитель 715ced6dc3
Коммит 3d8cc990a6
2 изменённых файлов: 19 добавлений и 8 удалений

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

@ -1156,8 +1156,10 @@ KeyframeEffectReadOnly::CanThrottle() const
mTarget->mPseudoType);
MOZ_ASSERT(effectSet, "CanThrottle should be called on an effect "
"associated with a target element");
// Note that AnimationInfo::GetGenarationFromFrame() is supposed to work
// with the primary frame instead of the style frame.
Maybe<uint64_t> generation = layers::AnimationInfo::GetGenerationFromFrame(
frame, record.mLayerType);
GetPrimaryFrame(), record.mLayerType);
// Unthrottle if the animation needs to be brought up to date
if (!generation || effectSet->GetAnimationGeneration() != *generation) {
return false;
@ -1250,11 +1252,22 @@ KeyframeEffectReadOnly::CanThrottleTransformChangesInScrollable(nsIFrame& aFrame
nsIFrame*
KeyframeEffectReadOnly::GetStyleFrame() const
{
if (!mTarget) {
nsIFrame* frame = GetPrimaryFrame();
if (!frame) {
return nullptr;
}
nsIFrame* frame;
return nsLayoutUtils::GetStyleFrame(frame);
}
nsIFrame*
KeyframeEffectReadOnly::GetPrimaryFrame() const
{
nsIFrame* frame = nullptr;
if (!mTarget) {
return frame;
}
if (mTarget->mPseudoType == CSSPseudoElementType::before) {
frame = nsLayoutUtils::GetBeforeFrame(mTarget->mElement);
} else if (mTarget->mPseudoType == CSSPseudoElementType::after) {
@ -1265,11 +1278,7 @@ KeyframeEffectReadOnly::GetStyleFrame() const
"unknown mTarget->mPseudoType");
}
if (!frame) {
return nullptr;
}
return nsLayoutUtils::GetStyleFrame(frame);
return frame;
}
nsIDocument*

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

@ -393,6 +393,8 @@ private:
nsPresContext* aPresContext,
const ComputedStyle* aBaseComputedStyle);
// Return the primary frame for the target (pseudo-)element.
nsIFrame* GetPrimaryFrame() const;
// Returns the frame which is used for styling.
nsIFrame* GetStyleFrame() const;