#ifndef AutoTableLayout_h
#define AutoTableLayout_h
#include "LayoutUnit.h"
#include "Length.h"
#include "TableLayout.h"
#include <wtf/Vector.h>
namespace WebCore {
class RenderTable;
class RenderTableCell;
class AutoTableLayout final : public TableLayout {
public:
explicit 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;
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 // AutoTableLayout_h