Bug 880596 part 4 - Reuse ElementAnimation::HasAnimationOfProperty; r=dbaron

Now that ElementTransitionProperty inherits from ElementAnimation,
ElementTransitions::HasAnimationOfProperty can re-use
ElementAnimation::HasAnimationOfProperty in its definition of
ElementTransitions::HasAnimationOfProperty.

Similarly, in nsDisplayList::AddAnimationsAndTransitionsToLayer we can use this
method rather than drilling down to the appropriate segment by hand.
This commit is contained in:
Brian Birtles 2014-04-03 14:57:27 +09:00
parent e503422f93
commit 217cb32ecc
2 changed files with 3 additions and 7 deletions

View File

@ -464,10 +464,8 @@ nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer(Layer* aLayer,
if (et) {
for (uint32_t tranIdx = 0; tranIdx < et->mPropertyTransitions.Length(); tranIdx++) {
ElementPropertyTransition* pt = &et->mPropertyTransitions[tranIdx];
MOZ_ASSERT(pt->mProperties.Length() == 1,
"Should have one animation property for a transition");
if (pt->mProperties[0].mProperty != aProperty ||
!pt->IsRunningAt(currentTime)) {
if (!(pt->HasAnimationOfProperty(aProperty) &&
pt->IsRunningAt(currentTime))) {
continue;
}

View File

@ -137,9 +137,7 @@ ElementTransitions::HasAnimationOfProperty(nsCSSProperty aProperty) const
{
for (uint32_t tranIdx = mPropertyTransitions.Length(); tranIdx-- != 0; ) {
const ElementPropertyTransition& pt = mPropertyTransitions[tranIdx];
MOZ_ASSERT(pt.mProperties.Length() == 1,
"Should have one animation property for a transition");
if (aProperty == pt.mProperties[0].mProperty && !pt.IsRemovedSentinel()) {
if (pt.HasAnimationOfProperty(aProperty) && !pt.IsRemovedSentinel()) {
return true;
}
}