Bug 1452080: Remove ComputedStyle::PresContext usage from layout and canvas code. r=xidorn

Couldn't find an easy way of splitting these up :(

MozReview-Commit-ID: 2kTZ5McREUT
This commit is contained in:
Emilio Cobos Álvarez
2018-04-06 14:52:12 +02:00
parent 19d1b6d206
commit 65978b31f3
20 changed files with 154 additions and 92 deletions

View File

@@ -1662,8 +1662,10 @@ nsLineLayout::PlaceTopBottomFrames(PerSpanData* psd,
static nscoord
GetBSizeOfEmphasisMarks(nsIFrame* aSpanFrame, float aInflation)
{
RefPtr<nsFontMetrics> fm = nsLayoutUtils::
GetFontMetricsOfEmphasisMarks(aSpanFrame->Style(), aInflation);
RefPtr<nsFontMetrics> fm =
nsLayoutUtils::GetFontMetricsOfEmphasisMarks(aSpanFrame->Style(),
aSpanFrame->PresContext(),
aInflation);
return fm->MaxHeight();
}
@@ -1884,10 +1886,12 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
// compute the top leading.
float inflation =
GetInflationForBlockDirAlignment(spanFrame, mInflationMinFontSize);
nscoord logicalBSize = ReflowInput::
CalcLineHeight(spanFrame->GetContent(), spanFrame->Style(),
mBlockReflowInput->ComputedHeight(),
inflation);
nscoord logicalBSize =
ReflowInput::CalcLineHeight(spanFrame->GetContent(),
spanFrame->Style(),
spanFrame->PresContext(),
mBlockReflowInput->ComputedHeight(),
inflation);
nscoord contentBSize = spanFramePFD->mBounds.BSize(lineWM) -
spanFramePFD->mBorderPadding.BStartEnd(lineWM);
@@ -2173,8 +2177,11 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
// of the elements line block size value.
float inflation =
GetInflationForBlockDirAlignment(frame, mInflationMinFontSize);
pctBasis = ReflowInput::CalcLineHeight(frame->GetContent(),
frame->Style(), mBlockReflowInput->ComputedBSize(),
pctBasis = ReflowInput::CalcLineHeight(
frame->GetContent(),
frame->Style(),
frame->PresContext(),
mBlockReflowInput->ComputedBSize(),
inflation);
}
nscoord offset = verticalAlign.ComputeCoordPercentCalc(pctBasis);