Skip to content

Commit

Permalink
Bug 1677920 - Remove writing mode argument from CalcAndCacheConsumedB…
Browse files Browse the repository at this point in the history
…Size(). r=TYLin

Always matches the frame's writing-mode.

Differential Revision: https://phabricator.services.mozilla.com/D97390
  • Loading branch information
emilio committed Nov 18, 2020
1 parent 760416d commit d0cf38c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion layout/generic/nsBlockFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ void nsBlockFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,

const ReflowInput* reflowInput = &aReflowInput;
WritingMode wm = aReflowInput.GetWritingMode();
nscoord consumedBSize = CalcAndCacheConsumedBSize(wm);
nscoord consumedBSize = CalcAndCacheConsumedBSize();
nscoord effectiveComputedBSize =
GetEffectiveComputedBSize(aReflowInput, consumedBSize);
Maybe<ReflowInput> mutableReflowInput;
Expand Down
3 changes: 1 addition & 2 deletions layout/generic/nsFlexContainerFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4404,8 +4404,7 @@ void nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
const LogicalSize availableSizeForItems =
ComputeAvailableSizeForItems(aReflowInput, borderPadding);

const nscoord consumedBSize =
CalcAndCacheConsumedBSize(aReflowInput.GetWritingMode());
const nscoord consumedBSize = CalcAndCacheConsumedBSize();
nscoord contentBoxMainSize =
GetMainSizeFromReflowInput(aReflowInput, axisTracker, consumedBSize);
nscoord contentBoxCrossSize;
Expand Down
2 changes: 1 addition & 1 deletion layout/generic/nsGridContainerFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8532,7 +8532,7 @@ void nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
}
}
} else {
consumedBSize = CalcAndCacheConsumedBSize(wm);
consumedBSize = CalcAndCacheConsumedBSize();
gridReflowInput.InitializeForContinuation(this, consumedBSize);
// XXX Technically incorrect: We're ignoring our row sizes, when really
// we should use them but *they* should be computed as if we had no
Expand Down
5 changes: 3 additions & 2 deletions layout/generic/nsSplittableFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,15 @@ void nsSplittableFrame::RemoveFromFlow(nsIFrame* aFrame) {

NS_DECLARE_FRAME_PROPERTY_SMALL_VALUE(ConsumedBSizeProperty, nscoord);

nscoord nsSplittableFrame::CalcAndCacheConsumedBSize(WritingMode aWM) {
nscoord nsSplittableFrame::CalcAndCacheConsumedBSize() {
nsIFrame* prev = GetPrevContinuation();
if (!prev) {
return 0;
}
const auto wm = GetWritingMode();
nscoord bSize = 0;
for (; prev; prev = prev->GetPrevContinuation()) {
bSize += prev->ContentSize(aWM).BSize(aWM);
bSize += prev->ContentSize(wm).BSize(wm);
bool found = false;
nscoord consumed = prev->GetProperty(ConsumedBSizeProperty(), &found);
if (found) {
Expand Down
4 changes: 1 addition & 3 deletions layout/generic/nsSplittableFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ class nsSplittableFrame : public nsIFrame {
*
* This guarantees that the internal cache works, by refreshing it. Calling it
* multiple times in the same reflow is wasteful, but not an error.
*
* @param aWM a writing-mode to determine the block-axis
*/
nscoord CalcAndCacheConsumedBSize(mozilla::WritingMode aWM);
nscoord CalcAndCacheConsumedBSize();

/**
* Retrieve the effective computed block size of this frame, which is the
Expand Down

0 comments on commit d0cf38c

Please sign in to comment.