Bug 1416350 - Part 2: Correct logic for Grid API line numbering with leading implicit tracks. r=mats

MozReview-Commit-ID: 4tiwdqhb5hb

--HG--
extra : rebase_source : 58db5f92938cce5c7a658c2e89c8cde286452ea1
extra : histedit_source : 863399fbebc805b5d9a4718c5d77aefeca43dbdb
This commit is contained in:
Brad Werth 2017-11-10 09:46:22 -08:00
Родитель 7fd0630c3b
Коммит a0fd338be1
1 изменённых файлов: 4 добавлений и 6 удалений

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

@ -129,7 +129,8 @@ GridLines::SetLineInfo(const ComputedGridTrackInfo* aTrackInfo,
}
}
if (i >= aTrackInfo->mRepeatFirstTrack &&
if (i >= (aTrackInfo->mRepeatFirstTrack +
aTrackInfo->mNumLeadingImplicitTracks) &&
repeatIndex < numRepeatTracks) {
numAddedLines += AppendRemovedAutoFits(aTrackInfo,
aLineInfo,
@ -224,11 +225,8 @@ GridLines::AppendRemovedAutoFits(const ComputedGridTrackInfo* aTrackInfo,
RefPtr<GridLine> line = new GridLine(this);
mLines.AppendElement(line);
MOZ_ASSERT(aTrackInfo->mRepeatFirstTrack >=
aTrackInfo->mNumLeadingImplicitTracks,
"We shouldn't have a repeat track within the implicit tracks.");
uint32_t lineNumber = aTrackInfo->mRepeatFirstTrack -
aTrackInfo->mNumLeadingImplicitTracks + aRepeatIndex + 1;
uint32_t lineNumber = aTrackInfo->mRepeatFirstTrack +
aRepeatIndex + 1;
line->SetLineValues(
aLineNames,
nsPresContext::AppUnitsToDoubleCSSPixels(aLastTrackEdge),