KHTML
SVGSwitchElement.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 #include "config.h"
00024 #if ENABLE(SVG)
00025 #include "SVGSwitchElement.h"
00026
00027 #include "RenderSVGTransformableContainer.h"
00028 #include "SVGNames.h"
00029
00030 namespace WebCore {
00031
00032 SVGSwitchElement::SVGSwitchElement(const QualifiedName& tagName, Document* doc)
00033 : SVGStyledTransformableElement(tagName, doc)
00034 , SVGTests()
00035 , SVGLangSpace()
00036 , SVGExternalResourcesRequired()
00037 {
00038 }
00039
00040 SVGSwitchElement::~SVGSwitchElement()
00041 {
00042 }
00043
00044 bool SVGSwitchElement::childShouldCreateRenderer(Node* child) const
00045 {
00046 for (Node* n = firstChild(); n != 0; n = n->nextSibling()) {
00047 if (n->isSVGElement()) {
00048 SVGElement* element = static_cast<SVGElement*>(n);
00049 if (element && element->isValid())
00050 return (n == child);
00051 }
00052 }
00053
00054 return false;
00055 }
00056
00057 RenderObject* SVGSwitchElement::createRenderer(RenderArena* arena, RenderStyle*)
00058 {
00059 return new (arena) RenderSVGTransformableContainer(this);
00060 }
00061
00062 }
00063
00064
00065 #endif // ENABLE(SVG)
00066