зеркало из https://github.com/mozilla/pjs.git
Bug 404180. Bidi reordering moves frames around so we can't trust pfd->mBounds in nsLineLayout::RelativePositionFrames. r+sr=dbaron
This commit is contained in:
Родитель
c5c7b201eb
Коммит
789b4eec86
|
@ -4006,6 +4006,8 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
|||
} // bidi enabled
|
||||
#endif // IBMBIDI
|
||||
|
||||
// From here on, pfd->mBounds rectangles are incorrect because bidi
|
||||
// might have moved frames around!
|
||||
nsRect combinedArea;
|
||||
aLineLayout.RelativePositionFrames(combinedArea); // XXXldb This returned width as -15, 2001-06-12, Bugzilla
|
||||
aLine->SetCombinedArea(combinedArea);
|
||||
|
|
|
@ -2612,8 +2612,10 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsRect& aCombinedArea)
|
|||
// -- the bounds of all inline descendants
|
||||
// The former two parts are computed right here, we gather the descendants
|
||||
// below.
|
||||
nsRect adjustedBounds(0, 0, psd->mFrame->mBounds.width,
|
||||
psd->mFrame->mBounds.height);
|
||||
// At this point psd->mFrame->mBounds might be out of date since
|
||||
// bidi reordering can move and resize the frames. So use the frame's
|
||||
// rect instead of mBounds.
|
||||
nsRect adjustedBounds(nsPoint(0, 0), psd->mFrame->mFrame->GetSize());
|
||||
combinedAreaResult.UnionRect(psd->mFrame->mCombinedArea, adjustedBounds);
|
||||
}
|
||||
else {
|
||||
|
@ -2630,16 +2632,16 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsRect& aCombinedArea)
|
|||
}
|
||||
|
||||
for (PerFrameData* pfd = psd->mFirstFrame; pfd; pfd = pfd->mNext) {
|
||||
nsPoint origin = nsPoint(pfd->mBounds.x, pfd->mBounds.y);
|
||||
nsIFrame* frame = pfd->mFrame;
|
||||
nsPoint origin = frame->GetPosition();
|
||||
|
||||
// Adjust the origin of the frame
|
||||
if (pfd->GetFlag(PFD_RELATIVEPOS)) {
|
||||
// right and bottom are handled by
|
||||
// nsHTMLReflowState::ComputeRelativeOffsets
|
||||
nsPoint change(pfd->mOffsets.left, pfd->mOffsets.top);
|
||||
frame->SetPosition(frame->GetPosition() + change);
|
||||
origin += change;
|
||||
frame->SetPosition(origin);
|
||||
}
|
||||
|
||||
// We must position the view correctly before positioning its
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<span style="border-left: 80px solid blue;"></span>א12345
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<span style="border-left: 80px solid blue;">א12345</span>
|
||||
</body>
|
||||
</html>
|
|
@ -495,6 +495,7 @@ random == 403134-1.html 403134-1-ref.html # bug 405377
|
|||
#== 403657-1.html 403657-1-ref.html # Fails depending on the fonts...
|
||||
== 403733-1.html 403733-1-ref.html
|
||||
== 403962-1.xhtml 403962-1-ref.xhtml
|
||||
== 404180-1.html 404180-1-ref.html
|
||||
== 404030-1.html 404030-1-ref.html
|
||||
!= 404030-1-notref.html 404030-1.html
|
||||
!= 404030-1-notref2.html 404030-1.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче