KHTML
SVGAElement.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "config.h"
00025 #include "wtf/Platform.h"
00026
00027 #if ENABLE(SVG)
00028 #include "SVGAElement.h"
00029
00030
00031
00032 #include "Document.h"
00033
00034
00035
00036
00037
00038
00039
00040 #include "RenderSVGTransformableContainer.h"
00041 #include "RenderSVGInline.h"
00042
00043
00044 #include "SVGNames.h"
00045 #include "XLinkNames.h"
00046
00047 namespace WebCore {
00048
00049
00050
00051 SVGAElement::SVGAElement(const QualifiedName& tagName, Document *doc)
00052 : SVGStyledTransformableElement(tagName, doc)
00053 , SVGURIReference()
00054 , SVGTests()
00055 , SVGLangSpace()
00056 , SVGExternalResourcesRequired()
00057 {
00058 }
00059
00060 SVGAElement::~SVGAElement()
00061 {
00062 }
00063
00064 String SVGAElement::title() const
00065 {
00066 return getAttribute(XLinkNames::titleAttr);
00067 }
00068
00069 ANIMATED_PROPERTY_DEFINITIONS(SVGAElement, String, String, string, Target, target, SVGNames::targetAttr, m_target)
00070
00071 void SVGAElement::parseMappedAttribute(MappedAttribute* attr)
00072 {
00073 if (attr->name() == SVGNames::targetAttr)
00074 setTargetBaseValue(attr->value());
00075 else {
00076 if (SVGURIReference::parseMappedAttribute(attr))
00077 return;
00078 if (SVGTests::parseMappedAttribute(attr))
00079 return;
00080 if (SVGLangSpace::parseMappedAttribute(attr))
00081 return;
00082 if (SVGExternalResourcesRequired::parseMappedAttribute(attr))
00083 return;
00084 SVGStyledTransformableElement::parseMappedAttribute(attr);
00085 }
00086 }
00087
00088 void SVGAElement::svgAttributeChanged(const QualifiedName& attrName)
00089 {
00090 SVGStyledTransformableElement::svgAttributeChanged(attrName);
00091
00092
00093
00094 if (SVGURIReference::isKnownAttribute(attrName)) {
00095
00096
00097
00098
00099
00100 }
00101 }
00102
00103 RenderObject* SVGAElement::createRenderer(RenderArena* arena, RenderStyle* style)
00104 {
00105 if (static_cast<SVGElement*>(parent())->isTextContent())
00106 return new (arena) RenderSVGInline(this);
00107
00108 return new (arena) RenderSVGTransformableContainer(this);
00109 }
00110
00111 void SVGAElement::defaultEventHandler(Event* evt)
00112 {
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 SVGStyledTransformableElement::defaultEventHandler(evt);
00165 }
00166
00167 bool SVGAElement::supportsFocus() const
00168 {
00169
00170
00171 return isFocusable() || (document() && !document()->haveStylesheetsLoaded());
00172 }
00173
00174 bool SVGAElement::isFocusable() const
00175 {
00176 if (isContentEditable())
00177 return SVGStyledTransformableElement::isFocusable();
00178
00179
00180
00181 if (!renderer() || !(renderer()->style()->visibility() == VISIBLE))
00182 return false;
00183
00184
00185 return false;
00186 }
00187
00188 bool SVGAElement::isMouseFocusable() const
00189 {
00190 return false;
00191 }
00192
00193 bool SVGAElement::isKeyboardFocusable(DOM::KeyboardEventImpl* event) const
00194 {
00195 if (!isFocusable())
00196 return false;
00197
00198 if (!document()->view())
00199 return false;
00200
00201
00202 return false;
00203 }
00204
00205 bool SVGAElement::childShouldCreateRenderer(Node* child) const
00206 {
00207
00208
00209 if (child->hasTagName(SVGNames::aTag))
00210 return false;
00211 if (parent() && parent()->isSVGElement())
00212 return static_cast<SVGElement*>(parent())->childShouldCreateRenderer(child);
00213
00214 return SVGElement::childShouldCreateRenderer(child);
00215 }
00216
00217 }
00218
00219 #endif // ENABLE(SVG)