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, nscoord nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowInput,
nsReflowStatus& aStatus, nsReflowStatus& aStatus,
nscoord aContentBSize, nscoord aBEndEdgeOfChildren,
const LogicalMargin& aBorderPadding, const LogicalMargin& aBorderPadding,
nscoord aConsumed) { nscoord aConsumed) {
WritingMode wm = aReflowInput.GetWritingMode(); WritingMode wm = aReflowInput.GetWritingMode();
@ -7394,11 +7394,11 @@ nscoord nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowInput,
"We should be overflow-incomplete and should've returned " "We should be overflow-incomplete and should've returned "
"in early if-branch!"); "in early if-branch!");
// Use the current block-size; continuations will take up the rest. // Use the current block-end edge of our children as our block-size;
// Do extend the block-size to at least consume the available block-size, // continuations will take up the rest. Do extend the block-size to at least
// otherwise our left/right borders (for example) won't extend all the way // consume the available block-size, otherwise our left/right borders (for
// to the break. // example) won't extend all the way to the break.
finalBSize = std::max(availBSize, aContentBSize); finalBSize = std::max(availBSize, aBEndEdgeOfChildren);
// ... but don't take up more block size than is available // ... but don't take up more block size than is available
finalBSize = finalBSize =
std::min(finalBSize, aBorderPadding.BStart(wm) + computedBSizeLeftOver); 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 * This function will then adjust aStatus before returning, if our
* status is different in light of our actual final block-size and * status is different in light of our actual final block-size and
* current page/column's available block-size. * current page/column's available block-size.
* @param aContentBSize The block-size of content, precomputed outside of this * @param aBEndEdgeOfChildren The distance between this frame's block-start
* function. The final block-size that is used in aMetrics will be set * border-edge and the block-end edge of our last child's border-box.
* to either this or the available block-size, whichever is larger, in * This is effectively our block-start border-padding plus the
* the case where our available block-size is constrained, and we * block-size of our children, precomputed outside of this function.
* overflow that available block-size.
* @param aBorderPadding The margins representing the border padding for block * @param aBorderPadding The margins representing the border padding for block
* frames. Can be 0. * frames. Can be 0.
* @param aConsumed The block-size already consumed by our previous-in-flows. * @param aConsumed The block-size already consumed by our previous-in-flows.
* @return our final block-size with respect to aReflowInput's writing-mode. * @return our final block-size with respect to aReflowInput's writing-mode.
*/ */
nscoord ComputeFinalBSize(const ReflowInput& aReflowInput, nscoord ComputeFinalBSize(const ReflowInput& aReflowInput,
nsReflowStatus& aStatus, nscoord aContentBSize, nsReflowStatus& aStatus,
nscoord aBEndEdgeOfChildren,
const mozilla::LogicalMargin& aBorderPadding, const mozilla::LogicalMargin& aBorderPadding,
nscoord aConsumed); nscoord aConsumed);