| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 float SVGLengthContext::valueForLength(const Length& length, | 239 float SVGLengthContext::valueForLength(const Length& length, |
| 240 const ComputedStyle& style, | 240 const ComputedStyle& style, |
| 241 float dimension) { | 241 float dimension) { |
| 242 return valueForLength(length, style.effectiveZoom(), dimension); | 242 return valueForLength(length, style.effectiveZoom(), dimension); |
| 243 } | 243 } |
| 244 | 244 |
| 245 float SVGLengthContext::valueForLength(const Length& length, | 245 float SVGLengthContext::valueForLength(const Length& length, |
| 246 float zoom, | 246 float zoom, |
| 247 float dimension) { | 247 float dimension) { |
| 248 ASSERT(zoom != 0); | 248 DCHECK_NE(zoom, 0); |
| 249 // isIntrinsic can occur for 'width' and 'height', but has no | 249 // isIntrinsic can occur for 'width' and 'height', but has no |
| 250 // real meaning for svg. | 250 // real meaning for svg. |
| 251 if (length.isIntrinsic()) | 251 if (length.isIntrinsic()) |
| 252 return 0; | 252 return 0; |
| 253 return floatValueForLength(length, dimension * zoom) / zoom; | 253 return floatValueForLength(length, dimension * zoom) / zoom; |
| 254 } | 254 } |
| 255 | 255 |
| 256 float SVGLengthContext::convertValueToUserUnits( | 256 float SVGLengthContext::convertValueToUserUnits( |
| 257 float value, | 257 float value, |
| 258 SVGLengthMode mode, | 258 SVGLengthMode mode, |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 const ComputedStyle* rootStyle = rootElementStyle(m_context); | 459 const ComputedStyle* rootStyle = rootElementStyle(m_context); |
| 460 if (!rootStyle) | 460 if (!rootStyle) |
| 461 return 0; | 461 return 0; |
| 462 | 462 |
| 463 CSSToLengthConversionData conversionData = CSSToLengthConversionData( | 463 CSSToLengthConversionData conversionData = CSSToLengthConversionData( |
| 464 style, rootStyle, m_context->document().layoutViewItem(), 1.0f); | 464 style, rootStyle, m_context->document().layoutViewItem(), 1.0f); |
| 465 Length length = primitiveValue.convertToLength(conversionData); | 465 Length length = primitiveValue.convertToLength(conversionData); |
| 466 return valueForLength(length, 1.0f, mode); | 466 return valueForLength(length, 1.0f, mode); |
| 467 } | 467 } |
| 468 } // namespace blink | 468 } // namespace blink |
| OLD | NEW |