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

Unified Diff: Source/core/rendering/RenderBlock.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 | « no previous file | Source/core/rendering/RenderFlowThread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlock.cpp
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index 388b83a670e0fe316b9e2337f7bbc50495b45559..7293b6b0f35cd6c5ff961b948dbba0d4a0ed0f4b 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -3645,22 +3645,14 @@ void RenderBlock::updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeigh
LayoutUnit RenderBlock::offsetFromLogicalTopOfFirstPage() const
{
LayoutState* layoutState = view()->layoutState();
- if (layoutState && !layoutState->isPaginated())
- return 0;
-
- RenderFlowThread* flowThread = flowThreadContainingBlock();
- if (flowThread)
- return flowThread->offsetFromLogicalTopOfFirstRegion(this);
-
- if (layoutState) {
- ASSERT(layoutState->renderer() == this);
-
- LayoutSize offsetDelta = layoutState->layoutOffset() - layoutState->pageOffset();
- return isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width();
- }
-
- ASSERT_NOT_REACHED();
- return 0;
+ RELEASE_ASSERT(layoutState);
+ if (!layoutState->isPaginated())
+ return LayoutUnit();
+ // It would be possible to remove the requirement that this block be the one currently being
+ // laid out, but nobody needs that at the moment.
+ ASSERT(layoutState->renderer() == this);
+ LayoutSize offsetDelta = layoutState->layoutOffset() - layoutState->pageOffset();
+ return isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width();
}
LayoutUnit RenderBlock::collapsedMarginBeforeForChild(const RenderBox& child) const
« no previous file with comments | « no previous file | Source/core/rendering/RenderFlowThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698