#include "core/rendering/RenderTable.h"
#include "wtf/Vector.h"
-namespace WebCore {
+namespace blink {
enum CollapsedBorderSide {
CBSBefore,
public:
RenderTableSection(Element*);
virtual ~RenderTableSection();
+ virtual void trace(Visitor*) OVERRIDE;
RenderTableRow* firstRow() const;
RenderTableRow* lastRow() const;
RenderTable* table() const { return toRenderTable(parent()); }
- typedef Vector<RenderTableCell*, 2> SpanningRenderTableCells;
+ typedef WillBeHeapVector<RawPtrWillBeMember<RenderTableCell>, 2> SpanningRenderTableCells;
struct CellStruct {
- Vector<RenderTableCell*, 1> cells;
+ ALLOW_ONLY_INLINE_ALLOCATION();
+ public:
+ WillBeHeapVector<RawPtrWillBeMember<RenderTableCell>, 1> cells;
bool inColSpan; // true for columns after the first in a colspan
CellStruct()
: inColSpan(false)
{
}
+ void trace(Visitor*);
RenderTableCell* primaryCell()
{
- return hasCells() ? cells[cells.size() - 1] : 0;
+ return hasCells() ? cells[cells.size() - 1].get() : 0;
}
const RenderTableCell* primaryCell() const
{
- return hasCells() ? cells[cells.size() - 1] : 0;
+ return hasCells() ? cells[cells.size() - 1].get() : 0;
}
bool hasCells() const { return cells.size() > 0; }
};
- typedef Vector<CellStruct> Row;
+ typedef WillBeHeapVector<CellStruct> Row;
struct RowStruct {
+ ALLOW_ONLY_INLINE_ALLOCATION();
+ public:
RowStruct()
- : rowRenderer(0)
+ : rowRenderer(nullptr)
, baseline()
{
}
+ void trace(Visitor*);
Row row;
- RenderTableRow* rowRenderer;
+ RawPtrWillBeMember<RenderTableRow> rowRenderer;
LayoutUnit baseline;
Length logicalHeight;
};
RenderObjectChildList m_children;
- Vector<RowStruct> m_grid;
+ WillBeHeapVector<RowStruct> m_grid;
Vector<int> m_rowPos;
// the current insertion position
// This HashSet holds the overflowing cells for faster painting.
// If we have more than gMaxAllowedOverflowingCellRatio * total cells, it will be empty
// and m_forceSlowPaintPathWithOverflowingCell will be set to save memory.
- HashSet<RenderTableCell*> m_overflowingCells;
+ WillBeHeapHashSet<RawPtrWillBeMember<RenderTableCell> > m_overflowingCells;
bool m_forceSlowPaintPathWithOverflowingCell;
bool m_hasMultipleCellLevels;
// This map holds the collapsed border values for cells with collapsed borders.
// It is held at RenderTableSection level to spare memory consumption by table cells.
- HashMap<pair<const RenderTableCell*, int>, CollapsedBorderValue > m_cellsCollapsedBorders;
+ WillBeHeapHashMap<pair<RawPtrWillBeMember<const RenderTableCell>, int>, CollapsedBorderValue > m_cellsCollapsedBorders;
};
DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderTableSection, isTableSection());
-} // namespace WebCore
+} // namespace blink
+
+namespace WTF {
+
+#if ENABLE(OILPAN)
+template<> struct VectorTraits<blink::RenderTableSection::CellStruct> : VectorTraitsBase<blink::RenderTableSection::CellStruct> {
+ static const bool needsDestruction = false;
+};
+template<> struct VectorTraits<blink::RenderTableSection::RowStruct> : VectorTraitsBase<blink::RenderTableSection::RowStruct> {
+ static const bool needsDestruction = false;
+};
+#endif
+
+}
#endif // RenderTableSection_h