1 /* 2 * Copyright (C) 1997 Martin Jones (mjones (at) kde.org) 3 * (C) 1997 Torben Weis (weis (at) kde.org) 4 * (C) 1998 Waldo Bastian (bastian (at) kde.org) 5 * (C) 1999 Lars Knoll (knoll (at) kde.org) 6 * (C) 1999 Antti Koivisto (koivisto (at) kde.org) 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Library General Public 11 * License as published by the Free Software Foundation; either 12 * version 2 of the License, or (at your option) any later version. 13 * 14 * This library is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Library General Public License for more details. 18 * 19 * You should have received a copy of the GNU Library General Public License 20 * along with this library; see the file COPYING.LIB. If not, write to 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 * Boston, MA 02110-1301, USA. 23 */ 24 25 #ifndef RenderTableRow_h 26 #define RenderTableRow_h 27 28 #include "RenderTableSection.h" 29 30 namespace WebCore { 31 32 class RenderTableRow : public RenderBox { 33 public: 34 RenderTableRow(Node*); 35 36 const RenderObjectChildList* children() const { return &m_children; } 37 RenderObjectChildList* children() { return &m_children; } 38 39 RenderTableSection* section() const { return toRenderTableSection(parent()); } 40 RenderTable* table() const { return toRenderTable(parent()->parent()); } 41 42 private: 43 virtual RenderObjectChildList* virtualChildren() { return children(); } 44 virtual const RenderObjectChildList* virtualChildren() const { return children(); } 45 46 virtual const char* renderName() const { return isAnonymous() ? "RenderTableRow (anonymous)" : "RenderTableRow"; } 47 48 virtual bool isTableRow() const { return true; } 49 50 virtual void destroy(); 51 52 virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0); 53 virtual int lineHeight(bool, bool) const { return 0; } 54 virtual void layout(); 55 virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer); 56 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction); 57 58 // The only time rows get a layer is when they have transparency. 59 virtual bool requiresLayer() const { return isTransparent() || hasOverflowClip() || hasTransform() || hasMask(); } 60 61 virtual void paint(PaintInfo&, int tx, int ty); 62 63 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); 64 65 virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); 66 67 RenderObjectChildList m_children; 68 }; 69 70 inline RenderTableRow* toRenderTableRow(RenderObject* object) 71 { 72 ASSERT(!object || object->isTableRow()); 73 return static_cast<RenderTableRow*>(object); 74 } 75 76 inline const RenderTableRow* toRenderTableRow(const RenderObject* object) 77 { 78 ASSERT(!object || object->isTableRow()); 79 return static_cast<const RenderTableRow*>(object); 80 } 81 82 // This will catch anyone doing an unnecessary cast. 83 void toRenderTableRow(const RenderTableRow*); 84 85 } // namespace WebCore 86 87 #endif // RenderTableRow_h 88