| 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 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 case Percent: | 251 case Percent: |
| 252 init(UnitType::Percentage); | 252 init(UnitType::Percentage); |
| 253 ASSERT(std::isfinite(length.percent())); | 253 ASSERT(std::isfinite(length.percent())); |
| 254 m_value.num = length.percent(); | 254 m_value.num = length.percent(); |
| 255 break; | 255 break; |
| 256 case Fixed: | 256 case Fixed: |
| 257 init(UnitType::Pixels); | 257 init(UnitType::Pixels); |
| 258 m_value.num = length.value() / zoom; | 258 m_value.num = length.value() / zoom; |
| 259 break; | 259 break; |
| 260 case Calculated: { | 260 case Calculated: { |
| 261 const CalculationValue& calc = length.calculationValue(); | 261 const CalculationValue& calc = length.getCalculationValue(); |
| 262 if (calc.pixels() && calc.percent()) { | 262 if (calc.pixels() && calc.percent()) { |
| 263 init(CSSCalcValue::create( | 263 init(CSSCalcValue::create( |
| 264 CSSCalcValue::createExpressionNode(calc.pixels() / zoom, calc.pe
rcent()), | 264 CSSCalcValue::createExpressionNode(calc.pixels() / zoom, calc.pe
rcent()), |
| 265 calc.valueRange())); | 265 calc.getValueRange())); |
| 266 break; | 266 break; |
| 267 } | 267 } |
| 268 if (calc.percent()) { | 268 if (calc.percent()) { |
| 269 init(UnitType::Percentage); | 269 init(UnitType::Percentage); |
| 270 m_value.num = calc.percent(); | 270 m_value.num = calc.percent(); |
| 271 } else { | 271 } else { |
| 272 init(UnitType::Pixels); | 272 init(UnitType::Pixels); |
| 273 m_value.num = calc.pixels() / zoom; | 273 m_value.num = calc.pixels() / zoom; |
| 274 } | 274 } |
| 275 if (m_value.num < 0 && calc.isNonNegative()) | 275 if (m_value.num < 0 && calc.isNonNegative()) |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 visitor->trace(m_value.calc); | 836 visitor->trace(m_value.calc); |
| 837 break; | 837 break; |
| 838 default: | 838 default: |
| 839 break; | 839 break; |
| 840 } | 840 } |
| 841 #endif | 841 #endif |
| 842 CSSValue::traceAfterDispatch(visitor); | 842 CSSValue::traceAfterDispatch(visitor); |
| 843 } | 843 } |
| 844 | 844 |
| 845 } // namespace blink | 845 } // namespace blink |
| OLD | NEW |