diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp index a2b47b87b300..ea0bdc0f69cd 100644 --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -1019,8 +1019,6 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, } else { if (nsGkAtoms::letterFrame==frameType) { pfd->mIsLetterFrame = true; - } else if (nsGkAtoms::rubyFrame == frameType) { - SyncAnnotationBounds(pfd); } if (pfd->mSpan) { isEmpty = !pfd->mSpan->mHasNonemptyContent && pfd->mFrame->IsSelfEmpty(); @@ -1127,6 +1125,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, } if (nsGkAtoms::rubyFrame == frameType) { mHasRuby = true; + SyncAnnotationBounds(pfd); } } @@ -2797,17 +2796,15 @@ nsLineLayout::AdvanceAnnotationInlineBounds(PerFrameData* aPFD, /** * This function applies the changes of icoord and isize caused by * justification to annotations of the given frame. - * aPFD must be one of the frames in aContainingSpan. */ void nsLineLayout::ApplyLineJustificationToAnnotations(PerFrameData* aPFD, - PerSpanData* aContainingSpan, nscoord aDeltaICoord, nscoord aDeltaISize) { PerFrameData* pfd = aPFD->mNextAnnotation; - nscoord containerWidth = ContainerWidthForSpan(aContainingSpan); while (pfd) { + nscoord containerWidth = pfd->mFrame->GetParent()->GetRect().Width(); AdvanceAnnotationInlineBounds(pfd, containerWidth, aDeltaICoord, aDeltaISize); @@ -2876,8 +2873,7 @@ nsLineLayout::ApplyFrameJustification(PerSpanData* aPSD, // The gaps added to the end of the frame should also be // excluded from the isize added to the annotation. - ApplyLineJustificationToAnnotations(pfd, aPSD, - deltaICoord, dw - gapsAtEnd); + ApplyLineJustificationToAnnotations(pfd, deltaICoord, dw - gapsAtEnd); deltaICoord += dw; pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerWidthForSpan(aPSD)); } diff --git a/layout/generic/nsLineLayout.h b/layout/generic/nsLineLayout.h index 667442856fa7..2bfad7f8750e 100644 --- a/layout/generic/nsLineLayout.h +++ b/layout/generic/nsLineLayout.h @@ -686,7 +686,6 @@ protected: nscoord aDeltaISize); void ApplyLineJustificationToAnnotations(PerFrameData* aPFD, - PerSpanData* aContainingSpan, nscoord aDeltaICoord, nscoord aDeltaISize); diff --git a/layout/generic/nsRubyTextContainerFrame.cpp b/layout/generic/nsRubyTextContainerFrame.cpp index 70b340057f0e..3387b1a68807 100644 --- a/layout/generic/nsRubyTextContainerFrame.cpp +++ b/layout/generic/nsRubyTextContainerFrame.cpp @@ -161,7 +161,7 @@ nsRubyTextContainerFrame::Reflow(nsPresContext* aPresContext, LogicalPoint pos = child->GetLogicalPosition(lineWM, containerWidth); pos.B(lineWM) += deltaBCoord; // Relative positioning hasn't happened yet. - // So MovePositionBy should be used here. + // So MovePositionBy should not be used here. child->SetPosition(lineWM, pos, containerWidth); nsContainerFrame::PlaceFrameView(child); }