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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |