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

Side by Side Diff: Source/core/css/CSSPrimitiveValue.cpp

Issue 813233002: Animation: Fix loss of type information when interpolating value of 0 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Attempt to fix linux oilpan errors Created 6 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
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 // We do not apply the zoom factor when we are computing the value of the fo nt-size property. The zooming 658 // We do not apply the zoom factor when we are computing the value of the fo nt-size property. The zooming
659 // for font sizes is much more complicated, since we have to worry about enf orcing the minimum font size preference 659 // for font sizes is much more complicated, since we have to worry about enf orcing the minimum font size preference
660 // as well as enforcing the implicit "smart minimum." 660 // as well as enforcing the implicit "smart minimum."
661 double result = getDoubleValue() * factor; 661 double result = getDoubleValue() * factor;
662 if (isFontRelativeLength()) 662 if (isFontRelativeLength())
663 return result; 663 return result;
664 664
665 return result * conversionData.zoom(); 665 return result * conversionData.zoom();
666 } 666 }
667 667
668 void CSSPrimitiveValue::accumulateLengthArray(CSSLengthArray& lengthArray, doubl e multiplier) const 668 void CSSPrimitiveValue::accumulateLengthArray(CSSLengthArray& lengthArray, CSSLe ngthTypeArray& lengthTypeArray, double multiplier) const
669 { 669 {
670 ASSERT(lengthArray.size() == LengthUnitTypeCount); 670 ASSERT(lengthArray.size() == LengthUnitTypeCount);
671 671
672 if (m_primitiveUnitType == CSS_CALC) { 672 if (m_primitiveUnitType == CSS_CALC) {
673 cssCalcValue()->accumulateLengthArray(lengthArray, multiplier); 673 cssCalcValue()->accumulateLengthArray(lengthArray, lengthTypeArray, mult iplier);
674 return; 674 return;
675 } 675 }
676 676
677 LengthUnitType lengthType; 677 LengthUnitType lengthType;
678 if (unitTypeToLengthUnitType(static_cast<UnitType>(m_primitiveUnitType), len gthType)) 678 if (unitTypeToLengthUnitType(static_cast<UnitType>(m_primitiveUnitType), len gthType)) {
679 lengthArray.at(lengthType) += m_value.num * conversionToCanonicalUnitsSc aleFactor(static_cast<UnitType>(m_primitiveUnitType)) * multiplier; 679 lengthArray.at(lengthType) += m_value.num * conversionToCanonicalUnitsSc aleFactor(static_cast<UnitType>(m_primitiveUnitType)) * multiplier;
680 lengthTypeArray.set(lengthType);
681 }
680 } 682 }
681 683
682 double CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor(UnitType unitTyp e) 684 double CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor(UnitType unitTyp e)
683 { 685 {
684 double factor = 1.0; 686 double factor = 1.0;
685 // FIXME: the switch can be replaced by an array of scale factors. 687 // FIXME: the switch can be replaced by an array of scale factors.
686 switch (unitType) { 688 switch (unitType) {
687 // These are "canonical" units in their respective categories. 689 // These are "canonical" units in their respective categories.
688 case CSS_PX: 690 case CSS_PX:
689 case CSS_DEG: 691 case CSS_DEG:
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 visitor->trace(m_value.shape); 1227 visitor->trace(m_value.shape);
1226 break; 1228 break;
1227 default: 1229 default:
1228 break; 1230 break;
1229 } 1231 }
1230 #endif 1232 #endif
1231 CSSValue::traceAfterDispatch(visitor); 1233 CSSValue::traceAfterDispatch(visitor);
1232 } 1234 }
1233 1235
1234 } // namespace blink 1236 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698