#include "config.h"
#include "core/svg/SVGLengthList.h"
-#include "bindings/v8/ExceptionStatePlaceholder.h"
+#include "bindings/core/v8/ExceptionStatePlaceholder.h"
#include "core/svg/SVGAnimationElement.h"
#include "core/svg/SVGParserUtilities.h"
#include "wtf/text/StringBuilder.h"
-namespace WebCore {
+namespace blink {
inline PassRefPtr<SVGLengthList> toSVGLengthList(PassRefPtr<SVGPropertyBase> passBase)
{
at(i)->setValue(at(i)->value(lengthContext) + otherList->at(i)->value(lengthContext), lengthContext, ASSERT_NO_EXCEPTION);
}
-bool SVGLengthList::adjustFromToListValues(PassRefPtr<SVGLengthList> passFromList, PassRefPtr<SVGLengthList> passToList, float percentage, bool isToAnimation, bool resizeAnimatedListIfNeeded)
+PassRefPtr<SVGLength> SVGLengthList::createPaddingItem() const
{
- RefPtr<SVGLengthList> fromList = passFromList;
- RefPtr<SVGLengthList> toList = passToList;
-
- // If no 'to' value is given, nothing to animate.
- size_t toListSize = toList->length();
- if (!toListSize)
- return false;
-
- // If the 'from' value is given and it's length doesn't match the 'to' value list length, fallback to a discrete animation.
- size_t fromListSize = fromList->length();
- if (fromListSize != toListSize && fromListSize) {
- if (percentage < 0.5) {
- if (!isToAnimation)
- deepCopy(fromList);
- } else {
- deepCopy(toList);
- }
-
- return false;
- }
-
- ASSERT(!fromListSize || fromListSize == toListSize);
- if (resizeAnimatedListIfNeeded && length() < toListSize) {
- size_t paddingCount = toListSize - length();
- for (size_t i = 0; i < paddingCount; ++i)
- append(SVGLength::create(m_mode));
- }
-
- return true;
+ return SVGLength::create(m_mode);
}
void SVGLengthList::calculateAnimatedValue(SVGAnimationElement* animationElement, float percentage, unsigned repeatCount, PassRefPtr<SVGPropertyBase> fromValue, PassRefPtr<SVGPropertyBase> toValue, PassRefPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement* contextElement)
size_t toLengthListSize = toList->length();
size_t toAtEndOfDurationListSize = toAtEndOfDurationList->length();
- if (!adjustFromToListValues(fromList, toList, percentage, animationElement->animationMode() == ToAnimation, true))
+ if (!adjustFromToListValues(fromList, toList, percentage, animationElement->animationMode()))
return;
for (size_t i = 0; i < toLengthListSize; ++i) {