Bug 1565037 Part 4 - Rename aContentBSize to aBEndEdgeOfChildren. r=dholbert

As described in https://bugzilla.mozilla.org/show_bug.cgi?id=1562122#c5,
this precomputed argument is not our children's block-size, but is the
block-end edge of children because aState.mBCoord is initialized as our
border-padding block-start in BlockReflowInput's constructor.

I also delete the sentence "The final block-size that is used in
aMetrics will be set ..." because this is the implementation details of
this function, and is likely to become inaccurate after considering the
block split by column-span.

Depends on D37625

Differential Revision: https://phabricator.services.mozilla.com/D37626

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2019-07-11 18:43:35 +00:00
Родитель 271347c543
Коммит 1d40e7045d
2 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -7345,7 +7345,7 @@ nsBlockFrame* nsBlockFrame::GetNearestAncestorBlock(nsIFrame* aCandidate) {
nscoord nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowInput,
nsReflowStatus& aStatus,
nscoord aContentBSize,
nscoord aBEndEdgeOfChildren,
const LogicalMargin& aBorderPadding,
nscoord aConsumed) {
WritingMode wm = aReflowInput.GetWritingMode();
@ -7394,11 +7394,11 @@ nscoord nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowInput,
"We should be overflow-incomplete and should've returned "
"in early if-branch!");
// Use the current block-size; continuations will take up the rest.
// Do extend the block-size to at least consume the available block-size,
// otherwise our left/right borders (for example) won't extend all the way
// to the break.
finalBSize = std::max(availBSize, aContentBSize);
// Use the current block-end edge of our children as our block-size;
// continuations will take up the rest. Do extend the block-size to at least
// consume the available block-size, otherwise our left/right borders (for
// example) won't extend all the way to the break.
finalBSize = std::max(availBSize, aBEndEdgeOfChildren);
// ... but don't take up more block size than is available
finalBSize =
std::min(finalBSize, aBorderPadding.BStart(wm) + computedBSizeLeftOver);

Просмотреть файл

@ -303,18 +303,18 @@ class nsBlockFrame : public nsContainerFrame {
* This function will then adjust aStatus before returning, if our
* status is different in light of our actual final block-size and
* current page/column's available block-size.
* @param aContentBSize The block-size of content, precomputed outside of this
* function. The final block-size that is used in aMetrics will be set
* to either this or the available block-size, whichever is larger, in
* the case where our available block-size is constrained, and we
* overflow that available block-size.
* @param aBEndEdgeOfChildren The distance between this frame's block-start
* border-edge and the block-end edge of our last child's border-box.
* This is effectively our block-start border-padding plus the
* block-size of our children, precomputed outside of this function.
* @param aBorderPadding The margins representing the border padding for block
* frames. Can be 0.
* @param aConsumed The block-size already consumed by our previous-in-flows.
* @return our final block-size with respect to aReflowInput's writing-mode.
*/
nscoord ComputeFinalBSize(const ReflowInput& aReflowInput,
nsReflowStatus& aStatus, nscoord aContentBSize,
nsReflowStatus& aStatus,
nscoord aBEndEdgeOfChildren,
const mozilla::LogicalMargin& aBorderPadding,
nscoord aConsumed);