mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
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:
parent
ba85e16656
commit
592df41a3f
@ -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);
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user