1 /*
2 * This file is part of the WebKit project.
3 *
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 *
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.
10 *
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.
15 *
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.
20 *
21 */
22
23 #include "config.h"
24
25 #if ENABLE(SVG)
26 #include "RenderSVGHiddenContainer.h"
27
28 #include "RenderPath.h"
29 #include "SVGStyledElement.h"
30
31 namespace WebCore {
32
RenderSVGHiddenContainer(SVGStyledElement * element)33 RenderSVGHiddenContainer::RenderSVGHiddenContainer(SVGStyledElement* element)
34 : RenderSVGContainer(element)
35 {
36 }
37
layout()38 void RenderSVGHiddenContainer::layout()
39 {
40 ASSERT(needsLayout());
41
42 // Layout our kids to prevent a kid from being marked as needing layout
43 // then never being asked to layout.
44 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
45 if (selfNeedsLayout())
46 child->setNeedsLayout(true);
47
48 child->layoutIfNeeded();
49 ASSERT(!child->needsLayout());
50 }
51
52 setNeedsLayout(false);
53 }
54
paint(PaintInfo &,int,int)55 void RenderSVGHiddenContainer::paint(PaintInfo&, int, int)
56 {
57 // This subtree does not paint.
58 }
59
clippedOverflowRectForRepaint(RenderBoxModelObject *)60 IntRect RenderSVGHiddenContainer::clippedOverflowRectForRepaint(RenderBoxModelObject* /*repaintContainer*/)
61 {
62 return IntRect();
63 }
64
absoluteRects(Vector<IntRect> &,int,int)65 void RenderSVGHiddenContainer::absoluteRects(Vector<IntRect>&, int, int)
66 {
67 // This subtree does not take up space or paint
68 }
69
absoluteQuads(Vector<FloatQuad> &)70 void RenderSVGHiddenContainer::absoluteQuads(Vector<FloatQuad>&)
71 {
72 // This subtree does not take up space or paint
73 }
74
nodeAtFloatPoint(const HitTestRequest &,HitTestResult &,const FloatPoint &,HitTestAction)75 bool RenderSVGHiddenContainer::nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint&, HitTestAction)
76 {
77 return false;
78 }
79
objectBoundingBox() const80 FloatRect RenderSVGHiddenContainer::objectBoundingBox() const
81 {
82 return FloatRect();
83 }
84
repaintRectInLocalCoordinates() const85 FloatRect RenderSVGHiddenContainer::repaintRectInLocalCoordinates() const
86 {
87 return FloatRect();
88 }
89
90 }
91
92 #endif // ENABLE(SVG)
93