KHtml

RenderSVGHiddenContainer.cpp
1 /*
2  * This file is part of the WebKit project.
3  *
4  * Copyright (C) 2007 Eric Seidel <[email protected]>
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 "wtf/Platform.h"
24 
25 #if ENABLE(SVG)
26 #include "RenderSVGHiddenContainer.h"
27 
28 #include "RenderPath.h"
29 #include "SVGStyledElement.h"
30 
31 namespace WebCore
32 {
33 
34 RenderSVGHiddenContainer::RenderSVGHiddenContainer(SVGStyledElement *element)
35  : RenderSVGContainer(element)
36 {
37 }
38 
39 RenderSVGHiddenContainer::~RenderSVGHiddenContainer()
40 {
41 }
42 
43 bool RenderSVGHiddenContainer::requiresLayer() const
44 {
45  return false;
46 }
47 
48 short RenderSVGHiddenContainer::lineHeight(bool b) const
49 {
50  Q_UNUSED(b);
51  return 0;
52 }
53 
54 short RenderSVGHiddenContainer::baselinePosition(bool b) const
55 {
56  Q_UNUSED(b);
57  return 0;
58 }
59 
60 void RenderSVGHiddenContainer::layout()
61 {
62  ASSERT(needsLayout());
63 
64  // Layout our kids to prevent a kid from being marked as needing layout
65  // then never being asked to layout.
66  for (RenderObject *child = firstChild(); child; child = child->nextSibling()) {
67  if (child->isText()) {
68  continue; // FIXME remove it, vtokarev
69  }
70  if (selfNeedsLayout()) {
71  child->setNeedsLayout(true);
72  }
73 
74  child->layoutIfNeeded();
75  //FIXME khtml vtokarev ASSERT(!child->needsLayout());
76  }
77 
78  setNeedsLayout(false);
79 }
80 
81 void RenderSVGHiddenContainer::paint(PaintInfo &, int, int)
82 {
83  // This subtree does not paint.
84 }
85 
86 IntRect RenderSVGHiddenContainer::absoluteClippedOverflowRect()
87 {
88  return IntRect();
89 }
90 
91 void RenderSVGHiddenContainer::absoluteRects(Vector<IntRect> &rects, int, int, bool)
92 {
93  Q_UNUSED(rects);
94  // This subtree does not take up space or paint
95 }
96 
97 AffineTransform RenderSVGHiddenContainer::absoluteTransform() const
98 {
99  return AffineTransform();
100 }
101 
102 AffineTransform RenderSVGHiddenContainer::localTransform() const
103 {
104  return AffineTransform();
105 }
106 
107 /*bool RenderSVGHiddenContainer::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
108 {
109  return false;
110 }*/
111 
112 FloatRect RenderSVGHiddenContainer::relativeBBox(bool includeStroke) const
113 {
114  Q_UNUSED(includeStroke);
115  return FloatRect();
116 }
117 
118 }
119 
120 #endif // ENABLE(SVG)
MESSAGECORE_EXPORT KMime::Content * firstChild(const KMime::Content *node)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 16 2021 22:48:01 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.