Diff
Modified: trunk/Source/WebCore/ChangeLog (203707 => 203708)
--- trunk/Source/WebCore/ChangeLog 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/ChangeLog 2016-07-26 02:40:04 UTC (rev 203708)
@@ -1,3 +1,58 @@
+2016-07-25 Zalan Bujtas <[email protected]>
+
+ Cleanup RenderTable*::createAnonymous*
+ https://bugs.webkit.org/show_bug.cgi?id=160175
+
+ Reviewed by Simon Fraser.
+
+ This patch
+ 1. tightens the type on createAnonymousBoxWithSameTypeAs, createAnonymousWithParentRendererAndDisplay and
+ createAnonymousWithParentRenderer from RenderObject to the appropriate type.
+ 2. changes the return type of create* function from raw pointer to std::unique_ptr<>
+ 3. decouples createAnonymousBoxWithSameTypeAs and createAnonymousWithParentRenderer.
+ createAnonymousBoxWithSameTypeAs misleadingly calls createAnonymousWithParentRenderer
+ while it is never the parent in case of table items.
+ (std::unique_ptr::release() vs. WTFMove() will be addressed in a separate patch)
+
+ No change in functionality.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::createAnonymousBoxWithSameTypeAs):
+ (WebCore::RenderBlock::createAnonymousWithParentRendererAndDisplay):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::createAnonymousBlock):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::layoutOverflowRectForPropagation):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::createAnonymousBoxWithSameTypeAs):
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::addChild):
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::splitFlow):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::addChild):
+ (WebCore::RenderTable::createTableWithStyle):
+ (WebCore::RenderTable::createAnonymousWithParentRenderer):
+ * rendering/RenderTable.h:
+ (WebCore::RenderTable::createAnonymousBoxWithSameTypeAs):
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::createTableCellWithStyle):
+ (WebCore::RenderTableCell::createAnonymousWithParentRenderer):
+ * rendering/RenderTableCell.h:
+ (WebCore::RenderTableCell::createAnonymousBoxWithSameTypeAs):
+ * rendering/RenderTableRow.cpp:
+ (WebCore::RenderTableRow::addChild):
+ (WebCore::RenderTableRow::createTableRowWithStyle):
+ (WebCore::RenderTableRow::createAnonymousWithParentRenderer):
+ * rendering/RenderTableRow.h:
+ (WebCore::RenderTableRow::createAnonymousBoxWithSameTypeAs):
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::addChild):
+ (WebCore::RenderTableSection::createTableSectionWithStyle):
+ (WebCore::RenderTableSection::createAnonymousWithParentRenderer):
+ * rendering/RenderTableSection.h:
+ (WebCore::RenderTableSection::createAnonymousBoxWithSameTypeAs):
+
2016-07-25 Chris Dumez <[email protected]>
Touch properties should be on the prototype
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2016-07-26 02:40:04 UTC (rev 203708)
@@ -3550,9 +3550,17 @@
inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint(LayoutPoint(additionalOffset + inlineElementContinuation()->containingBlock()->location() - location())), paintContainer);
}
-RenderBox* RenderBlock::createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const
+std::unique_ptr<RenderBlock> RenderBlock::createAnonymousBlockWithStyleAndDisplay(Document& document, const RenderStyle& style, EDisplay display)
{
- return createAnonymousWithParentRendererAndDisplay(parent, style().display());
+ // FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ?
+ std::unique_ptr<RenderBlock> newBox;
+ if (display == FLEX || display == INLINE_FLEX)
+ newBox = std::make_unique<RenderFlexibleBox>(document, RenderStyle::createAnonymousStyleWithDisplay(style, FLEX));
+ else
+ newBox = std::make_unique<RenderBlockFlow>(document, RenderStyle::createAnonymousStyleWithDisplay(style, BLOCK));
+
+ newBox->initializeStyle();
+ return newBox;
}
LayoutUnit RenderBlock::offsetFromLogicalTopOfFirstPage() const
@@ -3815,19 +3823,6 @@
return constructTextRun(StringView(characters, length), style, expansion);
}
-RenderBlock* RenderBlock::createAnonymousWithParentRendererAndDisplay(const RenderObject* parent, EDisplay display)
-{
- // FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ?
- RenderBlock* newBox;
- if (display == FLEX || display == INLINE_FLEX)
- newBox = new RenderFlexibleBox(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), FLEX));
- else
- newBox = new RenderBlockFlow(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), BLOCK));
-
- newBox->initializeStyle();
- return newBox;
-}
-
#ifndef NDEBUG
void RenderBlock::checkPositionedObjectsNeedLayout()
{
Modified: trunk/Source/WebCore/rendering/RenderBlock.h (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderBlock.h 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2016-07-26 02:40:04 UTC (rev 203708)
@@ -57,11 +57,11 @@
class RenderBlock : public RenderBox {
public:
friend class LineLayoutState;
+ virtual ~RenderBlock();
protected:
RenderBlock(Element&, RenderStyle&&, BaseTypeFlags);
RenderBlock(Document&, RenderStyle&&, BaseTypeFlags);
- virtual ~RenderBlock();
public:
// These two functions are overridden for inline-block.
@@ -192,11 +192,11 @@
using RenderBoxModelObject::continuation;
using RenderBoxModelObject::setContinuation;
- static RenderBlock* createAnonymousWithParentRendererAndDisplay(const RenderObject*, EDisplay = BLOCK);
- RenderBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return createAnonymousWithParentRendererAndDisplay(this, display); }
+ static std::unique_ptr<RenderBlock> createAnonymousWithParentRendererAndDisplay(const RenderBox& parent, EDisplay = BLOCK);
+ RenderBlock* createAnonymousBlock(EDisplay = BLOCK) const;
static void dropAnonymousBoxChild(RenderBlock& parent, RenderBlock& child);
- RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const override;
+ std::unique_ptr<RenderBox> createAnonymousBoxWithSameTypeAs(const RenderBox&) const override;
static bool shouldSkipCreatingRunsForObject(RenderObject& obj)
{
@@ -392,6 +392,8 @@
void preparePaginationBeforeBlockLayout(bool&);
private:
+ static std::unique_ptr<RenderBlock> createAnonymousBlockWithStyleAndDisplay(Document&, const RenderStyle&, EDisplay);
+
// FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
virtual LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit, LayoutUnit fixedOffset, LayoutUnit) const { return fixedOffset; };
// FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
@@ -518,6 +520,21 @@
LayoutUnit inlineDirectionOffset(RenderBlock& rootBlock, const LayoutSize& offsetFromRootBlock);
VisiblePosition positionForPointRespectingEditingBoundaries(RenderBlock&, RenderBox&, const LayoutPoint&);
+inline std::unique_ptr<RenderBlock> RenderBlock::createAnonymousWithParentRendererAndDisplay(const RenderBox& parent, EDisplay display)
+{
+ return createAnonymousBlockWithStyleAndDisplay(parent.document(), parent.style(), display);
+}
+
+inline std::unique_ptr<RenderBox> RenderBlock::createAnonymousBoxWithSameTypeAs(const RenderBox& renderer) const
+{
+ return createAnonymousBlockWithStyleAndDisplay(document(), renderer.style(), style().display());
+}
+
+inline RenderBlock* RenderBlock::createAnonymousBlock(EDisplay display) const
+{
+ return createAnonymousBlockWithStyleAndDisplay(document(), style(), display).release();
+}
+
} // namespace WebCore
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderBlock, isRenderBlock())
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2016-07-26 02:40:04 UTC (rev 203708)
@@ -5117,7 +5117,7 @@
// We have to split the parent box into two boxes and move children
// from |beforeChild| to end into the new post box.
- RenderBox* postBox = boxToSplit.createAnonymousBoxWithSameTypeAs(this);
+ auto* postBox = boxToSplit.createAnonymousBoxWithSameTypeAs(*this).release();
postBox->setChildrenInline(boxToSplit.childrenInline());
RenderBox* parentBox = downcast<RenderBox>(boxToSplit.parent());
// We need to invalidate the |parentBox| before inserting the new node
Modified: trunk/Source/WebCore/rendering/RenderBox.h (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderBox.h 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderBox.h 2016-07-26 02:40:04 UTC (rev 203708)
@@ -598,7 +598,7 @@
return layoutOverflowRect.y() < y() || layoutOverflowRect.maxY() > y() + logicalHeight();
}
- virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject*) const
+ virtual std::unique_ptr<RenderBox> createAnonymousBoxWithSameTypeAs(const RenderBox&) const
{
ASSERT_NOT_REACHED();
return nullptr;
Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderElement.cpp 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp 2016-07-26 02:40:04 UTC (rev 203708)
@@ -492,7 +492,7 @@
if (afterChild && afterChild->isAnonymous() && is<RenderTable>(*afterChild) && !afterChild->isBeforeContent())
table = downcast<RenderTable>(afterChild);
else {
- table = RenderTable::createAnonymousWithParentRenderer(this);
+ table = RenderTable::createAnonymousWithParentRenderer(*this).release();
addChild(table, beforeChild);
}
table->addChild(newChild);
Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderInline.cpp 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp 2016-07-26 02:40:04 UTC (rev 203708)
@@ -563,7 +563,7 @@
madeNewBeforeBlock = true;
}
- RenderBlock& post = downcast<RenderBlock>(*pre->createAnonymousBoxWithSameTypeAs(block));
+ auto& post = downcast<RenderBlock>(*pre->createAnonymousBoxWithSameTypeAs(*block).release());
RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
if (madeNewBeforeBlock)
Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderTable.cpp 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp 2016-07-26 02:40:04 UTC (rev 203708)
@@ -216,7 +216,7 @@
if (beforeChild && !is<RenderTableSection>(*beforeChild) && beforeChild->style().display() != TABLE_CAPTION && beforeChild->style().display() != TABLE_COLUMN_GROUP)
beforeChild = nullptr;
- RenderTableSection* section = RenderTableSection::createAnonymousWithParentRenderer(this);
+ auto section = RenderTableSection::createAnonymousWithParentRenderer(*this).release();
addChild(section, beforeChild);
section->addChild(child);
}
@@ -1555,13 +1555,18 @@
return false;
}
-RenderTable* RenderTable::createAnonymousWithParentRenderer(const RenderObject* parent)
+std::unique_ptr<RenderTable> RenderTable::createTableWithStyle(Document& document, const RenderStyle& style)
{
- auto table = new RenderTable(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), parent->style().display() == INLINE ? INLINE_TABLE : TABLE));
+ auto table = std::make_unique<RenderTable>(document, RenderStyle::createAnonymousStyleWithDisplay(style, style.display() == INLINE ? INLINE_TABLE : TABLE));
table->initializeStyle();
return table;
}
+std::unique_ptr<RenderTable> RenderTable::createAnonymousWithParentRenderer(const RenderElement& parent)
+{
+ return RenderTable::createTableWithStyle(parent.document(), parent.style());
+}
+
const BorderValue& RenderTable::tableStartBorderAdjoiningCell(const RenderTableCell& cell) const
{
ASSERT(cell.isFirstOrLastCellInRow());
Modified: trunk/Source/WebCore/rendering/RenderTable.h (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderTable.h 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderTable.h 2016-07-26 02:40:04 UTC (rev 203708)
@@ -251,11 +251,8 @@
recalcSections();
}
- static RenderTable* createAnonymousWithParentRenderer(const RenderObject*);
- RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const override
- {
- return createAnonymousWithParentRenderer(parent);
- }
+ static std::unique_ptr<RenderTable> createAnonymousWithParentRenderer(const RenderElement&);
+ std::unique_ptr<RenderBox> createAnonymousBoxWithSameTypeAs(const RenderBox& renderer) const override;
const BorderValue& tableStartBorderAdjoiningCell(const RenderTableCell&) const;
const BorderValue& tableEndBorderAdjoiningCell(const RenderTableCell&) const;
@@ -277,6 +274,8 @@
void simplifiedNormalFlowLayout() final;
private:
+ static std::unique_ptr<RenderTable> createTableWithStyle(Document&, const RenderStyle&);
+
const char* renderName() const override { return "RenderTable"; }
bool isTable() const final { return true; }
@@ -380,6 +379,11 @@
inline bool isDirectionSame(const RenderBox* tableItem, const RenderBox* otherTableItem) { return tableItem && otherTableItem ? tableItem->style().direction() == otherTableItem->style().direction() : true; }
+inline std::unique_ptr<RenderBox> RenderTable::createAnonymousBoxWithSameTypeAs(const RenderBox& renderer) const
+{
+ return RenderTable::createTableWithStyle(renderer.document(), renderer.style());
+}
+
} // namespace WebCore
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTable, isTable())
Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderTableCell.cpp 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp 2016-07-26 02:40:04 UTC (rev 203708)
@@ -1356,11 +1356,16 @@
setIntrinsicPaddingAfter(intrinsicPaddingAfter() - scrollbarHeight);
}
-RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const RenderObject* parent)
+std::unique_ptr<RenderTableCell> RenderTableCell::createTableCellWithStyle(Document& document, const RenderStyle& style)
{
- auto cell = new RenderTableCell(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), TABLE_CELL));
+ auto cell = std::make_unique<RenderTableCell>(document, RenderStyle::createAnonymousStyleWithDisplay(style, TABLE_CELL));
cell->initializeStyle();
return cell;
}
+std::unique_ptr<RenderTableCell> RenderTableCell::createAnonymousWithParentRenderer(const RenderTableRow& parent)
+{
+ return RenderTableCell::createTableCellWithStyle(parent.document(), parent.style());
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/rendering/RenderTableCell.h (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderTableCell.h 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderTableCell.h 2016-07-26 02:40:04 UTC (rev 203708)
@@ -109,8 +109,8 @@
bool cellWidthChanged() const { return m_cellWidthChanged; }
void setCellWidthChanged(bool b = true) { m_cellWidthChanged = b; }
- static RenderTableCell* createAnonymousWithParentRenderer(const RenderObject*);
- RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const override { return createAnonymousWithParentRenderer(parent); }
+ static std::unique_ptr<RenderTableCell> createAnonymousWithParentRenderer(const RenderTableRow&);
+ std::unique_ptr<RenderBox> createAnonymousBoxWithSameTypeAs(const RenderBox&) const override;
// This function is used to unify which table part's style we use for computing direction and
// writing mode. Writing modes are not allowed on row group and row but direction is.
@@ -139,6 +139,8 @@
void computePreferredLogicalWidths() override;
private:
+ static std::unique_ptr<RenderTableCell> createTableCellWithStyle(Document&, const RenderStyle&);
+
const char* renderName() const override { return (isAnonymous() || isPseudoElement()) ? "RenderTableCell (anonymous)" : "RenderTableCell"; }
bool isTableCell() const override { return true; }
@@ -372,6 +374,11 @@
m_hasEmptyCollapsedEndBorder = false;
}
+inline std::unique_ptr<RenderBox> RenderTableCell::createAnonymousBoxWithSameTypeAs(const RenderBox& renderer) const
+{
+ return RenderTableCell::createTableCellWithStyle(renderer.document(), renderer.style());
+}
+
} // namespace WebCore
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTableCell, isTableCell())
Modified: trunk/Source/WebCore/rendering/RenderTableRow.cpp (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderTableRow.cpp 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderTableRow.cpp 2016-07-26 02:40:04 UTC (rev 203708)
@@ -134,7 +134,7 @@
return;
}
- RenderTableCell* cell = RenderTableCell::createAnonymousWithParentRenderer(this);
+ auto* cell = RenderTableCell::createAnonymousWithParentRenderer(*this).release();
addChild(cell, beforeChild);
cell->addChild(child);
return;
@@ -260,11 +260,16 @@
repaint();
}
-RenderTableRow* RenderTableRow::createAnonymousWithParentRenderer(const RenderObject* parent)
+std::unique_ptr<RenderTableRow> RenderTableRow::createTableRowWithStyle(Document& document, const RenderStyle& style)
{
- auto newRow = new RenderTableRow(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), TABLE_ROW));
- newRow->initializeStyle();
- return newRow;
+ auto row = std::make_unique<RenderTableRow>(document, RenderStyle::createAnonymousStyleWithDisplay(style, TABLE_ROW));
+ row->initializeStyle();
+ return row;
}
+std::unique_ptr<RenderTableRow> RenderTableRow::createAnonymousWithParentRenderer(const RenderTableSection& parent)
+{
+ return RenderTableRow::createTableRowWithStyle(parent.document(), parent.style());
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/rendering/RenderTableRow.h (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderTableRow.h 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderTableRow.h 2016-07-26 02:40:04 UTC (rev 203708)
@@ -47,8 +47,8 @@
void paintOutlineForRowIfNeeded(PaintInfo&, const LayoutPoint&);
- static RenderTableRow* createAnonymousWithParentRenderer(const RenderObject*);
- RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const override { return createAnonymousWithParentRenderer(parent); }
+ static std::unique_ptr<RenderTableRow> createAnonymousWithParentRenderer(const RenderTableSection&);
+ std::unique_ptr<RenderBox> createAnonymousBoxWithSameTypeAs(const RenderBox&) const override;
void setRowIndex(unsigned);
bool rowIndexWasSet() const { return m_rowIndex != unsetRowIndex; }
@@ -64,6 +64,8 @@
bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
private:
+ static std::unique_ptr<RenderTableRow> createTableRowWithStyle(Document&, const RenderStyle&);
+
const char* renderName() const override { return (isAnonymous() || isPseudoElement()) ? "RenderTableRow (anonymous)" : "RenderTableRow"; }
bool isTableRow() const override { return true; }
@@ -147,6 +149,11 @@
return downcast<RenderTableRow>(RenderBox::lastChild());
}
+inline std::unique_ptr<RenderBox> RenderTableRow::createAnonymousBoxWithSameTypeAs(const RenderBox& renderer) const
+{
+ return RenderTableRow::createTableRowWithStyle(renderer.document(), renderer.style());
+}
+
} // namespace WebCore
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTableRow, isTableRow())
Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderTableSection.cpp 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp 2016-07-26 02:40:04 UTC (rev 203708)
@@ -151,7 +151,7 @@
return;
}
- RenderTableRow* row = RenderTableRow::createAnonymousWithParentRenderer(this);
+ auto* row = RenderTableRow::createAnonymousWithParentRenderer(*this).release();
addChild(row, beforeChild);
row->addChild(child);
return;
@@ -1577,13 +1577,18 @@
return it->value;
}
-RenderTableSection* RenderTableSection::createAnonymousWithParentRenderer(const RenderObject* parent)
+std::unique_ptr<RenderTableSection> RenderTableSection::createTableSectionWithStyle(Document& document, const RenderStyle& style)
{
- auto section = new RenderTableSection(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(parent->style(), TABLE_ROW_GROUP));
+ auto section = std::make_unique<RenderTableSection>(document, RenderStyle::createAnonymousStyleWithDisplay(style, TABLE_ROW_GROUP));
section->initializeStyle();
return section;
}
+std::unique_ptr<RenderTableSection> RenderTableSection::createAnonymousWithParentRenderer(const RenderTable& parent)
+{
+ return RenderTableSection::createTableSectionWithStyle(parent.document(), parent.style());
+}
+
void RenderTableSection::setLogicalPositionForCell(RenderTableCell* cell, unsigned effectiveColumn) const
{
LayoutPoint oldCellLocation = cell->location();
Modified: trunk/Source/WebCore/rendering/RenderTableSection.h (203707 => 203708)
--- trunk/Source/WebCore/rendering/RenderTableSection.h 2016-07-26 02:24:20 UTC (rev 203707)
+++ trunk/Source/WebCore/rendering/RenderTableSection.h 2016-07-26 02:40:04 UTC (rev 203708)
@@ -143,8 +143,8 @@
// FIXME: We may want to introduce a structure holding the in-flux layout information.
LayoutUnit distributeExtraLogicalHeightToRows(LayoutUnit extraLogicalHeight);
- static RenderTableSection* createAnonymousWithParentRenderer(const RenderObject*);
- RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const override { return createAnonymousWithParentRenderer(parent); }
+ static std::unique_ptr<RenderTableSection> createAnonymousWithParentRenderer(const RenderTable&);
+ std::unique_ptr<RenderBox> createAnonymousBoxWithSameTypeAs(const RenderBox&) const override;
void paint(PaintInfo&, const LayoutPoint&) override;
@@ -152,6 +152,8 @@
void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
private:
+ static std::unique_ptr<RenderTableSection> createTableSectionWithStyle(Document&, const RenderStyle&);
+
enum ShouldIncludeAllIntersectingCells {
IncludeAllIntersectingCells,
DoNotIncludeAllIntersectingCells
@@ -331,6 +333,11 @@
return CellSpan(0, m_grid.size());
}
+inline std::unique_ptr<RenderBox> RenderTableSection::createAnonymousBoxWithSameTypeAs(const RenderBox& renderer) const
+{
+ return RenderTableSection::createTableSectionWithStyle(renderer.document(), renderer.style());
+}
+
} // namespace WebCore
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTableSection, isTableSection())