Bug 1215406 - Part 1: Remove NS_STYLE_ANIMATION_DIRECTION_XXX and NS_STYLE_ANIMATION_FILL_MODE_XXX. r=heycam

Replace the definitions of
1. NS_STYLE_ANIMATION_DIRECTION_XXX with mozilla::dom::PlaybackDirection
2. NS_STYLE_ANIMATION_FILL_MODE_XXX with mozilla::dom::FillMode

So we can static_cast mozilla::dom::PlaybackDirection and mozilla::dom::FillMode
into integers directly.

--HG--
extra : rebase_source : d01bd54f901096b3b00dd3d7b6994c30f9660e82
This commit is contained in:
Boris Chiou 2015-11-21 06:34:00 +01:00
Родитель ad7e5f708d
Коммит 30de036e45
3 изменённых файлов: 20 добавлений и 21 удалений

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

@ -50,6 +50,7 @@
#include "mozilla/Preferences.h"
#include "nsRuleData.h"
#include "mozilla/CSSVariableValues.h"
#include "mozilla/dom/AnimationEffectReadOnlyBinding.h"
#include "mozilla/dom/URL.h"
#include "gfxFontFamilyList.h"
@ -15926,8 +15927,10 @@ CSSParserImpl::ParseAnimation()
initialValues[1].SetIntValue(NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE,
eCSSUnit_Enumerated);
initialValues[2].SetFloatValue(0.0, eCSSUnit_Seconds);
initialValues[3].SetIntValue(NS_STYLE_ANIMATION_DIRECTION_NORMAL, eCSSUnit_Enumerated);
initialValues[4].SetIntValue(NS_STYLE_ANIMATION_FILL_MODE_NONE, eCSSUnit_Enumerated);
initialValues[3].SetIntValue(static_cast<uint32_t>(mozilla::dom::PlaybackDirection::Normal),
eCSSUnit_Enumerated);
initialValues[4].SetIntValue(static_cast<uint32_t>(mozilla::dom::FillMode::None),
eCSSUnit_Enumerated);
initialValues[5].SetFloatValue(1.0f, eCSSUnit_Number);
initialValues[6].SetIntValue(NS_STYLE_ANIMATION_PLAY_STATE_RUNNING, eCSSUnit_Enumerated);
initialValues[7].SetNoneValue();

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

@ -17,6 +17,7 @@
#include "nsIWidget.h"
#include "nsThemeConstants.h" // For system widget appearance types
#include "mozilla/dom/AnimationEffectReadOnlyBinding.h" // for PlaybackDirection
#include "mozilla/LookAndFeel.h" // for system colors
#include "nsString.h"
@ -702,18 +703,18 @@ nsCSSProps::GetStringValue(nsCSSCounterDesc aCounterDesc)
/***************************************************************************/
const KTableEntry nsCSSProps::kAnimationDirectionKTable[] = {
{ eCSSKeyword_normal, NS_STYLE_ANIMATION_DIRECTION_NORMAL },
{ eCSSKeyword_reverse, NS_STYLE_ANIMATION_DIRECTION_REVERSE },
{ eCSSKeyword_alternate, NS_STYLE_ANIMATION_DIRECTION_ALTERNATE },
{ eCSSKeyword_alternate_reverse, NS_STYLE_ANIMATION_DIRECTION_ALTERNATE_REVERSE },
{ eCSSKeyword_normal, static_cast<uint32_t>(dom::PlaybackDirection::Normal) },
{ eCSSKeyword_reverse, static_cast<uint32_t>(dom::PlaybackDirection::Reverse) },
{ eCSSKeyword_alternate, static_cast<uint32_t>(dom::PlaybackDirection::Alternate) },
{ eCSSKeyword_alternate_reverse, static_cast<uint32_t>(dom::PlaybackDirection::Alternate_reverse) },
{ eCSSKeyword_UNKNOWN, -1 }
};
const KTableEntry nsCSSProps::kAnimationFillModeKTable[] = {
{ eCSSKeyword_none, NS_STYLE_ANIMATION_FILL_MODE_NONE },
{ eCSSKeyword_forwards, NS_STYLE_ANIMATION_FILL_MODE_FORWARDS },
{ eCSSKeyword_backwards, NS_STYLE_ANIMATION_FILL_MODE_BACKWARDS },
{ eCSSKeyword_both, NS_STYLE_ANIMATION_FILL_MODE_BOTH },
{ eCSSKeyword_none, static_cast<uint32_t>(dom::FillMode::None) },
{ eCSSKeyword_forwards, static_cast<uint32_t>(dom::FillMode::Forwards) },
{ eCSSKeyword_backwards, static_cast<uint32_t>(dom::FillMode::Backwards) },
{ eCSSKeyword_both, static_cast<uint32_t>(dom::FillMode::Both) },
{ eCSSKeyword_UNKNOWN, -1 }
};

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

@ -244,17 +244,12 @@ enum class StyleBoxSizing : uint8_t {
#define NS_STYLE_WILL_CHANGE_SCROLL (1<<2)
#define NS_STYLE_WILL_CHANGE_OPACITY (1<<3)
// See nsStyleDisplay
#define NS_STYLE_ANIMATION_DIRECTION_NORMAL 0
#define NS_STYLE_ANIMATION_DIRECTION_REVERSE 1
#define NS_STYLE_ANIMATION_DIRECTION_ALTERNATE 2
#define NS_STYLE_ANIMATION_DIRECTION_ALTERNATE_REVERSE 3
// See nsStyleDisplay
#define NS_STYLE_ANIMATION_FILL_MODE_NONE 0
#define NS_STYLE_ANIMATION_FILL_MODE_FORWARDS 1
#define NS_STYLE_ANIMATION_FILL_MODE_BACKWARDS 2
#define NS_STYLE_ANIMATION_FILL_MODE_BOTH 3
// See AnimationEffectReadOnly.webidl
// and mozilla/dom/AnimationEffectReadOnlyBinding.h
namespace dom {
enum class PlaybackDirection : uint32_t;
enum class FillMode : uint32_t;
}
// See nsStyleDisplay
#define NS_STYLE_ANIMATION_ITERATION_COUNT_INFINITE 0