Collapse trailing whitespace even if there is a placeholder after it. Bug

233451, r+sr=dbaron
This commit is contained in:
bzbarsky%mit.edu 2004-02-09 01:01:06 +00:00
Родитель cd147556bd
Коммит ab4c59230c
4 изменённых файлов: 14 добавлений и 8 удалений

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

@ -1040,6 +1040,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
// the float.
if (frameType) {
if (nsLayoutAtoms::placeholderFrame == frameType) {
pfd->SetFlag(PFD_ISPLACEHOLDERFRAME, PR_TRUE);
nsIFrame* outOfFlowFrame = ((nsPlaceholderFrame*)aFrame)->GetOutOfFlowFrame();
if (outOfFlowFrame) {
// Make sure it's floated and not absolutely positioned
@ -2642,9 +2643,10 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,
return PR_TRUE;
}
}
else if (!pfd->GetFlag(PFD_ISTEXTFRAME)) {
// If we hit a frame on the end that's not text, then there is
// no trailing whitespace to trim. Stop the search.
else if (!pfd->GetFlag(PFD_ISTEXTFRAME) &&
!pfd->GetFlag(PFD_ISPLACEHOLDERFRAME)) {
// If we hit a frame on the end that's not text and not a placeholder,
// then there is no trailing whitespace to trim. Stop the search.
*aDeltaWidth = 0;
return PR_TRUE;
}

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

@ -353,7 +353,8 @@ protected:
#define PFD_ISLETTERFRAME 0x00000010
#define PFD_ISSTICKY 0x00000020
#define PFD_ISBULLET 0x00000040
#define PFD_LASTFLAG PFD_ISBULLET
#define PFD_ISPLACEHOLDERFRAME 0x00000080
#define PFD_LASTFLAG PFD_ISPLACEHOLDERFRAME
PRPackedBool mFlags;

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

@ -1040,6 +1040,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
// the float.
if (frameType) {
if (nsLayoutAtoms::placeholderFrame == frameType) {
pfd->SetFlag(PFD_ISPLACEHOLDERFRAME, PR_TRUE);
nsIFrame* outOfFlowFrame = ((nsPlaceholderFrame*)aFrame)->GetOutOfFlowFrame();
if (outOfFlowFrame) {
// Make sure it's floated and not absolutely positioned
@ -2642,9 +2643,10 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,
return PR_TRUE;
}
}
else if (!pfd->GetFlag(PFD_ISTEXTFRAME)) {
// If we hit a frame on the end that's not text, then there is
// no trailing whitespace to trim. Stop the search.
else if (!pfd->GetFlag(PFD_ISTEXTFRAME) &&
!pfd->GetFlag(PFD_ISPLACEHOLDERFRAME)) {
// If we hit a frame on the end that's not text and not a placeholder,
// then there is no trailing whitespace to trim. Stop the search.
*aDeltaWidth = 0;
return PR_TRUE;
}

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

@ -353,7 +353,8 @@ protected:
#define PFD_ISLETTERFRAME 0x00000010
#define PFD_ISSTICKY 0x00000020
#define PFD_ISBULLET 0x00000040
#define PFD_LASTFLAG PFD_ISBULLET
#define PFD_ISPLACEHOLDERFRAME 0x00000080
#define PFD_LASTFLAG PFD_ISPLACEHOLDERFRAME
PRPackedBool mFlags;