mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 1565037 Part 2 - Change aStatus to a reference for ComputeFinalBSize(). r=dholbert
We usually use reference to manipulate nsReflowStatus like in Reflow(). The documentation for aStatus needs edit, and is done in next part. Depends on D37623 Differential Revision: https://phabricator.services.mozilla.com/D37624 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
a051547c37
commit
b0c5d5ce8d
@ -1782,7 +1782,7 @@ void nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput,
|
||||
aReflowInput.mParentReflowInput->AvailableBSize() ==
|
||||
NS_UNCONSTRAINEDSIZE)) {
|
||||
finalSize.BSize(wm) =
|
||||
ComputeFinalBSize(aReflowInput, &aState.mReflowStatus,
|
||||
ComputeFinalBSize(aReflowInput, aState.mReflowStatus,
|
||||
aState.mBCoord + nonCarriedOutBDirMargin,
|
||||
borderPadding, aState.ConsumedBSize());
|
||||
|
||||
@ -7344,7 +7344,7 @@ nsBlockFrame* nsBlockFrame::GetNearestAncestorBlock(nsIFrame* aCandidate) {
|
||||
}
|
||||
|
||||
nscoord nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowInput,
|
||||
nsReflowStatus* aStatus,
|
||||
nsReflowStatus& aStatus,
|
||||
nscoord aContentBSize,
|
||||
const LogicalMargin& aBorderPadding,
|
||||
nscoord aConsumed) {
|
||||
@ -7362,33 +7362,33 @@ nscoord nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowInput,
|
||||
NSCoordSaturatingAdd(aBorderPadding.BStart(wm), computedBSizeLeftOver),
|
||||
aBorderPadding.BEnd(wm));
|
||||
|
||||
if (aStatus->IsIncomplete() && finalBSize <= availBSize) {
|
||||
if (aStatus.IsIncomplete() && finalBSize <= availBSize) {
|
||||
// We used up all of our element's remaining computed block-size on this
|
||||
// page/column, but we're incomplete. Set status to complete except for
|
||||
// overflow.
|
||||
aStatus->SetOverflowIncomplete();
|
||||
aStatus.SetOverflowIncomplete();
|
||||
return finalBSize;
|
||||
}
|
||||
|
||||
if (aStatus->IsComplete()) {
|
||||
if (aStatus.IsComplete()) {
|
||||
if (computedBSizeLeftOver > 0 && NS_UNCONSTRAINEDSIZE != availBSize &&
|
||||
finalBSize > availBSize) {
|
||||
if (ShouldAvoidBreakInside(aReflowInput)) {
|
||||
aStatus->SetInlineLineBreakBeforeAndReset();
|
||||
aStatus.SetInlineLineBreakBeforeAndReset();
|
||||
return finalBSize;
|
||||
}
|
||||
|
||||
// Our leftover block-size does not fit into the available block-size.
|
||||
// Change aStatus to incomplete to let the logic at the end of this method
|
||||
// calculate the correct block-size.
|
||||
aStatus->SetIncomplete();
|
||||
aStatus.SetIncomplete();
|
||||
if (!GetNextInFlow()) {
|
||||
aStatus->SetNextInFlowNeedsReflow();
|
||||
aStatus.SetNextInFlowNeedsReflow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (aStatus->IsIncomplete()) {
|
||||
if (aStatus.IsIncomplete()) {
|
||||
MOZ_ASSERT(finalBSize > availBSize,
|
||||
"We should be overflow incomplete and should've returned "
|
||||
"in early if-branch!");
|
||||
|
@ -311,7 +311,7 @@ class nsBlockFrame : public nsContainerFrame {
|
||||
* @return our final block-size with respect to aReflowInput's writing-mode.
|
||||
*/
|
||||
nscoord ComputeFinalBSize(const ReflowInput& aReflowInput,
|
||||
nsReflowStatus* aStatus, nscoord aContentBSize,
|
||||
nsReflowStatus& aStatus, nscoord aContentBSize,
|
||||
const mozilla::LogicalMargin& aBorderPadding,
|
||||
nscoord aConsumed);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user