| 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, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #include "core/svg/SVGPathElement.h" | 21 #include "core/svg/SVGPathElement.h" |
| 22 | 22 |
| 23 #include "core/css/CSSPrimitiveValue.h" | 23 #include "core/css/CSSIdentifierValue.h" |
| 24 #include "core/dom/StyleChangeReason.h" | 24 #include "core/dom/StyleChangeReason.h" |
| 25 #include "core/layout/svg/LayoutSVGPath.h" | 25 #include "core/layout/svg/LayoutSVGPath.h" |
| 26 #include "core/svg/SVGMPathElement.h" | 26 #include "core/svg/SVGMPathElement.h" |
| 27 #include "core/svg/SVGPathQuery.h" | 27 #include "core/svg/SVGPathQuery.h" |
| 28 #include "core/svg/SVGPathUtilities.h" | 28 #include "core/svg/SVGPathUtilities.h" |
| 29 #include "core/svg/SVGPointTearOff.h" | 29 #include "core/svg/SVGPointTearOff.h" |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 class SVGAnimatedPathLength final : public SVGAnimatedNumber { | 33 class SVGAnimatedPathLength final : public SVGAnimatedNumber { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 SVGAnimatedPropertyBase* property = propertyFromAttribute(name); | 164 SVGAnimatedPropertyBase* property = propertyFromAttribute(name); |
| 165 if (property == m_path) { | 165 if (property == m_path) { |
| 166 SVGAnimatedPath* path = this->path(); | 166 SVGAnimatedPath* path = this->path(); |
| 167 // If this is a <use> instance, return the referenced path to maximize geome
try sharing. | 167 // If this is a <use> instance, return the referenced path to maximize geome
try sharing. |
| 168 if (const SVGElement* element = correspondingElement()) | 168 if (const SVGElement* element = correspondingElement()) |
| 169 path = toSVGPathElement(element)->path(); | 169 path = toSVGPathElement(element)->path(); |
| 170 | 170 |
| 171 CSSPathValue* pathValue = path->currentValue()->pathValue(); | 171 CSSPathValue* pathValue = path->currentValue()->pathValue(); |
| 172 if (pathValue->stylePath()->byteStream().isEmpty()) { | 172 if (pathValue->stylePath()->byteStream().isEmpty()) { |
| 173 addPropertyToPresentationAttributeStyle( | 173 addPropertyToPresentationAttributeStyle( |
| 174 style, CSSPropertyD, | 174 style, CSSPropertyD, CSSIdentifierValue::create(CSSValueNone)); |
| 175 CSSPrimitiveValue::createIdentifier(CSSValueNone)); | |
| 176 return; | 175 return; |
| 177 } | 176 } |
| 178 addPropertyToPresentationAttributeStyle(style, CSSPropertyD, pathValue); | 177 addPropertyToPresentationAttributeStyle(style, CSSPropertyD, pathValue); |
| 179 return; | 178 return; |
| 180 } | 179 } |
| 181 SVGGeometryElement::collectStyleForPresentationAttribute(name, value, style); | 180 SVGGeometryElement::collectStyleForPresentationAttribute(name, value, style); |
| 182 } | 181 } |
| 183 | 182 |
| 184 void SVGPathElement::invalidateMPathDependencies() { | 183 void SVGPathElement::invalidateMPathDependencies() { |
| 185 // <mpath> can only reference <path> but this dependency is not handled in | 184 // <mpath> can only reference <path> but this dependency is not handled in |
| (...skipping 19 matching lines...) Expand all Loading... |
| 205 } | 204 } |
| 206 | 205 |
| 207 FloatRect SVGPathElement::getBBox() { | 206 FloatRect SVGPathElement::getBBox() { |
| 208 document().updateStyleAndLayoutIgnorePendingStylesheets(); | 207 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 209 | 208 |
| 210 // We want the exact bounds. | 209 // We want the exact bounds. |
| 211 return SVGPathElement::asPath().boundingRect(Path::BoundsType::Exact); | 210 return SVGPathElement::asPath().boundingRect(Path::BoundsType::Exact); |
| 212 } | 211 } |
| 213 | 212 |
| 214 } // namespace blink | 213 } // namespace blink |
| OLD | NEW |