RenderSVGContainer.h [plain text]
#ifndef RenderSVGContainer_h
#define RenderSVGContainer_h
#if ENABLE(SVG)
#include "RenderSVGModelObject.h"
namespace WebCore {
class SVGElement;
class RenderSVGContainer : public RenderSVGModelObject {
public:
explicit RenderSVGContainer(SVGStyledElement*);
virtual ~RenderSVGContainer();
RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); }
RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); return children()->lastChild(); }
const RenderObjectChildList* children() const { return &m_children; }
RenderObjectChildList* children() { return &m_children; }
virtual void paint(PaintInfo&, const LayoutPoint&);
virtual void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; }
virtual bool needsBoundariesUpdate() OVERRIDE { return m_needsBoundariesUpdate; }
virtual bool didTransformToRootUpdate() { return false; }
bool isObjectBoundingBoxValid() const { return m_objectBoundingBoxValid; }
protected:
virtual RenderObjectChildList* virtualChildren() { return children(); }
virtual const RenderObjectChildList* virtualChildren() const { return children(); }
virtual bool isSVGContainer() const { return true; }
virtual const char* renderName() const { return "RenderSVGContainer"; }
virtual void layout();
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) OVERRIDE;
virtual void removeChild(RenderObject*) OVERRIDE;
virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint&);
virtual FloatRect objectBoundingBox() const { return m_objectBoundingBox; }
virtual FloatRect strokeBoundingBox() const { return m_strokeBoundingBox; }
virtual FloatRect repaintRectInLocalCoordinates() const { return m_repaintBoundingBox; }
virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
virtual bool calculateLocalTransform() { return false; }
virtual void calcViewport() { }
virtual void applyViewportClip(PaintInfo&) { }
virtual bool pointIsInsideViewportClip(const FloatPoint& ) { return true; }
virtual void determineIfLayoutSizeChanged() { }
bool selfWillPaint();
void updateCachedBoundaries();
private:
RenderObjectChildList m_children;
FloatRect m_objectBoundingBox;
bool m_objectBoundingBoxValid;
FloatRect m_strokeBoundingBox;
FloatRect m_repaintBoundingBox;
bool m_needsBoundariesUpdate : 1;
};
inline RenderSVGContainer* toRenderSVGContainer(RenderObject* object)
{
ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isSVGContainer());
return static_cast<RenderSVGContainer*>(object);
}
inline const RenderSVGContainer* toRenderSVGContainer(const RenderObject* object)
{
ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isSVGContainer());
return static_cast<const RenderSVGContainer*>(object);
}
void toRenderSVGContainer(const RenderSVGContainer*);
}
#endif // ENABLE(SVG)
#endif // RenderSVGContainer_h