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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp

Issue 2746013010: Consistent pagination strut propagation policies. (Closed)
Patch Set: Created 3 years, 9 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 | « third_party/WebKit/LayoutTests/fragmentation/block-after-float-first-child-expected.html ('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 4106 matching lines...) Expand 10 before | Expand all | Expand 10 after
4117 return false; 4117 return false;
4118 } 4118 }
4119 const LayoutBlock* containingBlock = this->containingBlock(); 4119 const LayoutBlock* containingBlock = this->containingBlock();
4120 if (!containingBlock || !containingBlock->isLayoutBlockFlow()) 4120 if (!containingBlock || !containingBlock->isLayoutBlockFlow())
4121 return false; 4121 return false;
4122 const LayoutBlockFlow* containingBlockFlow = 4122 const LayoutBlockFlow* containingBlockFlow =
4123 toLayoutBlockFlow(containingBlock); 4123 toLayoutBlockFlow(containingBlock);
4124 // If children are inline, allow the strut. We are probably a float. 4124 // If children are inline, allow the strut. We are probably a float.
4125 if (containingBlockFlow->childrenInline()) 4125 if (containingBlockFlow->childrenInline())
4126 return true; 4126 return true;
4127 // If this isn't the first in-flow object, there's a break opportunity before 4127 for (LayoutBox* sibling = previousSiblingBox(); sibling;
4128 // us, which means that we can allow the strut. 4128 sibling = sibling->previousSiblingBox()) {
4129 if (previousInFlowSiblingBox()) 4129 // What happens on the other side of a spanner is none of our concern, so
4130 return true; 4130 // stop here. Since there's no in-flow box between the previous spanner and
4131 // us, there's no class A break point in front of us. We cannot even
4132 // re-propagate pagination struts to our containing block, since the
4133 // containing block starts in a different column row.
4134 if (sibling->isColumnSpanAll())
4135 return false;
4136 // If this isn't the first in-flow object, there's a break opportunity
4137 // before us, which means that we can allow the strut.
4138 if (!sibling->isFloatingOrOutOfFlowPositioned())
4139 return true;
4140 }
4131 // This is a first in-flow child. We'll still allow the strut if it can be 4141 // This is a first in-flow child. We'll still allow the strut if it can be
4132 // re-propagated to our containing block. 4142 // re-propagated to our containing block.
4133 return containingBlockFlow->allowsPaginationStrut(); 4143 return containingBlockFlow->allowsPaginationStrut();
4134 } 4144 }
4135 4145
4136 void LayoutBlockFlow::setPaginationStrutPropagatedFromChild(LayoutUnit strut) { 4146 void LayoutBlockFlow::setPaginationStrutPropagatedFromChild(LayoutUnit strut) {
4137 strut = std::max(strut, LayoutUnit()); 4147 strut = std::max(strut, LayoutUnit());
4138 if (!m_rareData) { 4148 if (!m_rareData) {
4139 if (!strut) 4149 if (!strut)
4140 return; 4150 return;
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
4605 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); 4615 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState);
4606 } 4616 }
4607 4617
4608 void LayoutBlockFlow::invalidateDisplayItemClients( 4618 void LayoutBlockFlow::invalidateDisplayItemClients(
4609 PaintInvalidationReason invalidationReason) const { 4619 PaintInvalidationReason invalidationReason) const {
4610 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( 4620 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(
4611 invalidationReason); 4621 invalidationReason);
4612 } 4622 }
4613 4623
4614 } // namespace blink 4624 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fragmentation/block-after-float-first-child-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698