Index: Source/core/rendering/LayoutState.cpp |
diff --git a/Source/core/rendering/LayoutState.cpp b/Source/core/rendering/LayoutState.cpp |
index a9c6fcf1c93a44cec4cf4b0a4a5057f9899682a4..b877cf3971cc032cbc873aac52f2dd9fabe6f26f 100644 |
--- a/Source/core/rendering/LayoutState.cpp |
+++ b/Source/core/rendering/LayoutState.cpp |
@@ -33,9 +33,8 @@ |
namespace WebCore { |
-LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged, ColumnInfo* columnInfo) |
- : m_columnInfo(columnInfo) |
- , m_lineGrid(0) |
+LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged) |
+ : m_lineGrid(0) |
, m_next(prev) |
, m_shapeInsideInfo(0) |
#ifndef NDEBUG |
@@ -84,7 +83,7 @@ LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const LayoutSiz |
// If we establish a new page height, then cache the offset to the top of the first page. |
// We can compare this later on to figure out what part of the page we're actually on, |
- if (pageLogicalHeight || m_columnInfo || renderer->isRenderFlowThread()) { |
+ if (pageLogicalHeight || renderer->isRenderFlowThread()) { |
m_pageLogicalHeight = pageLogicalHeight; |
bool isFlipped = renderer->style()->isFlippedBlocksWritingMode(); |
m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? renderer->borderLeft() + renderer->paddingLeft() : renderer->borderRight() + renderer->paddingRight()), |
@@ -105,9 +104,6 @@ LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const LayoutSiz |
// Propagate line grid information. |
propagateLineGridInfo(renderer); |
- if (!m_columnInfo) |
- m_columnInfo = m_next->m_columnInfo; |
- |
if (renderer->isRenderBlock()) { |
const RenderBlock* renderBlock = toRenderBlock(renderer); |
m_shapeInsideInfo = renderBlock->shapeInsideInfo(); |
@@ -123,10 +119,7 @@ LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const LayoutSiz |
#endif |
} |
- m_isPaginated = m_pageLogicalHeight || m_columnInfo || renderer->isRenderFlowThread(); |
- |
- if (lineGrid() && renderer->hasColumns() && renderer->style()->hasInlineColumnAxis()) |
- computeLineGridPaginationOrigin(renderer); |
+ m_isPaginated = m_pageLogicalHeight || renderer->isRenderFlowThread(); |
// If we have a new grid to track, then add it to our set. |
if (renderer->style()->lineGrid() != RenderStyle::initialLineGrid() && renderer->isRenderBlockFlow()) |
@@ -143,7 +136,6 @@ LayoutState::LayoutState(RenderObject* root) |
, m_layoutDeltaXSaturated(false) |
, m_layoutDeltaYSaturated(false) |
#endif |
- , m_columnInfo(0) |
, m_lineGrid(0) |
, m_next(0) |
, m_shapeInsideInfo(0) |
@@ -174,13 +166,6 @@ void LayoutState::operator delete(void* ptr) |
partitionFree(ptr); |
} |
-void LayoutState::clearPaginationInformation() |
-{ |
- m_pageLogicalHeight = m_next->m_pageLogicalHeight; |
- m_pageOffset = m_next->m_pageOffset; |
- m_columnInfo = m_next->m_columnInfo; |
-} |
- |
LayoutUnit LayoutState::pageLogicalOffset(RenderBox* child, LayoutUnit childLogicalOffset) const |
{ |
if (child->isHorizontalWritingMode()) |
@@ -188,13 +173,6 @@ LayoutUnit LayoutState::pageLogicalOffset(RenderBox* child, LayoutUnit childLogi |
return m_layoutOffset.width() + childLogicalOffset - m_pageOffset.width(); |
} |
-void LayoutState::addForcedColumnBreak(RenderBox* child, LayoutUnit childLogicalOffset) |
-{ |
- if (!m_columnInfo || m_columnInfo->columnHeight()) |
- return; |
- m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); |
-} |
- |
void LayoutState::propagateLineGridInfo(RenderBox* renderer) |
{ |
// Disable line grids for objects we don't support. For now this includes overflow:scroll/auto, inline blocks and |
@@ -233,46 +211,4 @@ void LayoutState::establishLineGrid(RenderBlockFlow* block) |
m_lineGridOffset = m_layoutOffset; |
} |
-void LayoutState::computeLineGridPaginationOrigin(RenderBox* renderer) |
-{ |
- // We need to cache a line grid pagination origin so that we understand how to reset the line grid |
- // at the top of each column. |
- // Get the current line grid and offset. |
- if (!lineGrid() || lineGrid()->style()->writingMode() != renderer->style()->writingMode()) |
- return; |
- |
- // Get the hypothetical line box used to establish the grid. |
- RootInlineBox* lineGridBox = lineGrid()->lineGridBox(); |
- if (!lineGridBox) |
- return; |
- |
- bool isHorizontalWritingMode = lineGrid()->isHorizontalWritingMode(); |
- |
- LayoutUnit lineGridBlockOffset = isHorizontalWritingMode ? lineGridOffset().height() : lineGridOffset().width(); |
- |
- // Now determine our position on the grid. Our baseline needs to be adjusted to the nearest baseline multiple |
- // as established by the line box. |
- // FIXME: Need to handle crazy line-box-contain values that cause the root line box to not be considered. I assume |
- // the grid should honor line-box-contain. |
- LayoutUnit gridLineHeight = lineGridBox->lineBottomWithLeading() - lineGridBox->lineTopWithLeading(); |
- if (!gridLineHeight) |
- return; |
- |
- LayoutUnit firstLineTopWithLeading = lineGridBlockOffset + lineGridBox->lineTopWithLeading(); |
- |
- if (isPaginated() && pageLogicalHeight()) { |
- LayoutUnit pageLogicalTop = renderer->isHorizontalWritingMode() ? m_pageOffset.height() : m_pageOffset.width(); |
- if (pageLogicalTop > firstLineTopWithLeading) { |
- // Shift to the next highest line grid multiple past the page logical top. Cache the delta |
- // between this new value and the page logical top as the pagination origin. |
- LayoutUnit remainder = roundToInt(pageLogicalTop - firstLineTopWithLeading) % roundToInt(gridLineHeight); |
- LayoutUnit paginationDelta = gridLineHeight - remainder; |
- if (isHorizontalWritingMode) |
- m_lineGridPaginationOrigin.setHeight(paginationDelta); |
- else |
- m_lineGridPaginationOrigin.setWidth(paginationDelta); |
- } |
- } |
-} |
- |
} // namespace WebCore |