fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / khtml / svg / SVGAltGlyphElement.cpp
blobfea11b1cdd10cb9e2232c5b73cb7c264829aa332
1 /*
2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 Copyright (C) 2008 Apple Computer, Inc.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
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
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
22 #include "config.h"
23 #include "wtf/Platform.h"
25 #if ENABLE(SVG_FONTS)
26 #include "SVGAltGlyphElement.h"
28 #include "ExceptionCode.h"
29 #include "RenderInline.h"
30 #include "RenderSVGTSpan.h"
31 #include "SVGGlyphElement.h"
32 #include "SVGNames.h"
33 #include "XLinkNames.h"
35 namespace WebCore {
37 SVGAltGlyphElement::SVGAltGlyphElement(const QualifiedName& tagName, Document* doc)
38 : SVGTextPositioningElement(tagName, doc)
42 SVGAltGlyphElement::~SVGAltGlyphElement()
46 void SVGAltGlyphElement::setGlyphRef(const AtomicString& type, ExceptionCode& ec)
48 //FIXME khtml ec = NO_MODIFICATION_ALLOWED_ERR;
51 const AtomicString& SVGAltGlyphElement::glyphRef() const
53 return getAttribute(SVGNames::glyphRefAttr);
56 void SVGAltGlyphElement::setFormat(const AtomicString& type, ExceptionCode& ec)
58 //FIXME khtml ec = NO_MODIFICATION_ALLOWED_ERR;
61 const AtomicString& SVGAltGlyphElement::format() const
63 return getAttribute(SVGNames::formatAttr);
66 bool SVGAltGlyphElement::childShouldCreateRenderer(Node* child) const
68 if (child->isTextNode())
69 return true;
70 return false;
73 RenderObject* SVGAltGlyphElement::createRenderer(RenderArena* arena, RenderStyle*)
75 return new (arena) RenderSVGTSpan(this);
78 SVGGlyphElement* SVGAltGlyphElement::glyphElement() const
80 Element* elt = document()->getElementById(getTarget(getAttribute(XLinkNames::hrefAttr)));
81 if (!elt || !elt->hasTagName(SVGNames::glyphTag))
82 return 0;
83 return static_cast<SVGGlyphElement*>(elt);
88 #endif // ENABLE(SVG)
90 // vim:ts=4:noet