Source/WebCore/ChangeLog

112012-04-04 Abhishek Arya <inferno@chromium.org>
22
 3 Virtualize createAnonymousBoxWithSameTypeAs.
 4 https://bugs.webkit.org/show_bug.cgi?id=83229
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 This helps to use the same function to create anonymous
 9 table parts as well.
 10
 11 * rendering/RenderBlock.cpp:
 12 (WebCore::RenderBlock::splitAnonymousBlocksAroundChild):
 13 (WebCore::RenderBlock::createAnonymousBoxWithSameTypeAs):
 14 * rendering/RenderBlock.h:
 15 (RenderBlock):
 16 * rendering/RenderBox.h:
 17 (WebCore::RenderBox::createAnonymousBoxWithSameTypeAs):
 18 (RenderBox):
 19 * rendering/RenderInline.cpp:
 20 (WebCore::RenderInline::splitFlow):
 21 * rendering/RenderTable.h:
 22 (WebCore::RenderTable::createAnonymousBoxWithSameTypeAs):
 23 * rendering/RenderTableCell.h:
 24 (WebCore::RenderTableCell::createAnonymousBoxWithSameTypeAs):
 25 * rendering/RenderTableRow.h:
 26 (WebCore::RenderTableRow::createAnonymousBoxWithSameTypeAs):
 27 * rendering/RenderTableSection.h:
 28 (WebCore::RenderTableSection::createAnonymousBoxWithSameTypeAs):
 29
 302012-04-04 Abhishek Arya <inferno@chromium.org>
 31
332 Add helpers to create anonymous table parts.
433 https://bugs.webkit.org/show_bug.cgi?id=83116
534

Source/WebCore/rendering/RenderBlock.cpp

@@RenderObject* RenderBlock::splitAnonymousBlocksAroundChild(RenderObject* beforeC
715715 RenderBlock* blockToSplit = toRenderBlock(beforeChild->parent());
716716 if (blockToSplit->firstChild() != beforeChild) {
717717 // We have to split the parentBlock into two blocks.
718  RenderBlock* post = createAnonymousBlockWithSameTypeAs(blockToSplit);
 718 RenderBlock* post = toRenderBlock(blockToSplit->createAnonymousBoxWithSameTypeAs(this));
719719 post->setChildrenInline(blockToSplit->childrenInline());
720720 RenderBlock* parentBlock = toRenderBlock(blockToSplit->parent());
721721 parentBlock->children()->insertChildNode(parentBlock, post, blockToSplit->nextSibling());

@@void RenderBlock::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& a
66756675 inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint(additionalOffset + inlineElementContinuation()->containingBlock()->location() - location()));
66766676}
66776677
6678 RenderBlock* RenderBlock::createAnonymousBlockWithSameTypeAs(RenderBlock* otherAnonymousBlock) const
 6678RenderBox* RenderBlock::createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const
66796679{
6680  if (otherAnonymousBlock->isAnonymousColumnsBlock())
6681  return createAnonymousColumnsBlock();
6682  if (otherAnonymousBlock->isAnonymousColumnSpanBlock())
6683  return createAnonymousColumnSpanBlock();
6684  return createAnonymousBlock(otherAnonymousBlock->style()->display());
 6680 if (isAnonymousColumnsBlock())
 6681 return createAnonymousColumnsWithParentRenderer(parent);
 6682 if (isAnonymousColumnSpanBlock())
 6683 return createAnonymousColumnSpanWithParentRenderer(parent);
 6684 return createAnonymousWithParentRendererAndDisplay(parent, style()->display());
66856685}
66866686
66876687bool RenderBlock::hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule pageBoundaryRule) const

Source/WebCore/rendering/RenderBlock.h

@@public:
240240 RenderBlock* createAnonymousColumnsBlock() const { return createAnonymousColumnsWithParentRenderer(this); }
241241 RenderBlock* createAnonymousColumnSpanBlock() const { return createAnonymousColumnSpanWithParentRenderer(this); }
242242
243  RenderBlock* createAnonymousBlockWithSameTypeAs(RenderBlock* otherAnonymousBlock) const;
 243 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const;
244244
245245 static void appendRunsForObject(BidiRunList<BidiRun>&, int start, int end, RenderObject*, InlineBidiResolver&);
246246

Source/WebCore/rendering/RenderBox.h

@@protected:
514514
515515 void paintRootBoxFillLayers(const PaintInfo&);
516516
 517 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject*) const
 518 {
 519 ASSERT_NOT_REACHED();
 520 return 0;
 521 }
 522
517523private:
518524 bool fixedElementLaysOutRelativeToFrame(Frame*, FrameView*) const;
519525

Source/WebCore/rendering/RenderInline.cpp

@@void RenderInline::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox
426426 madeNewBeforeBlock = true;
427427 }
428428
429  RenderBlock* post = block->createAnonymousBlockWithSameTypeAs(pre);
 429 RenderBlock* post = toRenderBlock(pre->createAnonymousBoxWithSameTypeAs(block));
430430
431431 RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
432432 if (madeNewBeforeBlock)

Source/WebCore/rendering/RenderTable.h

@@public:
212212 }
213213
214214 static RenderTable* createAnonymousWithParentRenderer(const RenderObject*);
 215 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const
 216 {
 217 return createAnonymousWithParentRenderer(parent);
 218 }
215219
216220protected:
217221 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);

Source/WebCore/rendering/RenderTableCell.h

@@public:
139139 void setCellWidthChanged(bool b = true) { m_cellWidthChanged = b; }
140140
141141 static RenderTableCell* createAnonymousWithParentRenderer(const RenderObject*);
 142 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const
 143 {
 144 return createAnonymousWithParentRenderer(parent);
 145 }
142146
143147protected:
144148 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);

Source/WebCore/rendering/RenderTableRow.h

@@public:
4343 void paintOutlineForRowIfNeeded(PaintInfo&, const LayoutPoint&);
4444
4545 static RenderTableRow* createAnonymousWithParentRenderer(const RenderObject*);
 46 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const
 47 {
 48 return createAnonymousWithParentRenderer(parent);
 49 }
4650
4751private:
4852 virtual RenderObjectChildList* virtualChildren() { return children(); }

Source/WebCore/rendering/RenderTableSection.h

@@public:
163163 int distributeExtraLogicalHeightToRows(int extraLogicalHeight);
164164
165165 static RenderTableSection* createAnonymousWithParentRenderer(const RenderObject*);
 166 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const
 167 {
 168 return createAnonymousWithParentRenderer(parent);
 169 }
166170
167171protected:
168172 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);