2
* This file is part of the DOM implementation for KDE.
4
2
* Copyright (C) 1997 Martin Jones (mjones@kde.org)
5
3
* (C) 1997 Torben Weis (weis@kde.org)
6
4
* (C) 1998 Waldo Bastian (bastian@kde.org)
7
5
* (C) 1999 Lars Knoll (knoll@kde.org)
8
6
* (C) 1999 Antti Koivisto (koivisto@kde.org)
9
* Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
7
* Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
11
9
* This library is free software; you can redistribute it and/or
12
10
* modify it under the terms of the GNU Library General Public
33
31
namespace WebCore {
35
33
class RenderTableCell;
37
class RenderTableSection : public RenderContainer {
36
class RenderTableSection : public RenderBox {
39
38
RenderTableSection(Node*);
40
~RenderTableSection();
42
virtual const char* renderName() const { return isAnonymous() ? "RenderTableSection (anonymous)" : "RenderTableSection"; }
44
virtual bool isTableSection() const { return true; }
46
virtual void destroy();
39
virtual ~RenderTableSection();
41
const RenderObjectChildList* children() const { return &m_children; }
42
RenderObjectChildList* children() { return &m_children; }
48
44
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
50
virtual int getBaselineOfFirstLineBox() const;
46
virtual int firstLineBoxBaseline() const;
52
void addCell(RenderTableCell*, RenderObject* row);
48
void addCell(RenderTableCell*, RenderTableRow* row);
54
50
void setCellWidths();
55
51
int calcRowHeight();
56
52
int layoutRows(int height);
58
RenderTable* table() const { return static_cast<RenderTable*>(parent()); }
54
RenderTable* table() const { return toRenderTable(parent()); }
60
56
struct CellStruct {
61
57
RenderTableCell* cell;
77
73
void appendColumn(int pos);
78
74
void splitColumn(int pos, int newSize);
80
virtual int overflowWidth(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? m_width : m_overflowWidth; }
81
virtual int overflowLeft(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? 0 : m_overflowLeft; }
82
virtual int overflowHeight(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? m_height : m_overflowHeight; }
83
virtual int overflowTop(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? 0 : m_overflowTop; }
85
virtual int lowestPosition(bool includeOverflowInterior, bool includeSelf) const;
86
virtual int rightmostPosition(bool includeOverflowInterior, bool includeSelf) const;
87
virtual int leftmostPosition(bool includeOverflowInterior, bool includeSelf) const;
89
76
int calcOuterBorderTop() const;
90
77
int calcOuterBorderBottom() const;
91
78
int calcOuterBorderLeft(bool rtl) const;
97
84
int outerBorderLeft() const { return m_outerBorderLeft; }
98
85
int outerBorderRight() const { return m_outerBorderRight; }
100
virtual void paint(PaintInfo&, int tx, int ty);
101
virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
103
87
int numRows() const { return m_gridRows; }
104
88
int numColumns() const;
105
89
void recalcCells();
119
103
int getBaseline(int row) { return m_grid[row].baseline; }
121
virtual RenderObject* removeChildNode(RenderObject*, bool fullRemove = true);
106
virtual RenderObjectChildList* virtualChildren() { return children(); }
107
virtual const RenderObjectChildList* virtualChildren() const { return children(); }
109
virtual const char* renderName() const { return isAnonymous() ? "RenderTableSection (anonymous)" : "RenderTableSection"; }
111
virtual bool isTableSection() const { return true; }
113
virtual void destroy();
115
virtual void layout();
117
virtual void removeChild(RenderObject* oldChild);
119
virtual int lowestPosition(bool includeOverflowInterior, bool includeSelf) const;
120
virtual int rightmostPosition(bool includeOverflowInterior, bool includeSelf) const;
121
virtual int leftmostPosition(bool includeOverflowInterior, bool includeSelf) const;
123
virtual void paint(PaintInfo&, int tx, int ty);
124
virtual void paintObject(PaintInfo&, int tx, int ty);
126
virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
123
128
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
126
130
virtual int lineHeight(bool, bool) const { return 0; }
127
virtual void position(InlineBox*) { }
129
132
bool ensureRows(int);
130
133
void clearGrid();
135
RenderObjectChildList m_children;
132
137
Vector<RowStruct> m_grid;
138
Vector<int> m_rowPos;
134
Vector<int> m_rowPos;
136
142
// the current insertion position
139
bool m_needsCellRecalc;
141
146
int m_outerBorderLeft;
142
147
int m_outerBorderRight;
143
148
int m_outerBorderTop;
144
149
int m_outerBorderBottom;
148
int m_overflowHeight;
151
bool m_needsCellRecalc;
149
152
bool m_hasOverflowingCell;
155
inline RenderTableSection* toRenderTableSection(RenderObject* object)
157
ASSERT(!object || object->isTableSection());
158
return static_cast<RenderTableSection*>(object);
161
inline const RenderTableSection* toRenderTableSection(const RenderObject* object)
163
ASSERT(!object || object->isTableSection());
164
return static_cast<const RenderTableSection*>(object);
167
// This will catch anyone doing an unnecessary cast.
168
void toRenderTableSection(const RenderTableSection*);
152
170
} // namespace WebCore
154
172
#endif // RenderTableSection_h