Issue #2068 - Only wrap the last line of inline elements when positively padding to the right.

This fixes the 21 year old Mozilla bug 122795.

Co-authored-by: Jonathan Kew <jfkthame@gmail.com>
This commit is contained in:
Job Bautista 2022-12-24 17:41:31 +08:00 committed by roytam1
commit ca3361fb57
3 changed files with 18 additions and 7 deletions

View file

@ -580,9 +580,10 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
nscoord availableISize = aReflowInput.AvailableISize();
NS_ASSERTION(availableISize != NS_UNCONSTRAINEDSIZE,
"should no longer use available widths");
// Subtract off inline axis border+padding from availableISize
// Subtract off inline axis border+padding from availableISize;
// we don't subtract the end border+padding as we don't yet know whether
// the end of the element will occur on the same line.
availableISize -= startEdge;
availableISize -= framePadding.IEnd(frameWM);
lineLayout->BeginSpan(this, &aReflowInput, startEdge,
startEdge + availableISize, &mBaseline);