From bfd574b098a73753c54baf5573be2d9f1c1173b5 Mon Sep 17 00:00:00 2001 From: "kling@webkit.org" Date: Sat, 31 Dec 2011 23:36:08 +0000 Subject: [PATCH] KeyframeAnimation: Use hash lookups to determine if property is animated. Reviewed by Anders Carlsson. Clean out an old FIXME about using hash lookups instead of iterating over the properties. * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::hasAnimationForProperty): (WebCore::KeyframeAnimation::affectsProperty): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103861 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 14 ++++++++++++++ Source/WebCore/page/animation/KeyframeAnimation.cpp | 18 +++--------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index e30795a..57c69a9 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,17 @@ +2012-01-01 Andreas Kling + + KeyframeAnimation: Use hash lookups to determine if property is animated. + + + Reviewed by Anders Carlsson. + + Clean out an old FIXME about using hash lookups instead of iterating over + the properties. + + * page/animation/KeyframeAnimation.cpp: + (WebCore::KeyframeAnimation::hasAnimationForProperty): + (WebCore::KeyframeAnimation::affectsProperty): + 2011-12-31 Dan Bernstein WebCore change for Cannot print USPS shipping labels diff --git a/Source/WebCore/page/animation/KeyframeAnimation.cpp b/Source/WebCore/page/animation/KeyframeAnimation.cpp index f0231e2..6c46cd7 100644 --- a/Source/WebCore/page/animation/KeyframeAnimation.cpp +++ b/Source/WebCore/page/animation/KeyframeAnimation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2007, 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -249,14 +249,7 @@ void KeyframeAnimation::getAnimatedStyle(RefPtr& animatedStyle) bool KeyframeAnimation::hasAnimationForProperty(int property) const { - // FIXME: why not just m_keyframes.containsProperty()? - HashSet::const_iterator end = m_keyframes.endProperties(); - for (HashSet::const_iterator it = m_keyframes.beginProperties(); it != end; ++it) { - if (*it == property) - return true; - } - - return false; + return m_keyframes.containsProperty(property); } bool KeyframeAnimation::startAnimation(double timeOffset) @@ -389,12 +382,7 @@ void KeyframeAnimation::resumeOverriddenAnimations() bool KeyframeAnimation::affectsProperty(int property) const { - HashSet::const_iterator end = m_keyframes.endProperties(); - for (HashSet::const_iterator it = m_keyframes.beginProperties(); it != end; ++it) { - if (*it == property) - return true; - } - return false; + return m_keyframes.containsProperty(property); } void KeyframeAnimation::validateTransformFunctionList() -- 2.7.4