Bug 1266645 - Move around a warning to avoid triggering it for valid cases. r=jfkthame

MozReview-Commit-ID: 3qRkNIUeCom

--HG--
extra : source : df5b541e7189cd1bee7dd073f8f8543bd9bb5197
This commit is contained in:
Xidorn Quan 2016-05-18 09:09:25 +10:00
Родитель 2addb968ed
Коммит 6972973d70
1 изменённых файлов: 8 добавлений и 10 удалений

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

@ -1192,21 +1192,19 @@ nsLineLayout::AllowForStartMargin(PerFrameData* pfd,
// Zero this out so that when we compute the max-element-width of
// the frame we will properly avoid adding in the starting margin.
pfd->mMargin.IStart(lineWM) = 0;
} else {
} else if (NS_UNCONSTRAINEDSIZE == aReflowState.ComputedISize()) {
NS_WARN_IF_FALSE(NS_UNCONSTRAINEDSIZE != aReflowState.AvailableISize(),
"have unconstrained inline-size; this should only result "
"from very large sizes, not attempts at intrinsic "
"inline-size calculation");
if (NS_UNCONSTRAINEDSIZE == aReflowState.ComputedISize()) {
// For inline-ish and text-ish things (which don't compute widths
// in the reflow state), adjust available inline-size to account for the
// start margin. The end margin will be accounted for when we
// finish flowing the frame.
// in the reflow state), adjust available inline-size to account
// for the start margin. The end margin will be accounted for when
// we finish flowing the frame.
WritingMode wm = aReflowState.GetWritingMode();
aReflowState.AvailableISize() -=
pfd->mMargin.ConvertTo(wm, lineWM).IStart(wm);
}
}
}
nscoord