| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 ASSERT_NOT_REACHED(); | 210 ASSERT_NOT_REACHED(); |
| 211 return 0; | 211 return 0; |
| 212 } | 212 } |
| 213 | 213 |
| 214 static inline RenderStyle* renderStyleForLengthResolving(const SVGElement* conte
xt) | 214 static inline RenderStyle* renderStyleForLengthResolving(const SVGElement* conte
xt) |
| 215 { | 215 { |
| 216 if (!context) | 216 if (!context) |
| 217 return 0; | 217 return 0; |
| 218 | 218 |
| 219 const ContainerNode* currentContext = context; | 219 const ContainerNode* currentContext = context; |
| 220 while (currentContext) { | 220 do { |
| 221 if (currentContext->renderer()) | 221 if (currentContext->renderer()) |
| 222 return currentContext->renderer()->style(); | 222 return currentContext->renderer()->style(); |
| 223 currentContext = currentContext->parentNode(); | 223 currentContext = currentContext->parentNode(); |
| 224 } | 224 } while (currentContext); |
| 225 | 225 |
| 226 // There must be at least a RenderSVGRoot renderer, carrying a style. | 226 // There must be at least a RenderSVGRoot renderer, carrying a style. |
| 227 ASSERT_NOT_REACHED(); | 227 ASSERT_NOT_REACHED(); |
| 228 return 0; | 228 return 0; |
| 229 } | 229 } |
| 230 | 230 |
| 231 float SVGLengthContext::convertValueFromUserUnitsToEMS(float value, ExceptionSta
te& exceptionState) const | 231 float SVGLengthContext::convertValueFromUserUnitsToEMS(float value, ExceptionSta
te& exceptionState) const |
| 232 { | 232 { |
| 233 RenderStyle* style = renderStyleForLengthResolving(m_context); | 233 RenderStyle* style = renderStyleForLengthResolving(m_context); |
| 234 if (!style) { | 234 if (!style) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 312 |
| 313 const SVGSVGElement* svg = toSVGSVGElement(viewportElement); | 313 const SVGSVGElement* svg = toSVGSVGElement(viewportElement); |
| 314 viewportSize = svg->currentViewBoxRect().size(); | 314 viewportSize = svg->currentViewBoxRect().size(); |
| 315 if (viewportSize.isEmpty()) | 315 if (viewportSize.isEmpty()) |
| 316 viewportSize = svg->currentViewportSize(); | 316 viewportSize = svg->currentViewportSize(); |
| 317 | 317 |
| 318 return true; | 318 return true; |
| 319 } | 319 } |
| 320 | 320 |
| 321 } | 321 } |
| OLD | NEW |