| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 University of Szeged | 2 * Copyright (C) 2011 University of Szeged |
| 3 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> | 3 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 LayoutSVGRect::~LayoutSVGRect() {} | 38 LayoutSVGRect::~LayoutSVGRect() {} |
| 39 | 39 |
| 40 void LayoutSVGRect::updateShapeFromElement() { | 40 void LayoutSVGRect::updateShapeFromElement() { |
| 41 // Before creating a new object we need to clear the cached bounding box | 41 // Before creating a new object we need to clear the cached bounding box |
| 42 // to avoid using garbage. | 42 // to avoid using garbage. |
| 43 m_fillBoundingBox = FloatRect(); | 43 m_fillBoundingBox = FloatRect(); |
| 44 m_strokeBoundingBox = FloatRect(); | 44 m_strokeBoundingBox = FloatRect(); |
| 45 m_usePathFallback = false; | 45 m_usePathFallback = false; |
| 46 SVGRectElement* rect = toSVGRectElement(element()); | 46 SVGRectElement* rect = toSVGRectElement(element()); |
| 47 ASSERT(rect); | 47 DCHECK(rect); |
| 48 | 48 |
| 49 SVGLengthContext lengthContext(rect); | 49 SVGLengthContext lengthContext(rect); |
| 50 FloatSize boundingBoxSize( | 50 FloatSize boundingBoxSize( |
| 51 lengthContext.valueForLength(styleRef().width(), styleRef(), | 51 lengthContext.valueForLength(styleRef().width(), styleRef(), |
| 52 SVGLengthMode::Width), | 52 SVGLengthMode::Width), |
| 53 lengthContext.valueForLength(styleRef().height(), styleRef(), | 53 lengthContext.valueForLength(styleRef().height(), styleRef(), |
| 54 SVGLengthMode::Height)); | 54 SVGLengthMode::Height)); |
| 55 | 55 |
| 56 // Spec: "A negative value is an error." | 56 // Spec: "A negative value is an error." |
| 57 if (boundingBoxSize.width() < 0 || boundingBoxSize.height() < 0) | 57 if (boundingBoxSize.width() < 0 || boundingBoxSize.height() < 0) |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // An approximation of sqrt(2) is used here because at certain precise | 139 // An approximation of sqrt(2) is used here because at certain precise |
| 140 // miterlimits, the join style used might not be correct (e.g. a miterlimit | 140 // miterlimits, the join style used might not be correct (e.g. a miterlimit |
| 141 // of 1.4142135 should result in bevel joins, but may be drawn using miter | 141 // of 1.4142135 should result in bevel joins, but may be drawn using miter |
| 142 // joins). | 142 // joins). |
| 143 return svgStyle.strokeDashArray()->isEmpty() && | 143 return svgStyle.strokeDashArray()->isEmpty() && |
| 144 svgStyle.joinStyle() == MiterJoin && | 144 svgStyle.joinStyle() == MiterJoin && |
| 145 svgStyle.strokeMiterLimit() >= 1.5; | 145 svgStyle.strokeMiterLimit() >= 1.5; |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace blink | 148 } // namespace blink |
| OLD | NEW |