Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: Source/core/animation/AnimatableLength.h

Issue 90113003: Web Animations CSS: Fix crash when animating viewport units (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Linux test expectation search fallback path sadface Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 ASSERT(m_calcExpression); 95 ASSERT(m_calcExpression);
96 } 96 }
97 virtual AnimatableType type() const OVERRIDE { return TypeLength; } 97 virtual AnimatableType type() const OVERRIDE { return TypeLength; }
98 virtual bool equalTo(const AnimatableValue*) const OVERRIDE; 98 virtual bool equalTo(const AnimatableValue*) const OVERRIDE;
99 99
100 bool isCalc() const 100 bool isCalc() const
101 { 101 {
102 return m_unitType == UnitTypeCalc; 102 return m_unitType == UnitTypeCalc;
103 } 103 }
104 104
105 bool isViewportUnit() const
106 {
107 return m_unitType == UnitTypeViewportWidth || m_unitType == UnitTypeView portHeight || m_unitType == UnitTypeViewportMin || m_unitType == UnitTypeViewpor tMax;
108 }
109
105 static PassRefPtr<AnimatableLength> create(const AnimatableLength* leftAdden d, const AnimatableLength* rightAddend) 110 static PassRefPtr<AnimatableLength> create(const AnimatableLength* leftAdden d, const AnimatableLength* rightAddend)
106 { 111 {
107 ASSERT(leftAddend && rightAddend); 112 ASSERT(leftAddend && rightAddend);
108 return create(CSSCalcValue::createExpressionNode(leftAddend->toCSSCalcEx pressionNode(), rightAddend->toCSSCalcExpressionNode(), CalcAdd)); 113 return create(CSSCalcValue::createExpressionNode(leftAddend->toCSSCalcEx pressionNode(), rightAddend->toCSSCalcExpressionNode(), CalcAdd));
109 } 114 }
110 115
111 PassRefPtr<CSSPrimitiveValue> toCSSPrimitiveValue(NumberRange) const; 116 PassRefPtr<CSSPrimitiveValue> toCSSPrimitiveValue(NumberRange) const;
112 PassRefPtr<CSSCalcExpressionNode> toCSSCalcExpressionNode() const; 117 PassRefPtr<CSSCalcExpressionNode> toCSSCalcExpressionNode() const;
113 118
114 PassRefPtr<AnimatableLength> scale(double) const; 119 PassRefPtr<AnimatableLength> scale(double) const;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 mutable RefPtr<CSSPrimitiveValue> m_cachedCSSPrimitiveValue; 157 mutable RefPtr<CSSPrimitiveValue> m_cachedCSSPrimitiveValue;
153 158
154 friend class AnimationAnimatableLengthTest; 159 friend class AnimationAnimatableLengthTest;
155 }; 160 };
156 161
157 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableLength, isLength()); 162 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableLength, isLength());
158 163
159 } // namespace WebCore 164 } // namespace WebCore
160 165
161 #endif // AnimatableLength_h 166 #endif // AnimatableLength_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698