| 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 15 matching lines...) Expand all Loading... |
| 26 #include "platform/PlatformExport.h" | 26 #include "platform/PlatformExport.h" |
| 27 #include "platform/animation/AnimationUtilities.h" | 27 #include "platform/animation/AnimationUtilities.h" |
| 28 #include "wtf/Assertions.h" | 28 #include "wtf/Assertions.h" |
| 29 #include "wtf/FastAllocBase.h" | 29 #include "wtf/FastAllocBase.h" |
| 30 #include "wtf/Forward.h" | 30 #include "wtf/Forward.h" |
| 31 #include "wtf/HashMap.h" | 31 #include "wtf/HashMap.h" |
| 32 #include "wtf/MathExtras.h" | 32 #include "wtf/MathExtras.h" |
| 33 #include "wtf/Vector.h" | 33 #include "wtf/Vector.h" |
| 34 #include <cstring> | 34 #include <cstring> |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace blink { |
| 37 | 37 |
| 38 // FIXME: This enum makes it hard to tell in general what values may be | 38 // FIXME: This enum makes it hard to tell in general what values may be |
| 39 // appropriate for any given Length. | 39 // appropriate for any given Length. |
| 40 enum LengthType { | 40 enum LengthType { |
| 41 Auto, Percent, Fixed, | 41 Auto, Percent, Fixed, |
| 42 Intrinsic, MinIntrinsic, | 42 Intrinsic, MinIntrinsic, |
| 43 MinContent, MaxContent, FillAvailable, FitContent, | 43 MinContent, MaxContent, FillAvailable, FitContent, |
| 44 Calculated, | 44 Calculated, |
| 45 ExtendToZoom, DeviceWidth, DeviceHeight, | 45 ExtendToZoom, DeviceWidth, DeviceHeight, |
| 46 Undefined | 46 Undefined |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 if (!from.isZero() && !isZero() && from.type() != type()) | 302 if (!from.isZero() && !isZero() && from.type() != type()) |
| 303 return blendMixedTypes(from, progress, range); | 303 return blendMixedTypes(from, progress, range); |
| 304 | 304 |
| 305 if (from.isZero() && isZero()) | 305 if (from.isZero() && isZero()) |
| 306 return *this; | 306 return *this; |
| 307 | 307 |
| 308 LengthType resultType = type(); | 308 LengthType resultType = type(); |
| 309 if (isZero()) | 309 if (isZero()) |
| 310 resultType = from.type(); | 310 resultType = from.type(); |
| 311 | 311 |
| 312 float blendedValue = WebCore::blend(from.value(), value(), progress); | 312 float blendedValue = blink::blend(from.value(), value(), progress); |
| 313 if (range == ValueRangeNonNegative) | 313 if (range == ValueRangeNonNegative) |
| 314 blendedValue = clampTo<float>(blendedValue, 0); | 314 blendedValue = clampTo<float>(blendedValue, 0); |
| 315 return Length(blendedValue, resultType); | 315 return Length(blendedValue, resultType); |
| 316 } | 316 } |
| 317 | 317 |
| 318 float getFloatValue() const | 318 float getFloatValue() const |
| 319 { | 319 { |
| 320 ASSERT(!isUndefined()); | 320 ASSERT(!isUndefined()); |
| 321 return m_isFloat ? m_floatValue : m_intValue; | 321 return m_isFloat ? m_floatValue : m_intValue; |
| 322 } | 322 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 345 int m_intValue; | 345 int m_intValue; |
| 346 float m_floatValue; | 346 float m_floatValue; |
| 347 }; | 347 }; |
| 348 bool m_quirk; | 348 bool m_quirk; |
| 349 unsigned char m_type; | 349 unsigned char m_type; |
| 350 bool m_isFloat; | 350 bool m_isFloat; |
| 351 }; | 351 }; |
| 352 | 352 |
| 353 PLATFORM_EXPORT Vector<Length> parseHTMLAreaElementCoords(const String&); | 353 PLATFORM_EXPORT Vector<Length> parseHTMLAreaElementCoords(const String&); |
| 354 | 354 |
| 355 } // namespace WebCore | 355 } // namespace blink |
| 356 | 356 |
| 357 #endif // Length_h | 357 #endif // Length_h |
| OLD | NEW |