| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>. | 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>. |
| 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> | 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 template<> inline float CSSPrimitiveValue::convertTo() const | 104 template<> inline float CSSPrimitiveValue::convertTo() const |
| 105 { | 105 { |
| 106 ASSERT(isNumber()); | 106 ASSERT(isNumber()); |
| 107 return clampTo<float>(getDoubleValue()); | 107 return clampTo<float>(getDoubleValue()); |
| 108 } | 108 } |
| 109 | 109 |
| 110 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineClampValue i) | 110 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineClampValue i) |
| 111 : CSSValue(PrimitiveClass) | 111 : CSSValue(PrimitiveClass) |
| 112 { | 112 { |
| 113 init(i.isPercentage() ? UnitType::Percentage : UnitType::Number); | 113 init(i.isPercentage() ? UnitType::Percentage : UnitType::Integer); |
| 114 m_value.num = static_cast<double>(i.value()); | 114 m_value.num = static_cast<double>(i.value()); |
| 115 } | 115 } |
| 116 | 116 |
| 117 template<> inline LineClampValue CSSPrimitiveValue::convertTo() const | 117 template<> inline LineClampValue CSSPrimitiveValue::convertTo() const |
| 118 { | 118 { |
| 119 if (type() == UnitType::Number) | 119 if (type() == UnitType::Integer) |
| 120 return LineClampValue(clampTo<int>(m_value.num), LineClampLineCount); | 120 return LineClampValue(clampTo<int>(m_value.num), LineClampLineCount); |
| 121 | 121 |
| 122 if (type() == UnitType::Percentage) | 122 if (type() == UnitType::Percentage) |
| 123 return LineClampValue(clampTo<int>(m_value.num), LineClampPercentage); | 123 return LineClampValue(clampTo<int>(m_value.num), LineClampPercentage); |
| 124 | 124 |
| 125 ASSERT_NOT_REACHED(); | 125 ASSERT_NOT_REACHED(); |
| 126 return LineClampValue(); | 126 return LineClampValue(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CSSReflectionDirection e) | 129 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(CSSReflectionDirection e) |
| (...skipping 4488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4618 default: | 4618 default: |
| 4619 break; | 4619 break; |
| 4620 } | 4620 } |
| 4621 ASSERT_NOT_REACHED(); | 4621 ASSERT_NOT_REACHED(); |
| 4622 return ScrollSnapTypeNone; | 4622 return ScrollSnapTypeNone; |
| 4623 } | 4623 } |
| 4624 | 4624 |
| 4625 } // namespace blink | 4625 } // namespace blink |
| 4626 | 4626 |
| 4627 #endif | 4627 #endif |
| OLD | NEW |