Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGLengthContext.cpp

Issue 2591663003: Use double precision in SVGLengthContext::convertValueToUserUnits (Closed)
Patch Set: Expectations updated Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/gradient-userSpaceOnUse-with-percentage-expected.png ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/gradient-userSpaceOnUse-with-percentage-expected.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698