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

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

Issue 16943008: Column balancing support in the region based multicol implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 RenderMultiColumnSet* firstSet = toRenderMultiColumnSet(firstRegion()); 88 RenderMultiColumnSet* firstSet = toRenderMultiColumnSet(firstRegion());
89 if (firstSet) 89 if (firstSet)
90 return; 90 return;
91 91
92 invalidateRegions(); 92 invalidateRegions();
93 93
94 RenderMultiColumnBlock* parentBlock = toRenderMultiColumnBlock(parent()); 94 RenderMultiColumnBlock* parentBlock = toRenderMultiColumnBlock(parent());
95 firstSet = RenderMultiColumnSet::createAnonymous(this); 95 firstSet = RenderMultiColumnSet::createAnonymous(this);
96 firstSet->setStyle(RenderStyle::createAnonymousStyleWithDisplay(parentBlock- >style(), BLOCK)); 96 firstSet->setStyle(RenderStyle::createAnonymousStyleWithDisplay(parentBlock- >style(), BLOCK));
97 parentBlock->RenderBlock::addChild(firstSet); 97 parentBlock->RenderBlock::addChild(firstSet);
98
99 // Even though we aren't placed yet, we can go ahead and set up our size.
100 firstSet->updateLogicalWidth();
101 firstSet->updateLogicalHeight();
102 98
103 firstSet->setRequiresBalancing(parentBlock->requiresBalancing()); 99 // Even though we aren't placed yet, we can go ahead and set up our size. At this point we're
104 100 // typically in the middle of laying out the thread, attempting to paginate, and we need to do
101 // some rudimentary "layout" of the set now, so that pagination will work.
102 firstSet->prepareForLayout();
103
105 validateRegions(); 104 validateRegions();
106 } 105 }
107 106
107 void RenderMultiColumnFlowThread::setPageBreak(LayoutUnit offset, LayoutUnit spa ceShortage)
108 {
109 if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlock Offset(offset)))
110 multicolSet->recordSpaceShortage(spaceShortage);
108 } 111 }
112
113 void RenderMultiColumnFlowThread::updateMinimumPageHeight(LayoutUnit offset, Lay outUnit minHeight)
114 {
115 if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlock Offset(offset)))
116 multicolSet->updateMinimumColumnHeight(minHeight);
117 }
118
119 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderMultiColumnFlowThread.h ('k') | Source/core/rendering/RenderMultiColumnSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698