| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 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 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "core/svg/SVGPathUtilities.h" | 47 #include "core/svg/SVGPathUtilities.h" |
| 48 #include "core/svg/SVGPointTearOff.h" | 48 #include "core/svg/SVGPointTearOff.h" |
| 49 | 49 |
| 50 namespace blink { | 50 namespace blink { |
| 51 | 51 |
| 52 inline SVGPathElement::SVGPathElement(Document& document) | 52 inline SVGPathElement::SVGPathElement(Document& document) |
| 53 : SVGGeometryElement(SVGNames::pathTag, document) | 53 : SVGGeometryElement(SVGNames::pathTag, document) |
| 54 , m_pathLength(SVGAnimatedNumber::create(this, SVGNames::pathLengthAttr, SVG
Number::create())) | 54 , m_pathLength(SVGAnimatedNumber::create(this, SVGNames::pathLengthAttr, SVG
Number::create())) |
| 55 , m_pathSegList(SVGAnimatedPath::create(this, SVGNames::dAttr)) | 55 , m_pathSegList(SVGAnimatedPath::create(this, SVGNames::dAttr)) |
| 56 { | 56 { |
| 57 ScriptWrappable::init(this); | |
| 58 | |
| 59 addToPropertyMap(m_pathLength); | 57 addToPropertyMap(m_pathLength); |
| 60 addToPropertyMap(m_pathSegList); | 58 addToPropertyMap(m_pathSegList); |
| 61 } | 59 } |
| 62 | 60 |
| 63 DEFINE_NODE_FACTORY(SVGPathElement) | 61 DEFINE_NODE_FACTORY(SVGPathElement) |
| 64 | 62 |
| 65 float SVGPathElement::getTotalLength() | 63 float SVGPathElement::getTotalLength() |
| 66 { | 64 { |
| 67 float totalLength = 0; | 65 float totalLength = 0; |
| 68 getTotalLengthOfSVGPathByteStream(pathByteStream(), totalLength); | 66 getTotalLengthOfSVGPathByteStream(pathByteStream(), totalLength); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 document().updateLayoutIgnorePendingStylesheets(); | 278 document().updateLayoutIgnorePendingStylesheets(); |
| 281 | 279 |
| 282 // FIXME: Eventually we should support getBBox for detached elements. | 280 // FIXME: Eventually we should support getBBox for detached elements. |
| 283 if (!renderer()) | 281 if (!renderer()) |
| 284 return FloatRect(); | 282 return FloatRect(); |
| 285 | 283 |
| 286 RenderSVGShape* renderer = toRenderSVGShape(this->renderer()); | 284 RenderSVGShape* renderer = toRenderSVGShape(this->renderer()); |
| 287 return renderer->path().boundingRect(); | 285 return renderer->path().boundingRect(); |
| 288 } | 286 } |
| 289 | 287 |
| 290 } | 288 } // namespace blink |
| OLD | NEW |