summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderTableCell.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/RenderTableCell.h')
-rw-r--r--Source/WebCore/rendering/RenderTableCell.h50
1 files changed, 23 insertions, 27 deletions
diff --git a/Source/WebCore/rendering/RenderTableCell.h b/Source/WebCore/rendering/RenderTableCell.h
index e18372ac5..dac8a7606 100644
--- a/Source/WebCore/rendering/RenderTableCell.h
+++ b/Source/WebCore/rendering/RenderTableCell.h
@@ -25,15 +25,13 @@
#ifndef RenderTableCell_h
#define RenderTableCell_h
+#include "RenderTableRow.h"
#include "RenderTableSection.h"
namespace WebCore {
-static const unsigned unsetColumnIndex = 0x7FFFFFFF;
-static const unsigned maxColumnIndex = 0x7FFFFFFE; // 2,147,483,646
-
-static const unsigned unsetRowIndex = 0x7FFFFFFF;
-static const unsigned maxRowIndex = 0x7FFFFFFE; // 2,147,483,646
+static const unsigned unsetColumnIndex = 0x3FFFFFFF;
+static const unsigned maxColumnIndex = 0x3FFFFFFE; // 1,073,741,823
enum IncludeBorderColorOrNot { DoNotIncludeBorderColor, IncludeBorderColor };
@@ -65,24 +63,17 @@ public:
return m_column;
}
- void setRow(unsigned row)
- {
- if (UNLIKELY(row > maxRowIndex))
- CRASH();
-
- m_row = row;
- }
+ RenderTableRow* row() const { return toRenderTableRow(parent()); }
+ RenderTableSection* section() const { return toRenderTableSection(parent()->parent()); }
+ RenderTable* table() const { return toRenderTable(parent()->parent()->parent()); }
- bool rowWasSet() const { return m_row != unsetRowIndex; }
- unsigned row() const
+ unsigned rowIndex() const
{
- ASSERT(rowWasSet());
- return m_row;
+ // This function shouldn't be called on a detached cell.
+ ASSERT(row());
+ return row()->rowIndex();
}
- RenderTableSection* section() const { return toRenderTableSection(parent()->parent()); }
- RenderTable* table() const { return toRenderTable(parent()->parent()->parent()); }
-
Length styleOrColLogicalWidth() const;
LayoutUnit logicalHeightForRowSizing() const;
@@ -120,16 +111,16 @@ public:
int intrinsicPaddingBefore() const { return m_intrinsicPaddingBefore; }
int intrinsicPaddingAfter() const { return m_intrinsicPaddingAfter; }
- virtual LayoutUnit paddingTop(PaddingOptions = IncludeIntrinsicPadding) const;
- virtual LayoutUnit paddingBottom(PaddingOptions = IncludeIntrinsicPadding) const;
- virtual LayoutUnit paddingLeft(PaddingOptions = IncludeIntrinsicPadding) const;
- virtual LayoutUnit paddingRight(PaddingOptions = IncludeIntrinsicPadding) const;
+ virtual LayoutUnit paddingTop() const OVERRIDE;
+ virtual LayoutUnit paddingBottom() const OVERRIDE;
+ virtual LayoutUnit paddingLeft() const OVERRIDE;
+ virtual LayoutUnit paddingRight() const OVERRIDE;
// FIXME: For now we just assume the cell has the same block flow direction as the table. It's likely we'll
// create an extra anonymous RenderBlock to handle mixing directionality anyway, in which case we can lock
// the block flow directionality of the cells to the table's directionality.
- virtual LayoutUnit paddingBefore(PaddingOptions = IncludeIntrinsicPadding) const;
- virtual LayoutUnit paddingAfter(PaddingOptions = IncludeIntrinsicPadding) const;
+ virtual LayoutUnit paddingBefore() const OVERRIDE;
+ virtual LayoutUnit paddingAfter() const OVERRIDE;
void setOverrideHeightFromRowHeight(LayoutUnit);
@@ -138,6 +129,12 @@ public:
bool cellWidthChanged() const { return m_cellWidthChanged; }
void setCellWidthChanged(bool b = true) { m_cellWidthChanged = b; }
+ static RenderTableCell* createAnonymousWithParentRenderer(const RenderObject*);
+ virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE
+ {
+ return createAnonymousWithParentRenderer(parent);
+ }
+
protected:
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
@@ -184,9 +181,8 @@ private:
CollapsedBorderValue computeCollapsedBeforeBorder(IncludeBorderColorOrNot = IncludeBorderColor) const;
CollapsedBorderValue computeCollapsedAfterBorder(IncludeBorderColorOrNot = IncludeBorderColor) const;
- unsigned m_row : 31;
+ unsigned m_column : 30;
bool m_cellWidthChanged : 1;
- unsigned m_column : 31;
bool m_hasAssociatedTableCellElement : 1;
int m_intrinsicPaddingBefore;
int m_intrinsicPaddingAfter;