RenderTableSection.h [plain text]
#ifndef RenderTableSection_H
#define RenderTableSection_H
#include "RenderTable.h"
#include <wtf/Vector.h>
namespace WebCore {
class RenderTableCell;
class RenderTableSection : public RenderContainer
{
public:
RenderTableSection(Node*);
~RenderTableSection();
virtual void destroy();
virtual void setStyle(RenderStyle*);
virtual const char *renderName() const { return "RenderTableSection"; }
virtual void addChild(RenderObject *child, RenderObject *beforeChild = 0);
virtual bool isTableSection() const { return true; }
virtual short lineHeight(bool) const { return 0; }
virtual void position(int, int, int, int, int, bool, bool, int) {}
#ifndef NDEBUG
virtual void dump(TextStream *stream, DeprecatedString ind = "") const;
#endif
void addCell(RenderTableCell *cell, RenderObject* row);
void setCellWidths();
void calcRowHeight();
int layoutRows(int height);
RenderTable *table() const { return static_cast<RenderTable *>(parent()); }
struct CellStruct {
RenderTableCell *cell;
bool inColSpan; };
typedef Vector<CellStruct> Row;
struct RowStruct {
Row* row;
RenderObject* rowRenderer;
int baseLine;
Length height;
};
CellStruct& cellAt(int row, int col) {
return (*grid[row].row)[col];
}
const CellStruct& cellAt(int row, int col) const {
return (*grid[row].row)[col];
}
virtual int overflowWidth(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? m_width : m_overflowWidth; }
virtual int overflowLeft(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? 0 : m_overflowLeft; }
virtual int lowestPosition(bool includeOverflowInterior, bool includeSelf) const;
virtual int rightmostPosition(bool includeOverflowInterior, bool includeSelf) const;
virtual int leftmostPosition(bool includeOverflowInterior, bool includeSelf) const;
int calcOuterBorderTop() const;
int calcOuterBorderBottom() const;
int calcOuterBorderLeft(bool rtl) const;
int calcOuterBorderRight(bool rtl) const;
void recalcOuterBorder();
int outerBorderTop() const { return m_outerBorderTop; }
int outerBorderBottom() const { return m_outerBorderBottom; }
int outerBorderLeft() const { return m_outerBorderLeft; }
int outerBorderRight() const { return m_outerBorderRight; }
virtual void paint(PaintInfo& i, int tx, int ty);
int numRows() const { return gridRows; }
int numColumns() const;
int getBaseline(int row) {return grid[row].baseLine;}
void setNeedCellRecalc() {
needCellRecalc = true;
table()->setNeedSectionRecalc();
}
virtual RenderObject* removeChildNode(RenderObject* child);
virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty, HitTestAction action);
Vector<RowStruct> grid;
int gridRows;
Vector<int> rowPos;
int cCol;
int cRow;
bool needCellRecalc;
void recalcCells();
protected:
bool ensureRows(int numRows);
void clearGrid();
int m_outerBorderLeft;
int m_outerBorderRight;
int m_outerBorderTop;
int m_outerBorderBottom;
int m_overflowLeft;
int m_overflowWidth;
bool m_hasOverflowingCell;
};
}
#endif