OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2008 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 "config.h" | 21 #include "config.h" |
22 | 22 |
23 #include "core/svg/SVGTextElement.h" | 23 #include "core/svg/SVGTextElement.h" |
24 | 24 |
25 #include "SVGNames.h" | 25 #include "SVGNames.h" |
26 #include "core/dom/NodeRenderingContext.h" | |
27 #include "core/rendering/svg/RenderSVGResource.h" | 26 #include "core/rendering/svg/RenderSVGResource.h" |
28 #include "core/rendering/svg/RenderSVGText.h" | 27 #include "core/rendering/svg/RenderSVGText.h" |
29 #include "core/svg/SVGElementInstance.h" | 28 #include "core/svg/SVGElementInstance.h" |
30 | 29 |
31 namespace WebCore { | 30 namespace WebCore { |
32 | 31 |
33 inline SVGTextElement::SVGTextElement(const QualifiedName& tagName, Document& do
c) | 32 inline SVGTextElement::SVGTextElement(const QualifiedName& tagName, Document& do
c) |
34 : SVGTextPositioningElement(tagName, doc) | 33 : SVGTextPositioningElement(tagName, doc) |
35 { | 34 { |
36 ASSERT(hasTagName(SVGNames::textTag)); | 35 ASSERT(hasTagName(SVGNames::textTag)); |
(...skipping 28 matching lines...) Expand all Loading... |
65 if (transform) | 64 if (transform) |
66 return *transform * matrix; | 65 return *transform * matrix; |
67 return matrix; | 66 return matrix; |
68 } | 67 } |
69 | 68 |
70 RenderObject* SVGTextElement::createRenderer(RenderStyle*) | 69 RenderObject* SVGTextElement::createRenderer(RenderStyle*) |
71 { | 70 { |
72 return new RenderSVGText(this); | 71 return new RenderSVGText(this); |
73 } | 72 } |
74 | 73 |
75 bool SVGTextElement::childShouldCreateRenderer(const NodeRenderingContext& child
Context) const | 74 bool SVGTextElement::childShouldCreateRenderer(const Node& child) const |
76 { | 75 { |
77 if (childContext.node()->isTextNode() | 76 if (child.isTextNode() |
78 || childContext.node()->hasTagName(SVGNames::aTag) | 77 || child.hasTagName(SVGNames::aTag) |
79 #if ENABLE(SVG_FONTS) | 78 #if ENABLE(SVG_FONTS) |
80 || childContext.node()->hasTagName(SVGNames::altGlyphTag) | 79 || child.hasTagName(SVGNames::altGlyphTag) |
81 #endif | 80 #endif |
82 || childContext.node()->hasTagName(SVGNames::textPathTag) | 81 || child.hasTagName(SVGNames::textPathTag) |
83 || childContext.node()->hasTagName(SVGNames::trefTag) | 82 || child.hasTagName(SVGNames::trefTag) |
84 || childContext.node()->hasTagName(SVGNames::tspanTag)) | 83 || child.hasTagName(SVGNames::tspanTag)) |
85 return true; | 84 return true; |
86 | 85 |
87 return false; | 86 return false; |
88 } | 87 } |
89 | 88 |
90 } | 89 } |
OLD | NEW |