Chromium Code Reviews| Index: Source/core/rendering/RenderBlock.cpp |
| diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp |
| index 388b83a670e0fe316b9e2337f7bbc50495b45559..f26b0173ac338d5796daa7b03007fe10fe99ebf8 100644 |
| --- a/Source/core/rendering/RenderBlock.cpp |
| +++ b/Source/core/rendering/RenderBlock.cpp |
| @@ -3645,22 +3645,18 @@ 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; |
| + if (!layoutState) { |
|
Julien - ping for review
2014/12/04 16:46:19
ASSERT(layoutState) / RELEASE_ASSERT(layoutState)?
mstensho (USE GERRIT)
2014/12/04 18:19:43
Done.
|
| + ASSERT_NOT_REACHED(); |
| + return LayoutUnit(); |
| + } |
| + |
| + 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 |