| Index: third_party/WebKit/Source/core/layout/LayoutTableCell.h
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCell.h b/third_party/WebKit/Source/core/layout/LayoutTableCell.h
|
| index 1380b1907c857889972587d5570bdbe86d23067f..d0c01db5a52703135f5308f9244ad09ad433bafb 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutTableCell.h
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutTableCell.h
|
| @@ -109,13 +109,19 @@ class CORE_EXPORT LayoutTableCell final : public LayoutBlockFlow {
|
| absolute_column_index_ = column;
|
| }
|
|
|
| - bool HasSetAbsoluteColumnIndex() const {
|
| - return absolute_column_index_ != kUnsetColumnIndex;
|
| + // See LayoutTable.h for definition of absolute and effective columns.
|
| + // In most cases we should use EffectiveColumnIndex() instead of
|
| + // AbsolutColumnIndex().
|
| + unsigned AbsoluteColumnIndex() const { return absolute_column_index_; }
|
| + unsigned EffectiveColumnIndex() const {
|
| + DCHECK_NE(absolute_column_index_, kUnsetColumnIndex);
|
| + return Table()->AbsoluteColumnToEffectiveColumn(absolute_column_index_);
|
| }
|
| -
|
| - unsigned AbsoluteColumnIndex() const {
|
| - DCHECK(HasSetAbsoluteColumnIndex());
|
| - return absolute_column_index_;
|
| + // Returns effective column index, of the cell after this cell, or of the
|
| + // imaginary cell after this cell if there is no cell after this cell.
|
| + unsigned EffectiveColumnIndexOfCellAfter() const {
|
| + return Table()->AbsoluteColumnToEffectiveColumn(absolute_column_index_ +
|
| + ColSpan());
|
| }
|
|
|
| LayoutTableRow* Row() const { return ToLayoutTableRow(Parent()); }
|
| @@ -125,6 +131,9 @@ class CORE_EXPORT LayoutTableCell final : public LayoutBlockFlow {
|
| LayoutTable* Table() const {
|
| return ToLayoutTable(Parent()->Parent()->Parent());
|
| }
|
| + LayoutTable::ColAndColGroup GetColAndColGroup() const {
|
| + return Table()->ColAndColGroupAtEffectiveColumn(EffectiveColumnIndex());
|
| + }
|
|
|
| LayoutTableCell* PreviousCell() const;
|
| LayoutTableCell* NextCell() const;
|
| @@ -140,9 +149,7 @@ class CORE_EXPORT LayoutTableCell final : public LayoutBlockFlow {
|
| if (!style_width.IsAuto())
|
| return style_width;
|
| if (LayoutTableCol* first_column =
|
| - Table()
|
| - ->ColElementAtAbsoluteColumn(AbsoluteColumnIndex())
|
| - .InnermostColOrColGroup())
|
| + GetColAndColGroup().InnermostColOrColGroup())
|
| return LogicalWidthFromColumns(first_column, style_width);
|
| return style_width;
|
| }
|
| @@ -368,6 +375,7 @@ class CORE_EXPORT LayoutTableCell final : public LayoutBlockFlow {
|
| const PaintInvalidatorContext&) const override;
|
|
|
| private:
|
| + friend class LayoutTableCellDeathTest;
|
| friend class LayoutTableCellTest;
|
|
|
| bool IsOfType(LayoutObjectType type) const override {
|
|
|