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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, |
259 CSSPrimitiveValue::UnitType fromUnit) const { | 259 CSSPrimitiveValue::UnitType fromUnit) const { |
260 float userUnits = value; | 260 double userUnits = value; |
261 switch (fromUnit) { | 261 switch (fromUnit) { |
262 case CSSPrimitiveValue::UnitType::Pixels: | 262 case CSSPrimitiveValue::UnitType::Pixels: |
263 case CSSPrimitiveValue::UnitType::Number: | 263 case CSSPrimitiveValue::UnitType::Number: |
264 case CSSPrimitiveValue::UnitType::Integer: | 264 case CSSPrimitiveValue::UnitType::Integer: |
265 case CSSPrimitiveValue::UnitType::UserUnits: | 265 case CSSPrimitiveValue::UnitType::UserUnits: |
266 userUnits = value; | 266 userUnits = value; |
267 break; | 267 break; |
268 case CSSPrimitiveValue::UnitType::Percentage: { | 268 case CSSPrimitiveValue::UnitType::Percentage: { |
269 FloatSize viewportSize; | 269 FloatSize viewportSize; |
270 if (!determineViewport(viewportSize)) | 270 if (!determineViewport(viewportSize)) |
(...skipping 188 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 |