#ifndef RenderTableCol_h
#define RenderTableCol_h
#include "core/rendering/RenderBox.h"
namespace WebCore {
class RenderTable;
class RenderTableCell;
class RenderTableCol FINAL : public RenderBox {
public:
explicit RenderTableCol(Element*);
RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); }
RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); return children()->lastChild(); }
const RenderObjectChildList* children() const { return &m_children; }
RenderObjectChildList* children() { return &m_children; }
void clearPreferredLogicalWidthsDirtyBits();
unsigned span() const { return m_span; }
void setSpan(unsigned span) { m_span = span; }
bool isTableColumnGroupWithColumnChildren() { return firstChild(); }
bool isTableColumn() const { return style()->display() == TABLE_COLUMN; }
bool isTableColumnGroup() const { return style()->display() == TABLE_COLUMN_GROUP; }
RenderTableCol* enclosingColumnGroup() const;
RenderTableCol* enclosingColumnGroupIfAdjacentBefore() const
{
if (previousSibling())
return 0;
return enclosingColumnGroup();
}
RenderTableCol* enclosingColumnGroupIfAdjacentAfter() const
{
if (nextSibling())
return 0;
return enclosingColumnGroup();
}
RenderTableCol* nextColumn() const;
const BorderValue& borderAdjoiningCellStartBorder(const RenderTableCell*) const;
const BorderValue& borderAdjoiningCellEndBorder(const RenderTableCell*) const;
const BorderValue& borderAdjoiningCellBefore(const RenderTableCell*) const;
const BorderValue& borderAdjoiningCellAfter(const RenderTableCell*) const;
private:
virtual RenderObjectChildList* virtualChildren() OVERRIDE { return children(); }
virtual const RenderObjectChildList* virtualChildren() const OVERRIDE { return children(); }
virtual const char* renderName() const OVERRIDE { return "RenderTableCol"; }
virtual bool isRenderTableCol() const OVERRIDE { return true; }
virtual void updateFromElement() OVERRIDE;
virtual void computePreferredLogicalWidths() OVERRIDE { ASSERT_NOT_REACHED(); }
virtual void insertedIntoTree() OVERRIDE;
virtual void willBeRemovedFromTree() OVERRIDE;
virtual bool isChildAllowed(RenderObject*, RenderStyle*) const OVERRIDE;
virtual bool canHaveChildren() const OVERRIDE;
virtual LayerType layerTypeRequired() const OVERRIDE { return NoLayer; }
virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const OVERRIDE;
virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) OVERRIDE;
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE;
RenderTable* table() const;
RenderObjectChildList m_children;
unsigned m_span;
};
DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderTableCol, isRenderTableCol());
}
#endif