#ifndef AutoTableLayout_h
#define AutoTableLayout_h
#include "core/rendering/TableLayout.h"
#include "platform/LayoutUnit.h"
#include "platform/Length.h"
#include "wtf/Vector.h"
namespace WebCore {
class RenderTable;
class RenderTableCell;
class AutoTableLayout FINAL : public TableLayout {
public:
AutoTableLayout(RenderTable*);
virtual ~AutoTableLayout();
virtual void computeIntrinsicLogicalWidths(LayoutUnit& minWidth, LayoutUnit& maxWidth) OVERRIDE;
virtual void applyPreferredLogicalWidthQuirks(LayoutUnit& minWidth, LayoutUnit& maxWidth) const OVERRIDE;
virtual void layout() OVERRIDE;
virtual void willChangeTableLayout() OVERRIDE { }
private:
void fullRecalc();
void recalcColumn(unsigned effCol);
int calcEffectiveLogicalWidth();
void insertSpanCell(RenderTableCell*);
struct Layout {
Layout()
: minLogicalWidth(0)
, maxLogicalWidth(0)
, effectiveMinLogicalWidth(0)
, effectiveMaxLogicalWidth(0)
, computedLogicalWidth(0)
, emptyCellsOnly(true)
{
}
Length logicalWidth;
Length effectiveLogicalWidth;
int minLogicalWidth;
int maxLogicalWidth;
int effectiveMinLogicalWidth;
int effectiveMaxLogicalWidth;
int computedLogicalWidth;
bool emptyCellsOnly;
};
Vector<Layout, 4> m_layoutStruct;
Vector<RenderTableCell*, 4> m_spanCells;
bool m_hasPercent : 1;
mutable bool m_effectiveLogicalWidthDirty : 1;
};
}
#endif