OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2010 Rob Buis <rwlbuis@gmail.com> | 3 * Copyright (C) 2010 Rob Buis <rwlbuis@gmail.com> |
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 "config.h" | 21 #include "config.h" |
22 #include "core/svg/SVGTextPathElement.h" | 22 #include "core/svg/SVGTextPathElement.h" |
23 | 23 |
24 #include "core/XLinkNames.h" | 24 #include "core/XLinkNames.h" |
25 #include "core/rendering/svg/RenderSVGResource.h" | |
26 #include "core/rendering/svg/RenderSVGTextPath.h" | 25 #include "core/rendering/svg/RenderSVGTextPath.h" |
27 #include "core/svg/SVGDocumentExtensions.h" | 26 #include "core/svg/SVGDocumentExtensions.h" |
28 | 27 |
29 namespace blink { | 28 namespace blink { |
30 | 29 |
31 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGTextPath
MethodType>() | 30 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGTextPath
MethodType>() |
32 { | 31 { |
33 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); | 32 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); |
34 if (entries.isEmpty()) { | 33 if (entries.isEmpty()) { |
35 entries.append(std::make_pair(SVGTextPathMethodAlign, "align")); | 34 entries.append(std::make_pair(SVGTextPathMethodAlign, "align")); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 96 |
98 if (SVGURIReference::isKnownAttribute(attrName)) { | 97 if (SVGURIReference::isKnownAttribute(attrName)) { |
99 buildPendingResource(); | 98 buildPendingResource(); |
100 return; | 99 return; |
101 } | 100 } |
102 | 101 |
103 if (attrName == SVGNames::startOffsetAttr) | 102 if (attrName == SVGNames::startOffsetAttr) |
104 updateRelativeLengthsInformation(); | 103 updateRelativeLengthsInformation(); |
105 | 104 |
106 if (RenderObject* object = renderer()) | 105 if (RenderObject* object = renderer()) |
107 RenderSVGResource::markForLayoutAndParentResourceInvalidation(object); | 106 markForLayoutAndParentResourceInvalidation(object); |
108 } | 107 } |
109 | 108 |
110 RenderObject* SVGTextPathElement::createRenderer(RenderStyle*) | 109 RenderObject* SVGTextPathElement::createRenderer(RenderStyle*) |
111 { | 110 { |
112 return new RenderSVGTextPath(this); | 111 return new RenderSVGTextPath(this); |
113 } | 112 } |
114 | 113 |
115 bool SVGTextPathElement::rendererIsNeeded(const RenderStyle& style) | 114 bool SVGTextPathElement::rendererIsNeeded(const RenderStyle& style) |
116 { | 115 { |
117 if (parentNode() && (isSVGAElement(*parentNode()) || isSVGTextElement(*paren
tNode()))) | 116 if (parentNode() && (isSVGAElement(*parentNode()) || isSVGTextElement(*paren
tNode()))) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 clearResourceReferences(); | 157 clearResourceReferences(); |
159 } | 158 } |
160 | 159 |
161 bool SVGTextPathElement::selfHasRelativeLengths() const | 160 bool SVGTextPathElement::selfHasRelativeLengths() const |
162 { | 161 { |
163 return m_startOffset->currentValue()->isRelative() | 162 return m_startOffset->currentValue()->isRelative() |
164 || SVGTextContentElement::selfHasRelativeLengths(); | 163 || SVGTextContentElement::selfHasRelativeLengths(); |
165 } | 164 } |
166 | 165 |
167 } // namespace blink | 166 } // namespace blink |
OLD | NEW |