| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 // Apply CSS inheritance rules. | 105 // Apply CSS inheritance rules. |
| 106 m_animationElement->adjustForInheritance<SVGLengthList>(parseLengthListFromS
tring, m_animationElement->fromPropertyValueType(), fromLengthList, m_contextEle
ment); | 106 m_animationElement->adjustForInheritance<SVGLengthList>(parseLengthListFromS
tring, m_animationElement->fromPropertyValueType(), fromLengthList, m_contextEle
ment); |
| 107 m_animationElement->adjustForInheritance<SVGLengthList>(parseLengthListFromS
tring, m_animationElement->toPropertyValueType(), toLengthList, m_contextElement
); | 107 m_animationElement->adjustForInheritance<SVGLengthList>(parseLengthListFromS
tring, m_animationElement->toPropertyValueType(), toLengthList, m_contextElement
); |
| 108 | 108 |
| 109 if (!m_animationElement->adjustFromToListValues<SVGLengthList>(fromLengthLis
t, toLengthList, animatedLengthList, percentage)) | 109 if (!m_animationElement->adjustFromToListValues<SVGLengthList>(fromLengthLis
t, toLengthList, animatedLengthList, percentage)) |
| 110 return; | 110 return; |
| 111 | 111 |
| 112 unsigned fromLengthListSize = fromLengthList.size(); | 112 unsigned fromLengthListSize = fromLengthList.size(); |
| 113 unsigned toLengthListSize = toLengthList.size(); | 113 unsigned toLengthListSize = toLengthList.size(); |
| 114 unsigned toAtEndOfDurationListSize = toAtEndOfDurationLengthList.size(); |
| 114 | 115 |
| 115 SVGLengthContext lengthContext(m_contextElement); | 116 SVGLengthContext lengthContext(m_contextElement); |
| 116 ExceptionCode ec = 0; | 117 ExceptionCode ec = 0; |
| 117 for (unsigned i = 0; i < toLengthListSize; ++i) { | 118 for (unsigned i = 0; i < toLengthListSize; ++i) { |
| 118 float animatedNumber = animatedLengthList[i].value(lengthContext); | 119 float animatedNumber = animatedLengthList[i].value(lengthContext); |
| 119 SVGLengthType unitType = toLengthList[i].unitType(); | 120 SVGLengthType unitType = toLengthList[i].unitType(); |
| 120 float effectiveFrom = 0; | 121 float effectiveFrom = 0; |
| 121 if (fromLengthListSize) { | 122 if (fromLengthListSize) { |
| 122 if (percentage < 0.5) | 123 if (percentage < 0.5) |
| 123 unitType = fromLengthList[i].unitType(); | 124 unitType = fromLengthList[i].unitType(); |
| 124 effectiveFrom = fromLengthList[i].value(lengthContext); | 125 effectiveFrom = fromLengthList[i].value(lengthContext); |
| 125 } | 126 } |
| 127 float effectiveToAtEnd = i < toAtEndOfDurationListSize ? toAtEndOfDurati
onLengthList[i].value(lengthContext) : 0; |
| 126 | 128 |
| 127 m_animationElement->animateAdditiveNumber(percentage, repeatCount, effec
tiveFrom, toLengthList[i].value(lengthContext), toAtEndOfDurationLengthList[i].v
alue(lengthContext), animatedNumber); | 129 m_animationElement->animateAdditiveNumber(percentage, repeatCount, effec
tiveFrom, toLengthList[i].value(lengthContext), effectiveToAtEnd, animatedNumber
); |
| 128 animatedLengthList[i].setValue(lengthContext, animatedNumber, m_lengthMo
de, unitType, ec); | 130 animatedLengthList[i].setValue(lengthContext, animatedNumber, m_lengthMo
de, unitType, ec); |
| 129 ASSERT(!ec); | 131 ASSERT(!ec); |
| 130 } | 132 } |
| 131 } | 133 } |
| 132 | 134 |
| 133 float SVGAnimatedLengthListAnimator::calculateDistance(const String&, const Stri
ng&) | 135 float SVGAnimatedLengthListAnimator::calculateDistance(const String&, const Stri
ng&) |
| 134 { | 136 { |
| 135 // FIXME: Distance calculation is not possible for SVGLengthList right now.
We need the distance for every single value. | 137 // FIXME: Distance calculation is not possible for SVGLengthList right now.
We need the distance for every single value. |
| 136 return -1; | 138 return -1; |
| 137 } | 139 } |
| 138 | 140 |
| 139 } | 141 } |
| 140 | 142 |
| 141 #endif // ENABLE(SVG) | 143 #endif // ENABLE(SVG) |
| OLD | NEW |