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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/rendering/RenderFlowThread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 3627 matching lines...) Expand 10 before | Expand all | Expand 10 after
3638 { 3638 {
3639 if (RenderFlowThread* flowThread = flowThreadContainingBlock()) 3639 if (RenderFlowThread* flowThread = flowThreadContainingBlock())
3640 flowThread->updateMinimumPageHeight(offsetFromLogicalTopOfFirstPage() + offset, minHeight); 3640 flowThread->updateMinimumPageHeight(offsetFromLogicalTopOfFirstPage() + offset, minHeight);
3641 else if (ColumnInfo* colInfo = view()->layoutState()->columnInfo()) 3641 else if (ColumnInfo* colInfo = view()->layoutState()->columnInfo())
3642 colInfo->updateMinimumColumnHeight(minHeight); 3642 colInfo->updateMinimumColumnHeight(minHeight);
3643 } 3643 }
3644 3644
3645 LayoutUnit RenderBlock::offsetFromLogicalTopOfFirstPage() const 3645 LayoutUnit RenderBlock::offsetFromLogicalTopOfFirstPage() const
3646 { 3646 {
3647 LayoutState* layoutState = view()->layoutState(); 3647 LayoutState* layoutState = view()->layoutState();
3648 if (layoutState && !layoutState->isPaginated()) 3648 RELEASE_ASSERT(layoutState);
3649 return 0; 3649 if (!layoutState->isPaginated())
3650 3650 return LayoutUnit();
3651 RenderFlowThread* flowThread = flowThreadContainingBlock(); 3651 // It would be possible to remove the requirement that this block be the one currently being
3652 if (flowThread) 3652 // laid out, but nobody needs that at the moment.
3653 return flowThread->offsetFromLogicalTopOfFirstRegion(this); 3653 ASSERT(layoutState->renderer() == this);
3654 3654 LayoutSize offsetDelta = layoutState->layoutOffset() - layoutState->pageOffs et();
3655 if (layoutState) { 3655 return isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width( );
3656 ASSERT(layoutState->renderer() == this);
3657
3658 LayoutSize offsetDelta = layoutState->layoutOffset() - layoutState->page Offset();
3659 return isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.wi dth();
3660 }
3661
3662 ASSERT_NOT_REACHED();
3663 return 0;
3664 } 3656 }
3665 3657
3666 LayoutUnit RenderBlock::collapsedMarginBeforeForChild(const RenderBox& child) co nst 3658 LayoutUnit RenderBlock::collapsedMarginBeforeForChild(const RenderBox& child) co nst
3667 { 3659 {
3668 // If the child has the same directionality as we do, then we can just retur n its 3660 // If the child has the same directionality as we do, then we can just retur n its
3669 // collapsed margin. 3661 // collapsed margin.
3670 if (!child.isWritingModeRoot()) 3662 if (!child.isWritingModeRoot())
3671 return child.collapsedMarginBefore(); 3663 return child.collapsedMarginBefore();
3672 3664
3673 // The child has a different directionality. If the child is parallel, then it's just 3665 // The child has a different directionality. If the child is parallel, then it's just
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
3915 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 3907 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
3916 { 3908 {
3917 showRenderObject(); 3909 showRenderObject();
3918 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 3910 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
3919 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 3911 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
3920 } 3912 }
3921 3913
3922 #endif 3914 #endif
3923 3915
3924 } // namespace blink 3916 } // namespace blink
OLDNEW
« 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