Bug 1419924 Part 1: Capture FlexLine cross start position to report to devtools when requested. r=dholbert

MozReview-Commit-ID: 8opVdr4W9S3

--HG--
extra : rebase_source : 45edd3a73fa4fd56e5e0557ca3ea5ba86cc5f7a6
This commit is contained in:
Brad Werth 2017-12-01 13:02:35 -08:00
Родитель 15f8898e50
Коммит dfee74ad04
2 изменённых файлов: 16 добавлений и 7 удалений

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

@ -4498,13 +4498,21 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
ConvertLegacyStyleToJustifyContent(StyleXUL()) :
aReflowInput.mStylePosition->mJustifyContent;
for (FlexLine* line = lines.getFirst(); line; line = line->getNext()) {
lineIndex = 0;
for (FlexLine* line = lines.getFirst(); line; line = line->getNext(),
++lineIndex) {
// Main-Axis Alignment - Flexbox spec section 9.5
// ==============================================
line->PositionItemsInMainAxis(justifyContent,
aContentBoxMainSize,
aAxisTracker);
// See if we need to extract some computed info for this line.
if (MOZ_UNLIKELY(containerInfo)) {
ComputedFlexLineInfo& lineInfo = containerInfo->mLines[lineIndex];
lineInfo.mCrossStart = crossAxisPosnTracker.GetPosition();
}
// Cross-Axis Alignment - Flexbox spec section 9.6
// ===============================================
line->PositionItemsInCrossAxis(crossAxisPosnTracker.GetPosition(),
@ -4716,15 +4724,15 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize)
// Finally update our line sizing values in our containerInfo.
if (containerInfo) {
uint32_t lineIndex = 0;
if (MOZ_UNLIKELY(containerInfo)) {
lineIndex = 0;
for (const FlexLine* line = lines.getFirst(); line;
line = line->getNext(), ++lineIndex) {
ComputedFlexLineInfo* lineInfo = &containerInfo->mLines[lineIndex];
ComputedFlexLineInfo& lineInfo = containerInfo->mLines[lineIndex];
lineInfo->mCrossSize = line->GetLineCrossSize();
lineInfo->mFirstBaselineOffset = line->GetFirstBaselineOffset();
lineInfo->mLastBaselineOffset = line->GetLastBaselineOffset();
lineInfo.mCrossSize = line->GetLineCrossSize();
lineInfo.mFirstBaselineOffset = line->GetFirstBaselineOffset();
lineInfo.mLastBaselineOffset = line->GetLastBaselineOffset();
}
}
}

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

@ -54,6 +54,7 @@ struct ComputedFlexItemInfo
struct ComputedFlexLineInfo
{
nsTArray<ComputedFlexItemInfo> mItems;
nscoord mCrossStart;
nscoord mCrossSize;
nscoord mFirstBaselineOffset;
nscoord mLastBaselineOffset;