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

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

Issue 850703002: [New Multicolumn] Margins incorrectly accounted for before forced breaks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 | « LayoutTests/fast/multicol/margin-bottom-and-break-after-expected.txt ('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 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1747 LayoutUnit RenderBlockFlow::applyAfterBreak(RenderBox& child, LayoutUnit logical Offset, MarginInfo& marginInfo) 1747 LayoutUnit RenderBlockFlow::applyAfterBreak(RenderBox& child, LayoutUnit logical Offset, MarginInfo& marginInfo)
1748 { 1748 {
1749 // FIXME: Add page break checking here when we support printing. 1749 // FIXME: Add page break checking here when we support printing.
1750 RenderFlowThread* flowThread = flowThreadContainingBlock(); 1750 RenderFlowThread* flowThread = flowThreadContainingBlock();
1751 bool isInsideMulticolFlowThread = flowThread; 1751 bool isInsideMulticolFlowThread = flowThread;
1752 bool checkColumnBreaks = isInsideMulticolFlowThread || view()->layoutState() ->isPaginatingColumns(); 1752 bool checkColumnBreaks = isInsideMulticolFlowThread || view()->layoutState() ->isPaginatingColumns();
1753 bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->pageLogi calHeight(); // FIXME: Once columns can print we have to check this. 1753 bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->pageLogi calHeight(); // FIXME: Once columns can print we have to check this.
1754 bool checkAfterAlways = (checkColumnBreaks && child.style()->columnBreakAfte r() == PBALWAYS) 1754 bool checkAfterAlways = (checkColumnBreaks && child.style()->columnBreakAfte r() == PBALWAYS)
1755 || (checkPageBreaks && child.style()->pageBreakAfter() == PBALWAYS); 1755 || (checkPageBreaks && child.style()->pageBreakAfter() == PBALWAYS);
1756 if (checkAfterAlways && inNormalFlow(&child)) { 1756 if (checkAfterAlways && inNormalFlow(&child)) {
1757 LayoutUnit marginOffset = marginInfo.canCollapseWithMarginBefore() ? Lay outUnit() : marginInfo.margin();
1758
1759 // So our margin doesn't participate in the next collapsing steps. 1757 // So our margin doesn't participate in the next collapsing steps.
1760 marginInfo.clearMargin(); 1758 marginInfo.clearMargin();
1761 1759
1762 if (checkColumnBreaks) { 1760 if (checkColumnBreaks) {
1763 if (isInsideMulticolFlowThread) { 1761 if (isInsideMulticolFlowThread) {
1764 LayoutUnit offsetBreakAdjustment = 0; 1762 LayoutUnit offsetBreakAdjustment = 0;
1765 if (flowThread->addForcedRegionBreak(offsetFromLogicalTopOfFirst Page() + logicalOffset + marginOffset, &child, false, &offsetBreakAdjustment)) 1763 if (flowThread->addForcedRegionBreak(offsetFromLogicalTopOfFirst Page() + logicalOffset, &child, false, &offsetBreakAdjustment))
1766 return logicalOffset + marginOffset + offsetBreakAdjustment; 1764 return logicalOffset + offsetBreakAdjustment;
1767 } else { 1765 } else {
1768 view()->layoutState()->addForcedColumnBreak(child, logicalOffset ); 1766 view()->layoutState()->addForcedColumnBreak(child, logicalOffset );
1769 } 1767 }
1770 } 1768 }
1771 return nextPageLogicalTop(logicalOffset, IncludePageBoundary); 1769 return nextPageLogicalTop(logicalOffset, IncludePageBoundary);
1772 } 1770 }
1773 return logicalOffset; 1771 return logicalOffset;
1774 } 1772 }
1775 1773
1776 void RenderBlockFlow::addOverflowFromFloats() 1774 void RenderBlockFlow::addOverflowFromFloats()
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
3121 FrameView* frameView = document().view(); 3119 FrameView* frameView = document().view();
3122 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); 3120 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height();
3123 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); 3121 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( );
3124 if (size().height() < visibleHeight) 3122 if (size().height() < visibleHeight)
3125 top += (visibleHeight - size().height()) / 2; 3123 top += (visibleHeight - size().height()) / 2;
3126 setY(top); 3124 setY(top);
3127 dialog->setCentered(top); 3125 dialog->setCentered(top);
3128 } 3126 }
3129 3127
3130 } // namespace blink 3128 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/margin-bottom-and-break-after-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698