Bug 1678098 - Remove redundant writing mode conversion after calling ReflowOutput::Size(). r=mats

As of bug 1671726, ReflowOutput::Size() accepts any writing mode, so we
don't need to do an extra conversion.

Differential Revision: https://phabricator.services.mozilla.com/D97480
This commit is contained in:
Ting-Yu Lin 2020-11-19 00:29:45 +00:00
parent ba85e16656
commit 592df41a3f
6 changed files with 7 additions and 14 deletions

View File

@ -767,7 +767,7 @@ void nsAbsoluteContainingBlock::ReflowAbsoluteFrame(
ReflowOutput kidDesiredSize(kidReflowInput);
aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowInput, aStatus);
const LogicalSize kidSize = kidDesiredSize.Size(wm).ConvertTo(outerWM, wm);
const LogicalSize kidSize = kidDesiredSize.Size(outerWM);
LogicalMargin offsets = kidReflowInput.ComputedLogicalOffsets(outerWM);

View File

@ -1189,9 +1189,7 @@ void nsContainerFrame::FinishReflowChild(
}
nsPoint curOrigin = aKidFrame->GetPosition();
WritingMode outerWM = aDesiredSize.GetWritingMode();
LogicalSize convertedSize =
aDesiredSize.Size(outerWM).ConvertTo(aWM, outerWM);
const LogicalSize convertedSize = aDesiredSize.Size(aWM);
LogicalPoint pos(aPos);
if (aFlags & ReflowChildFlags::ApplyRelativePositioning) {

View File

@ -198,7 +198,7 @@ void nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
mBaseline = kidMetrics.BlockStartAscent();
// Place and size the child and update the output metrics
LogicalSize convertedSize = kidMetrics.Size(lineWM).ConvertTo(wm, lineWM);
LogicalSize convertedSize = kidMetrics.Size(wm);
kid->SetRect(nsRect(bp.IStart(wm), bp.BStart(wm), convertedSize.ISize(wm),
convertedSize.BSize(wm)));
kid->FinishAndStoreOverflow(&kidMetrics, rs.mStyleDisplay);

View File

@ -10431,7 +10431,6 @@ void nsIFrame::BoxReflow(nsBoxLayoutState& aState, nsPresContext* aPresContext,
}
nsReflowStatus status;
WritingMode wm = aDesiredSize.GetWritingMode();
bool needsReflow = IsSubtreeDirty();
@ -10446,7 +10445,7 @@ void nsIFrame::BoxReflow(nsBoxLayoutState& aState, nsPresContext* aPresContext,
needsReflow = false;
aDesiredSize.Width() = aWidth;
aDesiredSize.Height() = aHeight;
SetSize(aDesiredSize.Size(wm).ConvertTo(GetWritingMode(), wm));
SetSize(aDesiredSize.Size(GetWritingMode()));
} else {
aDesiredSize.Width() = metrics->mLastSize.width;
aDesiredSize.Height() = metrics->mLastSize.height;

View File

@ -183,8 +183,7 @@ void nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
WritingMode lineWM = aReflowInput.mLineLayout->GetWritingMode();
LogicalSize availSize(lineWM, aReflowInput.AvailableISize(),
aReflowInput.AvailableBSize());
WritingMode rubyWM = GetWritingMode();
NS_ASSERTION(!rubyWM.IsOrthogonalTo(lineWM),
NS_ASSERTION(!GetWritingMode().IsOrthogonalTo(lineWM),
"Ruby frame writing-mode shouldn't be orthogonal to its line");
AutoRubyTextContainerArray textContainers(aBaseContainer);
@ -297,9 +296,7 @@ void nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
// handled when reflowing the base containers.
NS_ASSERTION(textReflowStatus.IsEmpty(),
"Ruby text container must not break itself inside");
// The metrics is initialized with reflow input of this ruby frame,
// hence the writing-mode is tied to rubyWM instead of rtcWM.
LogicalSize size = textMetrics.Size(rubyWM).ConvertTo(lineWM, rubyWM);
const LogicalSize size = textMetrics.Size(lineWM);
textContainer->SetSize(lineWM, size);
nscoord reservedISize = RubyUtils::GetReservedISize(textContainer);

View File

@ -285,8 +285,7 @@ inline mozilla::LogicalSize nsTableCellFrame::GetDesiredSize() {
}
inline void nsTableCellFrame::SetDesiredSize(const ReflowOutput& aDesiredSize) {
mozilla::WritingMode wm = aDesiredSize.GetWritingMode();
mDesiredSize = aDesiredSize.Size(wm).ConvertTo(GetWritingMode(), wm);
mDesiredSize = aDesiredSize.Size(GetWritingMode());
}
inline bool nsTableCellFrame::GetContentEmpty() const {