| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 { | 107 { |
| 108 return m_unitType == UnitTypeViewportWidth || m_unitType == UnitTypeView
portHeight || m_unitType == UnitTypeViewportMin || m_unitType == UnitTypeViewpor
tMax; | 108 return m_unitType == UnitTypeViewportWidth || m_unitType == UnitTypeView
portHeight || m_unitType == UnitTypeViewportMin || m_unitType == UnitTypeViewpor
tMax; |
| 109 } | 109 } |
| 110 | 110 |
| 111 static PassRefPtr<AnimatableLength> create(const AnimatableLength* leftAdden
d, const AnimatableLength* rightAddend) | 111 static PassRefPtr<AnimatableLength> create(const AnimatableLength* leftAdden
d, const AnimatableLength* rightAddend) |
| 112 { | 112 { |
| 113 ASSERT(leftAddend && rightAddend); | 113 ASSERT(leftAddend && rightAddend); |
| 114 return create(CSSCalcValue::createExpressionNode(leftAddend->toCSSCalcEx
pressionNode(), rightAddend->toCSSCalcExpressionNode(), CalcAdd)); | 114 return create(CSSCalcValue::createExpressionNode(leftAddend->toCSSCalcEx
pressionNode(), rightAddend->toCSSCalcExpressionNode(), CalcAdd)); |
| 115 } | 115 } |
| 116 | 116 |
| 117 PassRefPtr<CSSPrimitiveValue> toCSSPrimitiveValue(NumberRange) const; | 117 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> toCSSPrimitiveValue(NumberRange) c
onst; |
| 118 PassRefPtr<CSSCalcExpressionNode> toCSSCalcExpressionNode() const; | 118 PassRefPtr<CSSCalcExpressionNode> toCSSCalcExpressionNode() const; |
| 119 | 119 |
| 120 PassRefPtr<AnimatableLength> scale(double) const; | 120 PassRefPtr<AnimatableLength> scale(double) const; |
| 121 double clampedNumber(NumberRange range) const | 121 double clampedNumber(NumberRange range) const |
| 122 { | 122 { |
| 123 ASSERT(!isCalc()); | 123 ASSERT(!isCalc()); |
| 124 return (range == NonNegativeValues && m_number <= 0) ? 0 : m_number; | 124 return (range == NonNegativeValues && m_number <= 0) ? 0 : m_number; |
| 125 } | 125 } |
| 126 | 126 |
| 127 // Returns true and populates numberType, if primitiveUnit is a primitive le
ngth unit. Otherwise, returns false. | 127 // Returns true and populates numberType, if primitiveUnit is a primitive le
ngth unit. Otherwise, returns false. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 148 return m_unitType; | 148 return m_unitType; |
| 149 | 149 |
| 150 return UnitTypeCalc; | 150 return UnitTypeCalc; |
| 151 } | 151 } |
| 152 | 152 |
| 153 double m_number; | 153 double m_number; |
| 154 const NumberUnitType m_unitType; | 154 const NumberUnitType m_unitType; |
| 155 | 155 |
| 156 RefPtr<CSSCalcExpressionNode> m_calcExpression; | 156 RefPtr<CSSCalcExpressionNode> m_calcExpression; |
| 157 | 157 |
| 158 mutable RefPtr<CSSPrimitiveValue> m_cachedCSSPrimitiveValue; | 158 mutable RefPtrWillBePersistent<CSSPrimitiveValue> m_cachedCSSPrimitiveValue; |
| 159 | 159 |
| 160 friend class AnimationAnimatableLengthTest; | 160 friend class AnimationAnimatableLengthTest; |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableLength, isLength()); | 163 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableLength, isLength()); |
| 164 | 164 |
| 165 } // namespace WebCore | 165 } // namespace WebCore |
| 166 | 166 |
| 167 #endif // AnimatableLength_h | 167 #endif // AnimatableLength_h |
| OLD | NEW |