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

Side by Side Diff: Source/core/rendering/RenderBlockFlow.cpp

Issue 138913007: Move RenderBlock::checkForPaginationLogicalHeightChange method to proper parent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months 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 | « Source/core/rendering/RenderBlockFlow.h ('k') | no next file » | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 { 180 {
181 if (lineGridBox()) 181 if (lineGridBox())
182 lineGridBox()->destroy(); 182 lineGridBox()->destroy();
183 183
184 if (renderNamedFlowFragment()) 184 if (renderNamedFlowFragment())
185 setRenderNamedFlowFragment(0); 185 setRenderNamedFlowFragment(0);
186 186
187 RenderBlock::willBeDestroyed(); 187 RenderBlock::willBeDestroyed();
188 } 188 }
189 189
190 void RenderBlockFlow::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogi calHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight)
191 {
192 ColumnInfo* colInfo = columnInfo();
193 if (hasColumns()) {
194 if (!pageLogicalHeight) {
195 LayoutUnit oldLogicalHeight = logicalHeight();
196 setLogicalHeight(0);
197 // We need to go ahead and set our explicit page height if one exist s, so that we can
198 // avoid doing two layout passes.
199 updateLogicalHeight();
200 LayoutUnit columnHeight = contentLogicalHeight();
201 if (columnHeight > 0) {
202 pageLogicalHeight = columnHeight;
203 hasSpecifiedPageLogicalHeight = true;
204 }
205 setLogicalHeight(oldLogicalHeight);
206 }
207 if (colInfo->columnHeight() != pageLogicalHeight && everHadLayout()) {
208 colInfo->setColumnHeight(pageLogicalHeight);
209 pageLogicalHeightChanged = true;
210 }
211
212 if (!hasSpecifiedPageLogicalHeight && !pageLogicalHeight)
213 colInfo->clearForcedBreaks();
214
215 colInfo->setPaginationUnit(paginationUnit());
216 } else if (isRenderFlowThread()) {
217 pageLogicalHeight = 1; // This is just a hack to always make sure we hav e a page logical height.
218 pageLogicalHeightChanged = toRenderFlowThread(this)->pageLogicalSizeChan ged();
219 }
220 }
221
190 bool RenderBlockFlow::relayoutForPagination(bool hasSpecifiedPageLogicalHeight, LayoutUnit pageLogicalHeight, LayoutStateMaintainer& statePusher) 222 bool RenderBlockFlow::relayoutForPagination(bool hasSpecifiedPageLogicalHeight, LayoutUnit pageLogicalHeight, LayoutStateMaintainer& statePusher)
191 { 223 {
192 if (!hasColumns()) 224 if (!hasColumns())
193 return false; 225 return false;
194 226
195 OwnPtr<RenderOverflow> savedOverflow = m_overflow.release(); 227 OwnPtr<RenderOverflow> savedOverflow = m_overflow.release();
196 if (childrenInline()) 228 if (childrenInline())
197 addOverflowFromInlineChildren(); 229 addOverflowFromInlineChildren();
198 else 230 else
199 addOverflowFromBlockChildren(); 231 addOverflowFromBlockChildren();
(...skipping 2622 matching lines...) Expand 10 before | Expand all | Expand 10 after
2822 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() 2854 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData()
2823 { 2855 {
2824 if (m_rareData) 2856 if (m_rareData)
2825 return *m_rareData; 2857 return *m_rareData;
2826 2858
2827 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); 2859 m_rareData = adoptPtr(new RenderBlockFlowRareData(this));
2828 return *m_rareData; 2860 return *m_rareData;
2829 } 2861 }
2830 2862
2831 } // namespace WebCore 2863 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698