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

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

Issue 1162453002: [svg2] Make SVGLength wrap a CSSPrimitiveValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nit Created 5 years, 6 months 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 * (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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 692
693 return factor; 693 return factor;
694 } 694 }
695 695
696 Length CSSPrimitiveValue::convertToLength(const CSSToLengthConversionData& conve rsionData) 696 Length CSSPrimitiveValue::convertToLength(const CSSToLengthConversionData& conve rsionData)
697 { 697 {
698 if (isLength()) 698 if (isLength())
699 return computeLength<Length>(conversionData); 699 return computeLength<Length>(conversionData);
700 if (isPercentage()) 700 if (isPercentage())
701 return Length(getDoubleValue(), Percent); 701 return Length(getDoubleValue(), Percent);
702 if (isNumber())
703 return Length(getDoubleValue() * conversionData.zoom(), Fixed);
702 ASSERT(isCalculated()); 704 ASSERT(isCalculated());
703 return Length(cssCalcValue()->toCalcValue(conversionData)); 705 return Length(cssCalcValue()->toCalcValue(conversionData));
704 } 706 }
705 707
706 double CSSPrimitiveValue::getDoubleValue() const 708 double CSSPrimitiveValue::getDoubleValue() const
707 { 709 {
708 return m_primitiveUnitType != CSS_CALC ? m_value.num : m_value.calc->doubleV alue(); 710 return m_primitiveUnitType != CSS_CALC ? m_value.num : m_value.calc->doubleV alue();
709 } 711 }
710 712
711 CSSPrimitiveValue::UnitType CSSPrimitiveValue::canonicalUnitTypeForCategory(Unit Category category) 713 CSSPrimitiveValue::UnitType CSSPrimitiveValue::canonicalUnitTypeForCategory(Unit Category category)
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 visitor->trace(m_value.shape); 1137 visitor->trace(m_value.shape);
1136 break; 1138 break;
1137 default: 1139 default:
1138 break; 1140 break;
1139 } 1141 }
1140 #endif 1142 #endif
1141 CSSValue::traceAfterDispatch(visitor); 1143 CSSValue::traceAfterDispatch(visitor);
1142 } 1144 }
1143 1145
1144 } // namespace blink 1146 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/animation/LengthSVGInterpolation.cpp ('k') | Source/core/css/parser/CSSParserFastPaths.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698