#pragma once
#include "RenderBox.h"
namespace WebCore {
class RenderTable;
class RenderTableCell;
class RenderTableCol final : public RenderBox {
WTF_MAKE_ISO_ALLOCATED(RenderTableCol);
public:
RenderTableCol(Element&, RenderStyle&&);
Element& element() const { return downcast<Element>(nodeForNonAnonymous()); }
void clearPreferredLogicalWidthsDirtyBits();
unsigned span() const { return m_span; }
void setSpan(unsigned span) { m_span = span; }
bool isTableColumnGroupWithColumnChildren() const { 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;
RenderTableCol* enclosingColumnGroupIfAdjacentAfter() const;
RenderTableCol* nextColumn() const;
const BorderValue& borderAdjoiningCellStartBorder() const;
const BorderValue& borderAdjoiningCellEndBorder() const;
const BorderValue& borderAdjoiningCellBefore(const RenderTableCell&) const;
const BorderValue& borderAdjoiningCellAfter(const RenderTableCell&) const;
LayoutUnit offsetLeft() const override;
LayoutUnit offsetTop() const override;
LayoutUnit offsetWidth() const override;
LayoutUnit offsetHeight() const override;
void updateFromElement() override;
private:
const char* renderName() const override { return "RenderTableCol"; }
bool isRenderTableCol() const override { return true; }
void computePreferredLogicalWidths() override { ASSERT_NOT_REACHED(); }
void insertedIntoTree() override;
void willBeRemovedFromTree() override;
bool isChildAllowed(const RenderObject&, const RenderStyle&) const override;
bool canHaveChildren() const override;
bool requiresLayer() const override { return false; }
LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override;
void imageChanged(WrappedImagePtr, const IntRect* = 0) override;
void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
void paint(PaintInfo&, const LayoutPoint&) override { }
RenderTable* table() const;
unsigned m_span { 1 };
};
inline RenderTableCol* RenderTableCol::enclosingColumnGroupIfAdjacentBefore() const
{
if (previousSibling())
return nullptr;
return enclosingColumnGroup();
}
inline RenderTableCol* RenderTableCol::enclosingColumnGroupIfAdjacentAfter() const
{
if (nextSibling())
return nullptr;
return enclosingColumnGroup();
}
}
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTableCol, isRenderTableCol())