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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 float SVGLengthContext::valueForLength(const Length& length, const ComputedStyle
& style, float dimension) | 171 float SVGLengthContext::valueForLength(const Length& length, const ComputedStyle
& style, float dimension) |
172 { | 172 { |
173 return valueForLength(length, style.effectiveZoom(), dimension); | 173 return valueForLength(length, style.effectiveZoom(), dimension); |
174 } | 174 } |
175 | 175 |
176 float SVGLengthContext::valueForLength(const Length& length, float zoom, float d
imension) | 176 float SVGLengthContext::valueForLength(const Length& length, float zoom, float d
imension) |
177 { | 177 { |
178 ASSERT(zoom != 0); | 178 ASSERT(zoom != 0); |
179 // isIntrinsic can occur for 'width' and 'height', but has no | 179 // isIntrinsic can occur for 'width' and 'height', but has no |
180 // real meaning for svg. | 180 // real meaning for svg. |
181 if (length.isIntrinsic()) | 181 if (length.isIntrinsic() || length.isLegacyIntrinsic()) |
182 return 0; | 182 return 0; |
183 return floatValueForLength(length, dimension * zoom) / zoom; | 183 return floatValueForLength(length, dimension * zoom) / zoom; |
184 } | 184 } |
185 | 185 |
186 float SVGLengthContext::convertValueToUserUnits(float value, SVGLengthMode mode,
SVGLengthType fromUnit) const | 186 float SVGLengthContext::convertValueToUserUnits(float value, SVGLengthMode mode,
SVGLengthType fromUnit) const |
187 { | 187 { |
188 float userUnits = value; | 188 float userUnits = value; |
189 switch (fromUnit) { | 189 switch (fromUnit) { |
190 case LengthTypeUnknown: | 190 case LengthTypeUnknown: |
191 return 0; | 191 return 0; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 | 345 |
346 const SVGSVGElement& svg = toSVGSVGElement(*viewportElement); | 346 const SVGSVGElement& svg = toSVGSVGElement(*viewportElement); |
347 viewportSize = svg.currentViewBoxRect().size(); | 347 viewportSize = svg.currentViewBoxRect().size(); |
348 if (viewportSize.isEmpty()) | 348 if (viewportSize.isEmpty()) |
349 viewportSize = svg.currentViewportSize(); | 349 viewportSize = svg.currentViewportSize(); |
350 | 350 |
351 return true; | 351 return true; |
352 } | 352 } |
353 | 353 |
354 } | 354 } |
OLD | NEW |