File indexing completed on 2024-04-28 11:38:59

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 #include "wtf/Platform.h"
0024 
0025 #if ENABLE(SVG)
0026 #include "RenderSVGHiddenContainer.h"
0027 
0028 #include "RenderPath.h"
0029 #include "SVGStyledElement.h"
0030 
0031 namespace WebCore
0032 {
0033 
0034 RenderSVGHiddenContainer::RenderSVGHiddenContainer(SVGStyledElement *element)
0035     : RenderSVGContainer(element)
0036 {
0037 }
0038 
0039 RenderSVGHiddenContainer::~RenderSVGHiddenContainer()
0040 {
0041 }
0042 
0043 bool RenderSVGHiddenContainer::requiresLayer() const
0044 {
0045     return false;
0046 }
0047 
0048 short RenderSVGHiddenContainer::lineHeight(bool b) const
0049 {
0050     Q_UNUSED(b);
0051     return 0;
0052 }
0053 
0054 short RenderSVGHiddenContainer::baselinePosition(bool b) const
0055 {
0056     Q_UNUSED(b);
0057     return 0;
0058 }
0059 
0060 void RenderSVGHiddenContainer::layout()
0061 {
0062     ASSERT(needsLayout());
0063 
0064     // Layout our kids to prevent a kid from being marked as needing layout
0065     // then never being asked to layout.
0066     for (RenderObject *child = firstChild(); child; child = child->nextSibling()) {
0067         if (child->isText()) {
0068             continue;    // FIXME remove it, vtokarev
0069         }
0070         if (selfNeedsLayout()) {
0071             child->setNeedsLayout(true);
0072         }
0073 
0074         child->layoutIfNeeded();
0075         //FIXME khtml vtokarev ASSERT(!child->needsLayout());
0076     }
0077 
0078     setNeedsLayout(false);
0079 }
0080 
0081 void RenderSVGHiddenContainer::paint(PaintInfo &, int, int)
0082 {
0083     // This subtree does not paint.
0084 }
0085 
0086 IntRect RenderSVGHiddenContainer::absoluteClippedOverflowRect()
0087 {
0088     return IntRect();
0089 }
0090 
0091 void RenderSVGHiddenContainer::absoluteRects(Vector<IntRect> &rects, int, int, bool)
0092 {
0093     Q_UNUSED(rects);
0094     // This subtree does not take up space or paint
0095 }
0096 
0097 AffineTransform RenderSVGHiddenContainer::absoluteTransform() const
0098 {
0099     return AffineTransform();
0100 }
0101 
0102 AffineTransform RenderSVGHiddenContainer::localTransform() const
0103 {
0104     return AffineTransform();
0105 }
0106 
0107 /*bool RenderSVGHiddenContainer::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
0108 {
0109     return false;
0110 }*/
0111 
0112 FloatRect RenderSVGHiddenContainer::relativeBBox(bool includeStroke) const
0113 {
0114     Q_UNUSED(includeStroke);
0115     return FloatRect();
0116 }
0117 
0118 }
0119 
0120 #endif // ENABLE(SVG)