Bug 1660122 Part 8 - Rename ComputeAspectRatio() to ComputeIntrinsicRatio(). r=boris

This function doesn't consider aspect-ratio property anymore. Hence the
rename.

Differential Revision: https://phabricator.services.mozilla.com/D91509
This commit is contained in:
Ting-Yu Lin 2020-09-29 22:33:08 +00:00
Родитель 6ef06ff583
Коммит 176272d520
1 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -520,9 +520,9 @@ bool nsImageFrame::UpdateIntrinsicSize() {
return mIntrinsicSize != oldIntrinsicSize;
}
static AspectRatio ComputeAspectRatio(imgIContainer* aImage,
bool aUseMappedRatio,
const nsImageFrame& aFrame) {
static AspectRatio ComputeIntrinsicRatio(imgIContainer* aImage,
bool aUseMappedRatio,
const nsImageFrame& aFrame) {
const ComputedStyle& style = *aFrame.Style();
if (style.StyleDisplay()->IsContainSize()) {
return AspectRatio();
@ -550,7 +550,7 @@ static AspectRatio ComputeAspectRatio(imgIContainer* aImage,
bool nsImageFrame::UpdateIntrinsicRatio() {
AspectRatio oldIntrinsicRatio = mIntrinsicRatio;
mIntrinsicRatio =
ComputeAspectRatio(mImage, ShouldUseMappedAspectRatio(), *this);
ComputeIntrinsicRatio(mImage, ShouldUseMappedAspectRatio(), *this);
return mIntrinsicRatio != oldIntrinsicRatio;
}
@ -1767,7 +1767,8 @@ static bool OldImageHasDifferentRatio(const nsImageFrame& aFrame,
// Same if we had an image.
const bool hasRequest = true;
#ifdef DEBUG
auto currentRatioRecomputed = ComputeAspectRatio(&aImage, hasRequest, aFrame);
auto currentRatioRecomputed =
ComputeIntrinsicRatio(&aImage, hasRequest, aFrame);
// If the image encounters an error after decoding the size (and we run
// UpdateIntrinsicRatio) then the image will return the empty AspectRatio and
// the aspect ratio we compute here will be different from what was computed
@ -1781,7 +1782,7 @@ static bool OldImageHasDifferentRatio(const nsImageFrame& aFrame,
currentRatio == currentRatioRecomputed,
"aspect-ratio got out of sync during paint? How?");
#endif
auto oldRatio = ComputeAspectRatio(aPrevImage, hasRequest, aFrame);
auto oldRatio = ComputeIntrinsicRatio(aPrevImage, hasRequest, aFrame);
return oldRatio != currentRatio;
}