Bug 1305325 - Part 2: Add AnimValuesStyleRule::GetValue and HasValue to get the last composed style. r=birtles

HasValue() will be used to check that we have already composed style
for a given property or not.

MozReview-Commit-ID: L8lezGyON5o
This commit is contained in:
Hiroyuki Ikezoe 2016-12-04 08:07:39 +09:00
parent abe0821c03
commit d4826bcff3
2 changed files with 12 additions and 0 deletions

View File

@ -83,6 +83,13 @@ AnimValuesStyleRule::AddValue(nsCSSPropertyID aProperty,
nsCachedStyleData::GetBitForSID(nsCSSProps::kSIDTable[aProperty]);
}
bool
AnimValuesStyleRule::GetValue(nsCSSPropertyID aProperty,
StyleAnimationValue& aValue) const
{
return mAnimationValues.Get(aProperty, &aValue);
}
#ifdef DEBUG
void
AnimValuesStyleRule::List(FILE* out, int32_t aIndent) const

View File

@ -45,6 +45,11 @@ public:
void AddValue(nsCSSPropertyID aProperty, const StyleAnimationValue &aValue);
void AddValue(nsCSSPropertyID aProperty, StyleAnimationValue&& aValue);
bool HasValue(nsCSSPropertyID aProperty) const {
return mAnimationValues.Contains(aProperty);
}
bool GetValue(nsCSSPropertyID aProperty, StyleAnimationValue& aValue) const;
private:
~AnimValuesStyleRule() {}