Bug 1026315 - Remove PercentageHashKey; r=dbaron

This commit is contained in:
Brian Birtles 2014-06-24 15:29:54 +09:00
Родитель 6bc9caf270
Коммит 4798898a62
1 изменённых файлов: 0 добавлений и 31 удалений

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

@ -325,35 +325,6 @@ nsAnimationManager::CheckAnimationRule(nsStyleContext* aStyleContext,
return GetAnimationRule(aElement, aStyleContext->GetPseudoType());
}
class PercentageHashKey : public PLDHashEntryHdr
{
public:
typedef const float& KeyType;
typedef const float* KeyTypePointer;
PercentageHashKey(KeyTypePointer aKey) : mValue(*aKey) { }
PercentageHashKey(const PercentageHashKey& toCopy) : mValue(toCopy.mValue) { }
~PercentageHashKey() { }
KeyType GetKey() const { return mValue; }
bool KeyEquals(KeyTypePointer aKey) const { return *aKey == mValue; }
static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
static PLDHashNumber HashKey(KeyTypePointer aKey) {
static_assert(sizeof(PLDHashNumber) == sizeof(uint32_t),
"this hash function assumes PLDHashNumber is uint32_t");
static_assert(PLDHashNumber(-1) > PLDHashNumber(0),
"this hash function assumes PLDHashNumber is uint32_t");
float key = *aKey;
NS_ABORT_IF_FALSE(0.0f <= key && key <= 1.0f, "out of range");
return PLDHashNumber(key * UINT32_MAX);
}
enum { ALLOW_MEMMOVE = true };
private:
const float mValue;
};
struct KeyframeData {
float mKey;
uint32_t mIndex; // store original order since sort algorithm is not stable
@ -469,8 +440,6 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
float key = keys[keyIdx];
// FIXME (spec): The spec doesn't say what to do with
// out-of-range keyframes. We'll ignore them.
// (And PercentageHashKey currently assumes we either ignore or
// clamp them.)
if (0.0f <= key && key <= 1.0f) {
KeyframeData *data = sortedKeyframes.AppendElement();
data->mKey = key;