bug 50758 (text-align:right for text control doesn't render as you type)

r=sfraser
a=waterson
We now invalidate the line explicitly if text-align:right is set, because
our incremental painting is biased towards frames that grow to L2R.  This
is a heavy-handed workaround, but it ends up doing very little extra invalidation,
and uses an already existing mechanism by just setting an existing flag.
This commit is contained in:
buster%netscape.com 2000-09-21 06:03:39 +00:00
Родитель 473edcfeca
Коммит 2e35a4b5c5
2 изменённых файлов: 24 добавлений и 0 удалений

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

@ -2725,6 +2725,18 @@ nsLineLayout::HorizontalAlignFrames(nsRect& aLineBounds,
case NS_STYLE_TEXT_ALIGN_RIGHT:
case NS_STYLE_TEXT_ALIGN_MOZ_RIGHT:
{
// fix for bug 50758
// right-aligned text in a text control doesn't know how to paint itself
// so we force the invalidate here. Getting the current line is quick,
// and at worst we're invalidating more of the line (and just that line) than we need to.
nsLineBox *currentLine=nsnull;
// use localResult because a failure here should not be propagated to my caller
nsresult localResult = nsBlockFrame::GetCurrentLine(mBlockRS, &currentLine);
if (NS_SUCCEEDED(localResult) && currentLine) {
currentLine->SetForceInvalidate(PR_TRUE);
}
}
dx = remainingWidth;
break;

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

@ -2725,6 +2725,18 @@ nsLineLayout::HorizontalAlignFrames(nsRect& aLineBounds,
case NS_STYLE_TEXT_ALIGN_RIGHT:
case NS_STYLE_TEXT_ALIGN_MOZ_RIGHT:
{
// fix for bug 50758
// right-aligned text in a text control doesn't know how to paint itself
// so we force the invalidate here. Getting the current line is quick,
// and at worst we're invalidating more of the line (and just that line) than we need to.
nsLineBox *currentLine=nsnull;
// use localResult because a failure here should not be propagated to my caller
nsresult localResult = nsBlockFrame::GetCurrentLine(mBlockRS, &currentLine);
if (NS_SUCCEEDED(localResult) && currentLine) {
currentLine->SetForceInvalidate(PR_TRUE);
}
}
dx = remainingWidth;
break;