Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: Source/WebCore/rendering/RenderBlock.cpp

Issue 10264007: Merge 113252 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderBlock.h ('k') | Source/WebCore/rendering/RenderButton.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderBlock.cpp
===================================================================
--- Source/WebCore/rendering/RenderBlock.cpp (revision 115614)
+++ Source/WebCore/rendering/RenderBlock.cpp (working copy)
@@ -756,7 +756,7 @@
// Create an anonymous table container next to our table container.
RenderBlock* parentBlock = toRenderBlock(table->parent());
- RenderTable* postTable = parentBlock->createAnonymousTable();
+ RenderTable* postTable = RenderTable::createAnonymousWithParentRenderer(parentBlock);
parentBlock->children()->insertChildNode(parentBlock, postTable, table->nextSibling());
// Move all the children from beforeChild to the newly created anonymous table container.
@@ -6644,54 +6644,15 @@
inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint(additionalOffset + inlineElementContinuation()->containingBlock()->location() - location()));
}
-RenderBlock* RenderBlock::createAnonymousBlock(bool isFlexibleBox) const
-{
- RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
-
- RenderBlock* newBox = 0;
- if (isFlexibleBox) {
- newStyle->setDisplay(BOX);
- newBox = new (renderArena()) RenderDeprecatedFlexibleBox(document() /* anonymous box */);
- } else {
- newStyle->setDisplay(BLOCK);
- newBox = new (renderArena()) RenderBlock(document() /* anonymous box */);
- }
-
- newBox->setStyle(newStyle.release());
- return newBox;
-}
-
RenderBlock* RenderBlock::createAnonymousBlockWithSameTypeAs(RenderBlock* otherAnonymousBlock) const
{
if (otherAnonymousBlock->isAnonymousColumnsBlock())
return createAnonymousColumnsBlock();
if (otherAnonymousBlock->isAnonymousColumnSpanBlock())
return createAnonymousColumnSpanBlock();
- return createAnonymousBlock(otherAnonymousBlock->style()->display() == BOX);
+ return createAnonymousBlock(otherAnonymousBlock->style()->display());
}
-RenderBlock* RenderBlock::createAnonymousColumnsBlock() const
-{
- RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
- newStyle->inheritColumnPropertiesFrom(style());
- newStyle->setDisplay(BLOCK);
-
- RenderBlock* newBox = new (renderArena()) RenderBlock(document() /* anonymous box */);
- newBox->setStyle(newStyle.release());
- return newBox;
-}
-
-RenderBlock* RenderBlock::createAnonymousColumnSpanBlock() const
-{
- RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
- newStyle->setColumnSpan(ColumnSpanAll);
- newStyle->setDisplay(BLOCK);
-
- RenderBlock* newBox = new (renderArena()) RenderBlock(document() /* anonymous box */);
- newBox->setStyle(newStyle.release());
- return newBox;
-}
-
bool RenderBlock::hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule pageBoundaryRule) const
{
ASSERT(view()->layoutState() && view()->layoutState()->isPaginated());
@@ -7422,6 +7383,47 @@
return constructTextRun(context, font, string.characters(), string.length(), style, expansion, flags);
}
+RenderBlock* RenderBlock::createAnonymousWithParentRendererAndDisplay(const RenderObject* parent, EDisplay display)
+{
+ RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style());
+
+ // FIXME: Do we need to cover the new flex box here ?
+ // FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ?
+ RenderBlock* newBox = 0;
+ if (display == BOX || display == INLINE_BOX) {
+ newStyle->setDisplay(BOX);
+ newBox = new (parent->renderArena()) RenderDeprecatedFlexibleBox(parent->document() /* anonymous box */);
+ } else {
+ newStyle->setDisplay(BLOCK);
+ newBox = new (parent->renderArena()) RenderBlock(parent->document() /* anonymous box */);
+ }
+
+ newBox->setStyle(newStyle.release());
+ return newBox;
+}
+
+RenderBlock* RenderBlock::createAnonymousColumnsWithParentRenderer(const RenderObject* parent)
+{
+ RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style());
+ newStyle->inheritColumnPropertiesFrom(parent->style());
+ newStyle->setDisplay(BLOCK);
+
+ RenderBlock* newBox = new (parent->renderArena()) RenderBlock(parent->document() /* anonymous box */);
+ newBox->setStyle(newStyle.release());
+ return newBox;
+}
+
+RenderBlock* RenderBlock::createAnonymousColumnSpanWithParentRenderer(const RenderObject* parent)
+{
+ RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(parent->style());
+ newStyle->setColumnSpan(ColumnSpanAll);
+ newStyle->setDisplay(BLOCK);
+
+ RenderBlock* newBox = new (parent->renderArena()) RenderBlock(parent->document() /* anonymous box */);
+ newBox->setStyle(newStyle.release());
+ return newBox;
+}
+
#ifndef NDEBUG
void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* markedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const RenderObject* obj) const
« no previous file with comments | « Source/WebCore/rendering/RenderBlock.h ('k') | Source/WebCore/rendering/RenderButton.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698