Bug 423676 - "weirdness with layout and selection of mixed-direction text" [p=uriber@gmail.com (Uri Bernstein) r=smontagu sr=roc a1.9b5=schrep]

This commit is contained in:
reed@reedloden.com 2008-03-24 00:30:49 -07:00
Родитель ca1b34c2ce
Коммит bbd973d46e
2 изменённых файлов: 15 добавлений и 7 удалений

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

@ -447,16 +447,17 @@ nsBidiPresUtils::Resolve(nsBlockFrame* aBlockFrame,
// IBMBIDI - Egypt - End
if ( (runLength > 0) && (runLength < fragmentLength) ) {
if (!EnsureBidiContinuation(frame, &nextBidi, frameIndex,
contentOffset,
contentOffset + runLength) ) {
break;
}
if (lineNeedsUpdate) {
AdvanceLineIteratorToFrame(frame, &lineIter, prevFrame);
lineNeedsUpdate = PR_FALSE;
}
lineIter.GetLine()->MarkDirty();
if (!EnsureBidiContinuation(frame, &nextBidi, frameIndex,
contentOffset,
contentOffset + runLength,
lineNeedsUpdate)) {
break;
}
frame = nextBidi;
contentOffset += runLength;
} // if (runLength < fragmentLength)
@ -1068,7 +1069,8 @@ nsBidiPresUtils::EnsureBidiContinuation(nsIFrame* aFrame,
nsIFrame** aNewFrame,
PRInt32& aFrameIndex,
PRInt32 aStart,
PRInt32 aEnd)
PRInt32 aEnd,
PRInt32& aLineNeedsUpdate)
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
NS_PRECONDITION(aFrame, "aFrame is null");
@ -1088,6 +1090,9 @@ nsBidiPresUtils::EnsureBidiContinuation(nsIFrame* aFrame,
if (frame->GetPrevContinuation() == aFrame) {
*aNewFrame = frame;
aFrameIndex++;
// The frame we found might be on another line. If so, the line iterator
// should be updated.
aLineNeedsUpdate = PR_TRUE;
}
break;
}

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

@ -370,6 +370,8 @@ private:
* any fluid continuations)
* @param aEnd [IN] the offset of the end of the single-directional
* text run.
* @param aLineNeedsUpdate [OUT] set to true if we're re-using a frame (which
* might be on another line).
*
* If there is already a bidi continuation for this frame in mLogicalFrames,
* no new frame will be created. On exit aNewFrame will point to the existing
@ -389,7 +391,8 @@ private:
nsIFrame** aNewFrame,
PRInt32& aFrameIndex,
PRInt32 aStart,
PRInt32 aEnd);
PRInt32 aEnd,
PRBool& aLineNeedsUpdate);
/**
* Helper method for Resolve()