File indexing completed on 2024-04-28 15:24:17

0001 /*
0002  * This file is part of the WebKit project.
0003  *
0004  * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public License
0017  * along with this library; see the file COPYING.LIB.  If not, write to
0018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019  * Boston, MA 02110-1301, USA.
0020  *
0021  */
0022 
0023 #ifndef RenderSVGHiddenContainer_h
0024 #define RenderSVGHiddenContainer_h
0025 
0026 #if ENABLE(SVG)
0027 
0028 #include "RenderSVGContainer.h"
0029 
0030 namespace WebCore
0031 {
0032 
0033 class SVGStyledElement;
0034 
0035 // This class is for containers which are never drawn, but do need to support style
0036 // <defs>, <linearGradient>, <radialGradient> are all good examples
0037 class RenderSVGHiddenContainer : public RenderSVGContainer
0038 {
0039 public:
0040     RenderSVGHiddenContainer(SVGStyledElement *);
0041     virtual ~RenderSVGHiddenContainer();
0042 
0043     bool isSVGContainer() const override
0044     {
0045         return true;
0046     }
0047     bool isSVGHiddenContainer() const override
0048     {
0049         return true;
0050     }
0051 
0052     const char *renderName() const override
0053     {
0054         return "RenderSVGHiddenContainer";
0055     }
0056 
0057     bool requiresLayer() const override;
0058 
0059     short lineHeight(bool b) const override;
0060     short baselinePosition(bool b) const override;
0061 
0062     void layout() override;
0063     void paint(PaintInfo &, int parentX, int parentY) override;
0064 
0065     IntRect absoluteClippedOverflowRect() override;
0066     void absoluteRects(Vector<IntRect> &rects, int tx, int ty, bool topLevel = true) override;
0067 
0068     AffineTransform absoluteTransform() const override;
0069     AffineTransform localTransform() const override;
0070 
0071     FloatRect relativeBBox(bool includeStroke = true) const override;
0072     /*virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);*/
0073 };
0074 }
0075 
0076 #endif // ENABLE(SVG)
0077 #endif // RenderSVGHiddenContainer_h