|
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 #include "config.h" |
|
23 |
|
24 #if ENABLE(SVG) |
|
25 |
|
26 #include "RenderSVGHiddenContainer.h" |
|
27 |
|
28 #include "RenderPath.h" |
|
29 #include "SVGStyledElement.h" |
|
30 |
|
31 namespace WebCore { |
|
32 |
|
33 RenderSVGHiddenContainer::RenderSVGHiddenContainer(SVGStyledElement* element) |
|
34 : RenderContainer(element) |
|
35 { |
|
36 } |
|
37 |
|
38 RenderSVGHiddenContainer::~RenderSVGHiddenContainer() |
|
39 { |
|
40 } |
|
41 |
|
42 bool RenderSVGHiddenContainer::requiresLayer() |
|
43 { |
|
44 return false; |
|
45 } |
|
46 |
|
47 short RenderSVGHiddenContainer::lineHeight(bool b, bool isRootLineBox) const |
|
48 { |
|
49 return 0; |
|
50 } |
|
51 |
|
52 short RenderSVGHiddenContainer::baselinePosition(bool b, bool isRootLineBox) const |
|
53 { |
|
54 return 0; |
|
55 } |
|
56 |
|
57 void RenderSVGHiddenContainer::layout() |
|
58 { |
|
59 ASSERT(needsLayout()); |
|
60 |
|
61 // Layout our kids to prevent a kid from being marked as needing layout |
|
62 // then never being asked to layout. |
|
63 RenderObject* child = firstChild(); |
|
64 while (child) { |
|
65 if (!child->isRenderPath() || static_cast<RenderPath*>(child)->hasRelativeValues()) |
|
66 child->setNeedsLayout(true); |
|
67 |
|
68 child->layoutIfNeeded(); |
|
69 ASSERT(!child->needsLayout()); |
|
70 child = child->nextSibling(); |
|
71 } |
|
72 |
|
73 setNeedsLayout(false); |
|
74 } |
|
75 |
|
76 void RenderSVGHiddenContainer::paint(PaintInfo&, int parentX, int parentY) |
|
77 { |
|
78 // This subtree does not paint. |
|
79 } |
|
80 |
|
81 IntRect RenderSVGHiddenContainer::absoluteClippedOverflowRect() |
|
82 { |
|
83 return IntRect(); |
|
84 } |
|
85 |
|
86 void RenderSVGHiddenContainer::absoluteRects(Vector<IntRect>& rects, int tx, int ty, bool) |
|
87 { |
|
88 // This subtree does not take up space or paint |
|
89 } |
|
90 |
|
91 AffineTransform RenderSVGHiddenContainer::absoluteTransform() const |
|
92 { |
|
93 return AffineTransform(); |
|
94 } |
|
95 |
|
96 AffineTransform RenderSVGHiddenContainer::localTransform() const |
|
97 { |
|
98 return AffineTransform(); |
|
99 } |
|
100 |
|
101 bool RenderSVGHiddenContainer::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction) |
|
102 { |
|
103 return false; |
|
104 } |
|
105 |
|
106 } |
|
107 |
|
108 #endif // ENABLE(SVG) |