| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
| 4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) | 4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) |
| 5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
| 6 | 6 |
| 7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
| 8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
| 9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
| 10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 Length blend(const Length& from, double progress) const | 221 Length blend(const Length& from, double progress) const |
| 222 { | 222 { |
| 223 // Blend two lengths to produce a new length that is in between them. U
sed for animation. | 223 // Blend two lengths to produce a new length that is in between them. U
sed for animation. |
| 224 if (!from.isZero() && !isZero() && from.type() != type()) | 224 if (!from.isZero() && !isZero() && from.type() != type()) |
| 225 return *this; | 225 return *this; |
| 226 | 226 |
| 227 if (from.isZero() && isZero()) | 227 if (from.isZero() && isZero()) |
| 228 return *this; | 228 return *this; |
| 229 | 229 |
| 230 // FIXME http://webkit.org/b/86160 - Blending doesn't work with calculat
ed expressions | 230 // FIXME http://webkit.org/b/86160 - Blending doesn't work with calculat
ed expressions |
| 231 if (type() == Calculated) | 231 if (from.type() == Calculated || type() == Calculated) |
| 232 return *this; | 232 return *this; |
| 233 | 233 |
| 234 LengthType resultType = type(); | 234 LengthType resultType = type(); |
| 235 if (isZero()) | 235 if (isZero()) |
| 236 resultType = from.type(); | 236 resultType = from.type(); |
| 237 | 237 |
| 238 if (resultType == Percent) { | 238 if (resultType == Percent) { |
| 239 float fromPercent = from.isZero() ? 0 : from.percent(); | 239 float fromPercent = from.isZero() ? 0 : from.percent(); |
| 240 float toPercent = isZero() ? 0 : percent(); | 240 float toPercent = isZero() ? 0 : percent(); |
| 241 return Length(WebCore::blend(fromPercent, toPercent, progress), Perc
ent); | 241 return Length(WebCore::blend(fromPercent, toPercent, progress), Perc
ent); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 unsigned char m_type; | 300 unsigned char m_type; |
| 301 bool m_isFloat; | 301 bool m_isFloat; |
| 302 }; | 302 }; |
| 303 | 303 |
| 304 PassOwnArrayPtr<Length> newCoordsArray(const String&, int& len); | 304 PassOwnArrayPtr<Length> newCoordsArray(const String&, int& len); |
| 305 PassOwnArrayPtr<Length> newLengthArray(const String&, int& len); | 305 PassOwnArrayPtr<Length> newLengthArray(const String&, int& len); |
| 306 | 306 |
| 307 } // namespace WebCore | 307 } // namespace WebCore |
| 308 | 308 |
| 309 #endif // Length_h | 309 #endif // Length_h |
| OLD | NEW |