| 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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 return static_cast<float>(computeLengthDouble(conversionData)); | 604 return static_cast<float>(computeLengthDouble(conversionData)); |
| 605 } | 605 } |
| 606 | 606 |
| 607 template<> double CSSPrimitiveValue::computeLength(const CSSToLengthConversionDa
ta& conversionData) | 607 template<> double CSSPrimitiveValue::computeLength(const CSSToLengthConversionDa
ta& conversionData) |
| 608 { | 608 { |
| 609 return computeLengthDouble(conversionData); | 609 return computeLengthDouble(conversionData); |
| 610 } | 610 } |
| 611 | 611 |
| 612 double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& c
onversionData) | 612 double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& c
onversionData) |
| 613 { | 613 { |
| 614 // The logic in this function is duplicated in MediaValues::computeLength |
| 615 // because MediaValues::computeLength needs nearly identical logic, but we h
aven't found a way to make |
| 616 // CSSPrimitiveValue::computeLengthDouble more generic (to solve both cases)
without hurting performance. |
| 614 if (m_primitiveUnitType == CSS_CALC) | 617 if (m_primitiveUnitType == CSS_CALC) |
| 615 return m_value.calc->computeLengthPx(conversionData); | 618 return m_value.calc->computeLengthPx(conversionData); |
| 616 | 619 |
| 617 const RenderStyle& style = conversionData.style(); | 620 const RenderStyle& style = conversionData.style(); |
| 618 const RenderStyle* rootStyle = conversionData.rootStyle(); | 621 const RenderStyle* rootStyle = conversionData.rootStyle(); |
| 619 bool computingFontSize = conversionData.computingFontSize(); | 622 bool computingFontSize = conversionData.computingFontSize(); |
| 620 | 623 |
| 621 double factor; | 624 double factor; |
| 622 | 625 |
| 623 switch (primitiveType()) { | 626 switch (primitiveType()) { |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1421 case CSS_SHAPE: | 1424 case CSS_SHAPE: |
| 1422 visitor->trace(m_value.shape); | 1425 visitor->trace(m_value.shape); |
| 1423 break; | 1426 break; |
| 1424 default: | 1427 default: |
| 1425 break; | 1428 break; |
| 1426 } | 1429 } |
| 1427 CSSValue::traceAfterDispatch(visitor); | 1430 CSSValue::traceAfterDispatch(visitor); |
| 1428 } | 1431 } |
| 1429 | 1432 |
| 1430 } // namespace WebCore | 1433 } // namespace WebCore |
| OLD | NEW |