Bug 1751103 - Short-circuit AdvanceToNextTab when tab-size is zero. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D136480
This commit is contained in:
Jonathan Kew 2022-01-20 13:58:14 +00:00
Родитель 1ff25f1ff2
Коммит df50ca26dd
1 изменённых файлов: 2 добавлений и 1 удалений

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

@ -3563,7 +3563,8 @@ static gfxFloat AdvanceToNextTab(gfxFloat aX, gfxFloat aTabWidth,
gfxFloat aMinAdvance) {
// Advance aX to the next multiple of aTabWidth. We must advance
// by at least aMinAdvance.
return ceil((aX + aMinAdvance) / aTabWidth) * aTabWidth;
gfxFloat nextPos = aX + aMinAdvance;
return aTabWidth > 0.0 ? ceil(nextPos / aTabWidth) * aTabWidth : nextPos;
}
void nsTextFrame::PropertyProvider::CalcTabWidths(Range aRange,