| 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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 return static_cast<float>(computeLengthDouble(conversionData)); | 588 return static_cast<float>(computeLengthDouble(conversionData)); |
| 589 } | 589 } |
| 590 | 590 |
| 591 template<> double CSSPrimitiveValue::computeLength(const CSSToLengthConversionDa
ta& conversionData) | 591 template<> double CSSPrimitiveValue::computeLength(const CSSToLengthConversionDa
ta& conversionData) |
| 592 { | 592 { |
| 593 return computeLengthDouble(conversionData); | 593 return computeLengthDouble(conversionData); |
| 594 } | 594 } |
| 595 | 595 |
| 596 double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& c
onversionData) | 596 double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& c
onversionData) |
| 597 { | 597 { |
| 598 // The logic in this function is duplicated in MediaValues::computeLength | |
| 599 // because MediaValues::computeLength needs nearly identical logic, but we h
aven't found a way to make | |
| 600 // CSSPrimitiveValue::computeLengthDouble more generic (to solve both cases)
without hurting performance. | |
| 601 if (m_primitiveUnitType == CSS_CALC) | 598 if (m_primitiveUnitType == CSS_CALC) |
| 602 return m_value.calc->computeLengthPx(conversionData); | 599 return m_value.calc->computeLengthPx(conversionData); |
| 603 | 600 |
| 604 const RenderStyle& style = conversionData.style(); | 601 const RenderStyle& style = conversionData.style(); |
| 605 const RenderStyle* rootStyle = conversionData.rootStyle(); | 602 const RenderStyle* rootStyle = conversionData.rootStyle(); |
| 606 bool computingFontSize = conversionData.computingFontSize(); | 603 bool computingFontSize = conversionData.computingFontSize(); |
| 607 | 604 |
| 608 double factor; | 605 double factor; |
| 609 | 606 |
| 610 switch (primitiveType()) { | 607 switch (primitiveType()) { |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 case CSS_SHAPE: | 1405 case CSS_SHAPE: |
| 1409 visitor->trace(m_value.shape); | 1406 visitor->trace(m_value.shape); |
| 1410 break; | 1407 break; |
| 1411 default: | 1408 default: |
| 1412 break; | 1409 break; |
| 1413 } | 1410 } |
| 1414 CSSValue::traceAfterDispatch(visitor); | 1411 CSSValue::traceAfterDispatch(visitor); |
| 1415 } | 1412 } |
| 1416 | 1413 |
| 1417 } // namespace WebCore | 1414 } // namespace WebCore |
| OLD | NEW |