Skip to content

Commit

Permalink
Merge r180241 - Minor RenderTable* class cleanups.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=141707

Reviewed by Andreas Kling.

Use in-class initializer where possible.
Remove redundant code.
Move multiline implementations out of class declaration.

No change in functionality.

* rendering/RenderTableCaption.cpp:
(WebCore::RenderTableCaption::insertedIntoTree):
(WebCore::RenderTableCaption::willBeRemovedFromTree):
(WebCore::RenderTableCaption::containingBlockLogicalWidthForContent): Deleted.
* rendering/RenderTableCaption.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::RenderTableCell):
* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::colSpan):
(WebCore::RenderTableCell::rowSpan):
(WebCore::RenderTableCell::setCol):
(WebCore::RenderTableCell::col):
(WebCore::RenderTableCell::section):
(WebCore::RenderTableCell::table):
(WebCore::RenderTableCell::rowIndex):
(WebCore::RenderTableCell::styleOrColLogicalWidth):
(WebCore::RenderTableCell::logicalHeightForRowSizing):
(WebCore::RenderTableCell::isBaselineAligned):
(WebCore::RenderTableCell::borderAdjoiningTableStart):
(WebCore::RenderTableCell::borderAdjoiningTableEnd):
(WebCore::RenderTableCell::borderAdjoiningCellBefore):
(WebCore::RenderTableCell::borderAdjoiningCellAfter):
* rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::RenderTableCol):
* rendering/RenderTableCol.h:
(WebCore::RenderTableCol::enclosingColumnGroupIfAdjacentBefore):
(WebCore::RenderTableCol::enclosingColumnGroupIfAdjacentAfter):
* rendering/RenderTableRow.h:
(WebCore::RenderTableRow::setRowIndex):
(WebCore::RenderTableRow::rowIndex):
(WebCore::RenderTableRow::borderAdjoiningTableStart):
(WebCore::RenderTableRow::borderAdjoiningTableEnd):
(WebCore::RenderTableRow::table):
(WebCore::RenderTableSection::firstRow):
(WebCore::RenderTableSection::lastRow):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::RenderTableSection):
(WebCore::RenderTableSection::dirtiedRows):
(WebCore::RenderTableSection::dirtiedColumns):
(WebCore::RenderTableSection::paintObject):
(WebCore::RenderTableSection::nodeAtPoint):
* rendering/RenderTableSection.h:
(WebCore::CellSpan::CellSpan):
(WebCore::RenderTableSection::borderAdjoiningTableStart):
(WebCore::RenderTableSection::borderAdjoiningTableEnd):
(WebCore::RenderTableSection::cellAt):
(WebCore::RenderTableSection::primaryCellAt):
(WebCore::RenderTableSection::rowRendererAt):
(WebCore::RenderTableSection::outerBorderLeft):
(WebCore::RenderTableSection::outerBorderRight):
(WebCore::RenderTableSection::outerBorderTop):
(WebCore::RenderTableSection::outerBorderBottom):
(WebCore::RenderTableSection::numRows):
(WebCore::RenderTableSection::recalcCellsIfNeeded):
(WebCore::RenderTableSection::rowBaseline):
(WebCore::RenderTableSection::fullTableRowSpan):
(WebCore::CellSpan::start): Deleted.
(WebCore::CellSpan::end): Deleted.
  • Loading branch information
alanbaradlay authored and carlosgcampos committed Apr 13, 2015
1 parent 859688b commit d271823
Show file tree
Hide file tree
Showing 10 changed files with 408 additions and 370 deletions.
72 changes: 72 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,75 @@
2015-02-17 Zalan Bujtas <zalan@apple.com>

Minor RenderTable* class cleanups.
https://bugs.webkit.org/show_bug.cgi?id=141707

Reviewed by Andreas Kling.

Use in-class initializer where possible.
Remove redundant code.
Move multiline implementations out of class declaration.

No change in functionality.

* rendering/RenderTableCaption.cpp:
(WebCore::RenderTableCaption::insertedIntoTree):
(WebCore::RenderTableCaption::willBeRemovedFromTree):
(WebCore::RenderTableCaption::containingBlockLogicalWidthForContent): Deleted.
* rendering/RenderTableCaption.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::RenderTableCell):
* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::colSpan):
(WebCore::RenderTableCell::rowSpan):
(WebCore::RenderTableCell::setCol):
(WebCore::RenderTableCell::col):
(WebCore::RenderTableCell::section):
(WebCore::RenderTableCell::table):
(WebCore::RenderTableCell::rowIndex):
(WebCore::RenderTableCell::styleOrColLogicalWidth):
(WebCore::RenderTableCell::logicalHeightForRowSizing):
(WebCore::RenderTableCell::isBaselineAligned):
(WebCore::RenderTableCell::borderAdjoiningTableStart):
(WebCore::RenderTableCell::borderAdjoiningTableEnd):
(WebCore::RenderTableCell::borderAdjoiningCellBefore):
(WebCore::RenderTableCell::borderAdjoiningCellAfter):
* rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::RenderTableCol):
* rendering/RenderTableCol.h:
(WebCore::RenderTableCol::enclosingColumnGroupIfAdjacentBefore):
(WebCore::RenderTableCol::enclosingColumnGroupIfAdjacentAfter):
* rendering/RenderTableRow.h:
(WebCore::RenderTableRow::setRowIndex):
(WebCore::RenderTableRow::rowIndex):
(WebCore::RenderTableRow::borderAdjoiningTableStart):
(WebCore::RenderTableRow::borderAdjoiningTableEnd):
(WebCore::RenderTableRow::table):
(WebCore::RenderTableSection::firstRow):
(WebCore::RenderTableSection::lastRow):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::RenderTableSection):
(WebCore::RenderTableSection::dirtiedRows):
(WebCore::RenderTableSection::dirtiedColumns):
(WebCore::RenderTableSection::paintObject):
(WebCore::RenderTableSection::nodeAtPoint):
* rendering/RenderTableSection.h:
(WebCore::CellSpan::CellSpan):
(WebCore::RenderTableSection::borderAdjoiningTableStart):
(WebCore::RenderTableSection::borderAdjoiningTableEnd):
(WebCore::RenderTableSection::cellAt):
(WebCore::RenderTableSection::primaryCellAt):
(WebCore::RenderTableSection::rowRendererAt):
(WebCore::RenderTableSection::outerBorderLeft):
(WebCore::RenderTableSection::outerBorderRight):
(WebCore::RenderTableSection::outerBorderTop):
(WebCore::RenderTableSection::outerBorderBottom):
(WebCore::RenderTableSection::numRows):
(WebCore::RenderTableSection::recalcCellsIfNeeded):
(WebCore::RenderTableSection::rowBaseline):
(WebCore::RenderTableSection::fullTableRowSpan):
(WebCore::CellSpan::start): Deleted.
(WebCore::CellSpan::end): Deleted.

2015-04-01 Carlos Alberto Lopez Perez <clopez@igalia.com>

[CMake][GTK] Use the right variable to include the Wayland headers.
Expand Down
8 changes: 0 additions & 8 deletions Source/WebCore/rendering/RenderTableCaption.cpp
Expand Up @@ -33,23 +33,15 @@ RenderTableCaption::~RenderTableCaption()
{
}

LayoutUnit RenderTableCaption::containingBlockLogicalWidthForContent() const
{
RenderBlock* cb = containingBlock();
return cb->logicalWidth();
}

void RenderTableCaption::insertedIntoTree()
{
RenderBlockFlow::insertedIntoTree();

table()->addCaption(this);
}

void RenderTableCaption::willBeRemovedFromTree()
{
RenderBlockFlow::willBeRemovedFromTree();

table()->removeCaption(this);
}

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderTableCaption.h
Expand Up @@ -33,7 +33,7 @@ class RenderTableCaption final : public RenderBlockFlow {

Element& element() const { return downcast<Element>(nodeForNonAnonymous()); }

virtual LayoutUnit containingBlockLogicalWidthForContent() const override;
virtual LayoutUnit containingBlockLogicalWidthForContent() const override { return containingBlock()->logicalWidth(); }

private:
virtual bool isTableCaption() const override { return true; }
Expand Down
6 changes: 2 additions & 4 deletions Source/WebCore/rendering/RenderTableCell.cpp
Expand Up @@ -58,8 +58,8 @@ RenderTableCell::RenderTableCell(Element& element, Ref<RenderStyle>&& style)
: RenderBlockFlow(element, WTF::move(style))
, m_column(unsetColumnIndex)
, m_cellWidthChanged(false)
, m_intrinsicPaddingBefore(0)
, m_intrinsicPaddingAfter(0)
, m_hasColSpan(false)
, m_hasRowSpan(false)
{
// We only update the flags when notified of DOM changes in colSpanOrRowSpanChanged()
// so we need to set their initial values here in case something asks for colSpan()/rowSpan() before then.
Expand All @@ -72,8 +72,6 @@ RenderTableCell::RenderTableCell(Document& document, Ref<RenderStyle>&& style)
, m_cellWidthChanged(false)
, m_hasColSpan(false)
, m_hasRowSpan(false)
, m_intrinsicPaddingBefore(0)
, m_intrinsicPaddingAfter(0)
{
}

Expand Down

0 comments on commit d271823

Please sign in to comment.