| OLD | NEW |
| 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 | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights |
| 4 * reserved. | 4 * reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 case UnitType::kGradians: | 258 case UnitType::kGradians: |
| 259 return grad2deg(GetDoubleValue()); | 259 return grad2deg(GetDoubleValue()); |
| 260 case UnitType::kTurns: | 260 case UnitType::kTurns: |
| 261 return turn2deg(GetDoubleValue()); | 261 return turn2deg(GetDoubleValue()); |
| 262 default: | 262 default: |
| 263 NOTREACHED(); | 263 NOTREACHED(); |
| 264 return 0; | 264 return 0; |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 double CSSPrimitiveValue::ComputeDotsPerPixel() const { |
| 269 UnitType current_type = TypeWithCalcResolved(); |
| 270 DCHECK(IsResolution(current_type)); |
| 271 return GetDoubleValue() * ConversionToCanonicalUnitsScaleFactor(current_type); |
| 272 } |
| 273 |
| 268 template <> | 274 template <> |
| 269 int CSSPrimitiveValue::ComputeLength( | 275 int CSSPrimitiveValue::ComputeLength( |
| 270 const CSSToLengthConversionData& conversion_data) const { | 276 const CSSToLengthConversionData& conversion_data) const { |
| 271 return RoundForImpreciseConversion<int>(ComputeLengthDouble(conversion_data)); | 277 return RoundForImpreciseConversion<int>(ComputeLengthDouble(conversion_data)); |
| 272 } | 278 } |
| 273 | 279 |
| 274 template <> | 280 template <> |
| 275 unsigned CSSPrimitiveValue::ComputeLength( | 281 unsigned CSSPrimitiveValue::ComputeLength( |
| 276 const CSSToLengthConversionData& conversion_data) const { | 282 const CSSToLengthConversionData& conversion_data) const { |
| 277 return RoundForImpreciseConversion<unsigned>( | 283 return RoundForImpreciseConversion<unsigned>( |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 case UnitType::kCalc: | 721 case UnitType::kCalc: |
| 716 visitor->Trace(value_.calc); | 722 visitor->Trace(value_.calc); |
| 717 break; | 723 break; |
| 718 default: | 724 default: |
| 719 break; | 725 break; |
| 720 } | 726 } |
| 721 CSSValue::TraceAfterDispatch(visitor); | 727 CSSValue::TraceAfterDispatch(visitor); |
| 722 } | 728 } |
| 723 | 729 |
| 724 } // namespace blink | 730 } // namespace blink |
| OLD | NEW |