OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 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 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
15 * | 15 * |
16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
20 */ | 20 */ |
21 | 21 |
22 #include "config.h" | 22 #include "config.h" |
23 | 23 |
24 #include "core/svg/SVGMarkerElement.h" | 24 #include "core/svg/SVGMarkerElement.h" |
25 | 25 |
26 #include "core/SVGNames.h" | 26 #include "core/SVGNames.h" |
27 #include "core/rendering/svg/RenderSVGResourceMarker.h" | 27 #include "core/layout/svg/LayoutSVGResourceMarker.h" |
28 #include "core/svg/SVGAngleTearOff.h" | 28 #include "core/svg/SVGAngleTearOff.h" |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 | 31 |
32 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGMarkerUn
itsType>() | 32 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGMarkerUn
itsType>() |
33 { | 33 { |
34 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); | 34 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); |
35 if (entries.isEmpty()) { | 35 if (entries.isEmpty()) { |
36 entries.append(std::make_pair(SVGMarkerUnitsUserSpaceOnUse, "userSpaceOn
Use")); | 36 entries.append(std::make_pair(SVGMarkerUnitsUserSpaceOnUse, "userSpaceOn
Use")); |
37 entries.append(std::make_pair(SVGMarkerUnitsStrokeWidth, "strokeWidth"))
; | 37 entries.append(std::make_pair(SVGMarkerUnitsStrokeWidth, "strokeWidth"))
; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 | 111 |
112 SVGElement::InvalidationGuard invalidationGuard(this); | 112 SVGElement::InvalidationGuard invalidationGuard(this); |
113 | 113 |
114 if (attrName == SVGNames::refXAttr | 114 if (attrName == SVGNames::refXAttr |
115 || attrName == SVGNames::refYAttr | 115 || attrName == SVGNames::refYAttr |
116 || attrName == SVGNames::markerWidthAttr | 116 || attrName == SVGNames::markerWidthAttr |
117 || attrName == SVGNames::markerHeightAttr) | 117 || attrName == SVGNames::markerHeightAttr) |
118 updateRelativeLengthsInformation(); | 118 updateRelativeLengthsInformation(); |
119 | 119 |
120 RenderSVGResourceContainer* renderer = toRenderSVGResourceContainer(this->re
nderer()); | 120 LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->re
nderer()); |
121 if (renderer) | 121 if (renderer) |
122 renderer->invalidateCacheAndMarkForLayout(); | 122 renderer->invalidateCacheAndMarkForLayout(); |
123 } | 123 } |
124 | 124 |
125 void SVGMarkerElement::childrenChanged(const ChildrenChange& change) | 125 void SVGMarkerElement::childrenChanged(const ChildrenChange& change) |
126 { | 126 { |
127 SVGElement::childrenChanged(change); | 127 SVGElement::childrenChanged(change); |
128 | 128 |
129 if (change.byParser) | 129 if (change.byParser) |
130 return; | 130 return; |
(...skipping 13 matching lines...) Expand all Loading... |
144 { | 144 { |
145 ASSERT(angle); | 145 ASSERT(angle); |
146 RefPtrWillBeRawPtr<SVGAngle> target = angle->target(); | 146 RefPtrWillBeRawPtr<SVGAngle> target = angle->target(); |
147 m_orientAngle->baseValue()->newValueSpecifiedUnits(target->unitType(), targe
t->valueInSpecifiedUnits()); | 147 m_orientAngle->baseValue()->newValueSpecifiedUnits(target->unitType(), targe
t->valueInSpecifiedUnits()); |
148 invalidateSVGAttributes(); | 148 invalidateSVGAttributes(); |
149 svgAttributeChanged(SVGNames::orientAttr); | 149 svgAttributeChanged(SVGNames::orientAttr); |
150 } | 150 } |
151 | 151 |
152 LayoutObject* SVGMarkerElement::createRenderer(const LayoutStyle&) | 152 LayoutObject* SVGMarkerElement::createRenderer(const LayoutStyle&) |
153 { | 153 { |
154 return new RenderSVGResourceMarker(this); | 154 return new LayoutSVGResourceMarker(this); |
155 } | 155 } |
156 | 156 |
157 bool SVGMarkerElement::selfHasRelativeLengths() const | 157 bool SVGMarkerElement::selfHasRelativeLengths() const |
158 { | 158 { |
159 return m_refX->currentValue()->isRelative() | 159 return m_refX->currentValue()->isRelative() |
160 || m_refY->currentValue()->isRelative() | 160 || m_refY->currentValue()->isRelative() |
161 || m_markerWidth->currentValue()->isRelative() | 161 || m_markerWidth->currentValue()->isRelative() |
162 || m_markerHeight->currentValue()->isRelative(); | 162 || m_markerHeight->currentValue()->isRelative(); |
163 } | 163 } |
164 | 164 |
165 } // namespace blink | 165 } // namespace blink |
OLD | NEW |