Collect frames from all block continuations in the buffer for bidi resolution. Bug 408292. r+sr=roc, a=schrep

This commit is contained in:
smontagu@smontagu.org 2007-12-20 02:06:14 -08:00
Родитель 47aa446f9a
Коммит 742f271840
3 изменённых файлов: 9 добавлений и 17 удалений

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

@ -254,7 +254,6 @@ AdvanceLineIteratorToFrame(nsIFrame* aFrame,
*/
nsresult
nsBidiPresUtils::Resolve(nsBlockFrame* aBlockFrame,
nsIFrame* aFirstChild,
PRBool aIsVisualFormControl)
{
mLogicalFrames.Clear();
@ -283,7 +282,11 @@ nsBidiPresUtils::Resolve(nsBlockFrame* aBlockFrame,
mLogicalFrames.AppendElement(directionalFrame);
}
}
InitLogicalArray(aFirstChild);
for (nsBlockFrame* block = aBlockFrame; block;
block = static_cast<nsBlockFrame*>(block->GetNextContinuation())) {
block->RemoveStateBits(NS_BLOCK_NEEDS_BIDI_RESOLUTION);
InitLogicalArray(block->GetFirstChild(nsnull));
}
if (text->mUnicodeBidi == NS_STYLE_UNICODE_BIDI_OVERRIDE) {
nsIFrame* directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kPDF);
@ -481,6 +484,9 @@ PRBool IsBidiLeaf(nsIFrame* aFrame) {
void
nsBidiPresUtils::InitLogicalArray(nsIFrame* aCurrentFrame)
{
if (!aCurrentFrame)
return;
nsIPresShell* shell = aCurrentFrame->PresContext()->PresShell();
nsStyleContext* styleContext;

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

@ -118,7 +118,6 @@ public:
* descendants of a given block frame.
*
* @param aBlockFrame The block frame
* @param aFirstChild The first child frame of aBlockFrame
* @param aIsVisualFormControl [IN] Set if we are in a form control on a
* visual page.
* @see nsBlockFrame::IsVisualFormControl
@ -126,7 +125,6 @@ public:
* @lina 06/18/2000
*/
nsresult Resolve(nsBlockFrame* aBlockFrame,
nsIFrame* aFirstChild,
PRBool aIsVisualFormControl);
/**

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

@ -6742,19 +6742,7 @@ nsBlockFrame::ResolveBidi()
if (!bidiUtils)
return NS_ERROR_NULL_POINTER;
for (nsBlockFrame* curFrame = this; curFrame;
curFrame = static_cast<nsBlockFrame*>(curFrame->GetNextContinuation())) {
curFrame->RemoveStateBits(NS_BLOCK_NEEDS_BIDI_RESOLUTION);
if (!curFrame->mLines.empty()) {
nsresult rv = bidiUtils->Resolve(curFrame,
curFrame->mLines.front()->mFirstChild,
IsVisualFormControl(presContext));
if (NS_FAILED(rv))
return rv;
}
}
return NS_OK;
return bidiUtils->Resolve(this, IsVisualFormControl(presContext));
}
PRBool