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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp

Issue 1421533006: Make SVGLength wrap a CSSPrimitiveValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added expectation Created 5 years, 1 month 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 * 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 return m_fontSizes.rem(); 115 return m_fontSizes.rem();
116 } 116 }
117 117
118 double CSSToLengthConversionData::zoomedComputedPixels(double value, CSSPrimitiv eValue::UnitType type) const 118 double CSSToLengthConversionData::zoomedComputedPixels(double value, CSSPrimitiv eValue::UnitType type) const
119 { 119 {
120 // The logic in this function is duplicated in MediaValues::computeLength() 120 // The logic in this function is duplicated in MediaValues::computeLength()
121 // because MediaValues::computeLength() needs nearly identical logic, but we haven't found a way to make 121 // because MediaValues::computeLength() needs nearly identical logic, but we haven't found a way to make
122 // zoomedComputedPixels() more generic (to solve both cases) without hurting performance. 122 // zoomedComputedPixels() more generic (to solve both cases) without hurting performance.
123 switch (type) { 123 switch (type) {
124 case CSSPrimitiveValue::UnitType::Pixels: 124 case CSSPrimitiveValue::UnitType::Pixels:
125 case CSSPrimitiveValue::UnitType::UserUnits:
125 return value * zoom(); 126 return value * zoom();
126 127
127 case CSSPrimitiveValue::UnitType::Centimeters: 128 case CSSPrimitiveValue::UnitType::Centimeters:
128 return value * cssPixelsPerCentimeter * zoom(); 129 return value * cssPixelsPerCentimeter * zoom();
129 130
130 case CSSPrimitiveValue::UnitType::Millimeters: 131 case CSSPrimitiveValue::UnitType::Millimeters:
131 return value * cssPixelsPerMillimeter * zoom(); 132 return value * cssPixelsPerMillimeter * zoom();
132 133
133 case CSSPrimitiveValue::UnitType::Inches: 134 case CSSPrimitiveValue::UnitType::Inches:
134 return value * cssPixelsPerInch * zoom(); 135 return value * cssPixelsPerInch * zoom();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 case CSSPrimitiveValue::UnitType::Chs: 168 case CSSPrimitiveValue::UnitType::Chs:
168 return value * chFontSize(); 169 return value * chFontSize();
169 170
170 default: 171 default:
171 ASSERT_NOT_REACHED(); 172 ASSERT_NOT_REACHED();
172 return 0; 173 return 0;
173 } 174 }
174 } 175 }
175 176
176 } // namespace blink 177 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp ('k') | third_party/WebKit/Source/core/css/MediaValues.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698