Back out Bug #132561 until we can figure out how to fix the regression it causes in HTML composer with spaces

(See Bug #235223).

a=brendan
This commit is contained in:
scott%scott-macgregor.org 2004-03-02 01:23:13 +00:00
parent e8080a558a
commit 3d4524453c
4 changed files with 14 additions and 24 deletions

View File

@ -1040,7 +1040,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
// the float.
if (frameType) {
if (nsLayoutAtoms::placeholderFrame == frameType) {
pfd->SetFlag(PFD_SKIPWHENTRIMMINGWHITESPACE, PR_TRUE);
pfd->SetFlag(PFD_ISPLACEHOLDERFRAME, PR_TRUE);
nsIFrame* outOfFlowFrame = ((nsPlaceholderFrame*)aFrame)->GetOutOfFlowFrame();
if (outOfFlowFrame) {
// Make sure it's floated and not absolutely positioned
@ -1103,9 +1103,6 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
else if (nsLayoutAtoms::letterFrame==frameType) {
pfd->SetFlag(PFD_ISLETTERFRAME, PR_TRUE);
}
else if (nsLayoutAtoms::brFrame == frameType) {
pfd->SetFlag(PFD_SKIPWHENTRIMMINGWHITESPACE, PR_TRUE);
}
}
mSpaceManager->Translate(-tx, -ty);
@ -2647,10 +2644,9 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,
}
}
else if (!pfd->GetFlag(PFD_ISTEXTFRAME) &&
!pfd->GetFlag(PFD_SKIPWHENTRIMMINGWHITESPACE)) {
// If we hit a frame on the end that we're not supposed to be skipping
// (not text, not a placeholder and not a br frame) then there is no
// trailing whitespace to trim. Stop the search.
!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;
}

View File

@ -353,15 +353,14 @@ protected:
#define PFD_ISLETTERFRAME 0x00000010
#define PFD_ISSTICKY 0x00000020
#define PFD_ISBULLET 0x00000040
#define PFD_SKIPWHENTRIMMINGWHITESPACE 0x00000080
#define PFD_LASTFLAG PFD_SKIPWHENTRIMMINGWHITESPACE
#define PFD_ISPLACEHOLDERFRAME 0x00000080
#define PFD_LASTFLAG PFD_ISPLACEHOLDERFRAME
PRUint8 mFlags;
PRPackedBool mFlags;
void SetFlag(PRUint32 aFlag, PRBool aValue)
{
NS_ASSERTION(aFlag<=PFD_LASTFLAG, "bad flag");
NS_ASSERTION(aFlag<=PR_UINT8_MAX, "bad flag");
NS_ASSERTION(aValue==PR_FALSE || aValue==PR_TRUE, "bad value");
if (aValue) { // set flag
mFlags |= aFlag;

View File

@ -1040,7 +1040,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
// the float.
if (frameType) {
if (nsLayoutAtoms::placeholderFrame == frameType) {
pfd->SetFlag(PFD_SKIPWHENTRIMMINGWHITESPACE, PR_TRUE);
pfd->SetFlag(PFD_ISPLACEHOLDERFRAME, PR_TRUE);
nsIFrame* outOfFlowFrame = ((nsPlaceholderFrame*)aFrame)->GetOutOfFlowFrame();
if (outOfFlowFrame) {
// Make sure it's floated and not absolutely positioned
@ -1103,9 +1103,6 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
else if (nsLayoutAtoms::letterFrame==frameType) {
pfd->SetFlag(PFD_ISLETTERFRAME, PR_TRUE);
}
else if (nsLayoutAtoms::brFrame == frameType) {
pfd->SetFlag(PFD_SKIPWHENTRIMMINGWHITESPACE, PR_TRUE);
}
}
mSpaceManager->Translate(-tx, -ty);
@ -2647,10 +2644,9 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,
}
}
else if (!pfd->GetFlag(PFD_ISTEXTFRAME) &&
!pfd->GetFlag(PFD_SKIPWHENTRIMMINGWHITESPACE)) {
// If we hit a frame on the end that we're not supposed to be skipping
// (not text, not a placeholder and not a br frame) then there is no
// trailing whitespace to trim. Stop the search.
!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;
}

View File

@ -353,15 +353,14 @@ protected:
#define PFD_ISLETTERFRAME 0x00000010
#define PFD_ISSTICKY 0x00000020
#define PFD_ISBULLET 0x00000040
#define PFD_SKIPWHENTRIMMINGWHITESPACE 0x00000080
#define PFD_LASTFLAG PFD_SKIPWHENTRIMMINGWHITESPACE
#define PFD_ISPLACEHOLDERFRAME 0x00000080
#define PFD_LASTFLAG PFD_ISPLACEHOLDERFRAME
PRUint8 mFlags;
PRPackedBool mFlags;
void SetFlag(PRUint32 aFlag, PRBool aValue)
{
NS_ASSERTION(aFlag<=PFD_LASTFLAG, "bad flag");
NS_ASSERTION(aFlag<=PR_UINT8_MAX, "bad flag");
NS_ASSERTION(aValue==PR_FALSE || aValue==PR_TRUE, "bad value");
if (aValue) { // set flag
mFlags |= aFlag;