Commit fac6ea82 authored by Aleks Totic's avatar Aleks Totic Committed by Commit Bot

[TableNG] Simplify table interface

CellPreceding and CellAbove were only used to determine if
this was the first cell in the table.

Bug: 958381
Change-Id: I372331b7a9534200ae7f060a5b67d91d9bd7ec49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1896036
Auto-Submit: Aleks Totic <atotic@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711921}
parent c54e9514
......@@ -579,7 +579,7 @@ bool TextIteratorAlgorithm<Strategy>::ShouldEmitTabBeforeNode(
const LayoutNGTableCellInterface* rc =
ToInterface<LayoutNGTableCellInterface>(r);
const LayoutNGTableInterface* t = rc->TableInterface();
return t && (t->CellInterfacePreceding(*rc) || t->CellInterfaceAbove(*rc));
return t && !t->IsFirstCell(*rc);
}
template <typename Strategy>
......
......@@ -1871,14 +1871,9 @@ bool LayoutTable::PaintedOutputOfObjectHasNoEffectRegardlessOfSize() const {
}
// LayoutNGTableCellInterface API
LayoutNGTableCellInterface* LayoutTable::CellInterfacePreceding(
const LayoutNGTableCellInterface& cell) const {
return CellPreceding(*cell.ToLayoutTableCell());
}
LayoutNGTableCellInterface* LayoutTable::CellInterfaceAbove(
const LayoutNGTableCellInterface& cell) const {
return CellAbove(*cell.ToLayoutTableCell());
bool LayoutTable::IsFirstCell(const LayoutNGTableCellInterface& cell) const {
const LayoutTableCell& layout_cell = *cell.ToLayoutTableCell();
return !(CellPreceding(layout_cell) || CellAbove(layout_cell));
}
} // namespace blink
......@@ -448,10 +448,7 @@ class CORE_EXPORT LayoutTable final : public LayoutBlock,
LayoutNGTableSectionInterface* SectionBelowInterface(
const LayoutNGTableSectionInterface*,
SkipEmptySectionsValue) const final;
LayoutNGTableCellInterface* CellInterfacePreceding(
const LayoutNGTableCellInterface& cell) const final;
LayoutNGTableCellInterface* CellInterfaceAbove(
const LayoutNGTableCellInterface& cell) const final;
bool IsFirstCell(const LayoutNGTableCellInterface&) const final;
// LayoutNGTableInterface methods end.
......
......@@ -44,10 +44,7 @@ class LayoutNGTableInterface {
virtual LayoutNGTableSectionInterface* SectionBelowInterface(
const LayoutNGTableSectionInterface*,
SkipEmptySectionsValue) const = 0;
virtual LayoutNGTableCellInterface* CellInterfacePreceding(
const LayoutNGTableCellInterface&) const = 0;
virtual LayoutNGTableCellInterface* CellInterfaceAbove(
const LayoutNGTableCellInterface&) const = 0;
virtual bool IsFirstCell(const LayoutNGTableCellInterface&) const = 0;
};
template <>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment