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

Unified Diff: Source/core/rendering/RenderFlowThread.cpp

Issue 775753002: Remove RenderFlowThread::offsetFromLogicalTopOfFirstRegion(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: code review Created 6 years 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/core/rendering/RenderFlowThread.h ('k') | Source/core/rendering/RenderView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderFlowThread.cpp
diff --git a/Source/core/rendering/RenderFlowThread.cpp b/Source/core/rendering/RenderFlowThread.cpp
index 135898888342c96cc059f9e504071659114b317d..e6722af12e76cee2bc858512659672b7c0e57af4 100644
--- a/Source/core/rendering/RenderFlowThread.cpp
+++ b/Source/core/rendering/RenderFlowThread.cpp
@@ -220,107 +220,6 @@ LayoutRect RenderFlowThread::fragmentsBoundingBox(const LayoutRect& layerBoundin
return result;
}
-bool RenderFlowThread::cachedOffsetFromLogicalTopOfFirstRegion(const RenderBox* box, LayoutUnit& result) const
-{
- RenderBoxToOffsetMap::const_iterator offsetIterator = m_boxesToOffsetMap.find(box);
- if (offsetIterator == m_boxesToOffsetMap.end())
- return false;
-
- result = offsetIterator->value;
- return true;
-}
-
-void RenderFlowThread::setOffsetFromLogicalTopOfFirstRegion(const RenderBox* box, LayoutUnit offset)
-{
- m_boxesToOffsetMap.set(box, offset);
-}
-
-void RenderFlowThread::clearOffsetFromLogicalTopOfFirstRegion(const RenderBox* box)
-{
- ASSERT(m_boxesToOffsetMap.contains(box));
- m_boxesToOffsetMap.remove(box);
-}
-
-const RenderBox* RenderFlowThread::currentStatePusherRenderBox() const
-{
- const RenderObject* currentObject = m_statePusherObjectsStack.isEmpty() ? 0 : m_statePusherObjectsStack.last();
- if (currentObject && currentObject->isBox())
- return toRenderBox(currentObject);
-
- return 0;
-}
-
-void RenderFlowThread::pushFlowThreadLayoutState(const RenderObject& object)
-{
- if (const RenderBox* currentBoxDescendant = currentStatePusherRenderBox()) {
- LayoutState* layoutState = currentBoxDescendant->view()->layoutState();
- if (layoutState && layoutState->isPaginated()) {
- ASSERT(layoutState->renderer() == currentBoxDescendant);
- LayoutSize offsetDelta = layoutState->layoutOffset() - layoutState->pageOffset();
- setOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant, currentBoxDescendant->isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width());
- }
- }
-
- ASSERT(!m_statePusherObjectsStack.contains(&object));
- m_statePusherObjectsStack.add(&object);
-}
-
-void RenderFlowThread::popFlowThreadLayoutState()
-{
- m_statePusherObjectsStack.removeLast();
-
- if (const RenderBox* currentBoxDescendant = currentStatePusherRenderBox()) {
- LayoutState* layoutState = currentBoxDescendant->view()->layoutState();
- if (layoutState && layoutState->isPaginated())
- clearOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant);
- }
-}
-
-LayoutUnit RenderFlowThread::offsetFromLogicalTopOfFirstRegion(const RenderBlock* currentBlock) const
-{
- // First check if we cached the offset for the block if it's an ancestor containing block of the box
- // being currently laid out.
- LayoutUnit offset;
- if (cachedOffsetFromLogicalTopOfFirstRegion(currentBlock, offset))
- return offset;
-
- // If it's the current box being laid out, use the layout state.
- const RenderBox* currentBoxDescendant = currentStatePusherRenderBox();
- if (currentBlock == currentBoxDescendant) {
- LayoutState* layoutState = view()->layoutState();
- ASSERT(layoutState->renderer() == currentBlock);
- ASSERT(layoutState && layoutState->isPaginated());
- LayoutSize offsetDelta = layoutState->layoutOffset() - layoutState->pageOffset();
- return currentBoxDescendant->isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width();
- }
-
- // As a last resort, take the slow path.
- LayoutRect blockRect(0, 0, currentBlock->width(), currentBlock->height());
- while (currentBlock && !currentBlock->isRenderFlowThread()) {
- RenderBlock* containerBlock = currentBlock->containingBlock();
- ASSERT(containerBlock);
- if (!containerBlock)
- return 0;
- LayoutPoint currentBlockLocation = currentBlock->location();
-
- if (containerBlock->style()->writingMode() != currentBlock->style()->writingMode()) {
- // We have to put the block rect in container coordinates
- // and we have to take into account both the container and current block flipping modes
- if (containerBlock->style()->isFlippedBlocksWritingMode()) {
- if (containerBlock->isHorizontalWritingMode())
- blockRect.setY(currentBlock->height() - blockRect.maxY());
- else
- blockRect.setX(currentBlock->width() - blockRect.maxX());
- }
- currentBlock->flipForWritingMode(blockRect);
- }
- blockRect.moveBy(currentBlockLocation);
- currentBlock = containerBlock;
- }
-
- return currentBlock->isHorizontalWritingMode() ? blockRect.y() : blockRect.x();
-}
-
void RenderFlowThread::RegionSearchAdapter::collectIfNeeded(const MultiColumnSetInterval& interval)
{
if (m_result)
« no previous file with comments | « Source/core/rendering/RenderFlowThread.h ('k') | Source/core/rendering/RenderView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698