From d4826bcff39b29827ca97316a9f5613cbcbbce93 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Sun, 4 Dec 2016 08:07:39 +0900 Subject: [PATCH] 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 --- dom/animation/AnimValuesStyleRule.cpp | 7 +++++++ dom/animation/AnimValuesStyleRule.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/dom/animation/AnimValuesStyleRule.cpp b/dom/animation/AnimValuesStyleRule.cpp index 1a983e2c8fdd..ead9a25301b3 100644 --- a/dom/animation/AnimValuesStyleRule.cpp +++ b/dom/animation/AnimValuesStyleRule.cpp @@ -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 diff --git a/dom/animation/AnimValuesStyleRule.h b/dom/animation/AnimValuesStyleRule.h index 3562014b9645..49e558b2a6f2 100644 --- a/dom/animation/AnimValuesStyleRule.h +++ b/dom/animation/AnimValuesStyleRule.h @@ -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() {}