Remove LL_TEXTSTARTSWITHNBSP, since it's a partial and broken solution to the problem, and it's in the wrong place. b=187899 r+sr=roc
git-svn-id: svn://10.0.0.236/trunk@147413 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -262,7 +262,6 @@ nsLineLayout::BeginLineReflow(nscoord aX, nscoord aY,
|
||||
|
||||
SetFlag(LL_ENDSINWHITESPACE, PR_TRUE);
|
||||
SetFlag(LL_UNDERSTANDSNWHITESPACE, PR_FALSE);
|
||||
SetFlag(LL_TEXTSTARTSWITHNBSP, PR_FALSE);
|
||||
SetFlag(LL_FIRSTLETTERSTYLEOK, PR_FALSE);
|
||||
SetFlag(LL_ISTOPOFPAGE, aIsTopOfPage);
|
||||
SetFlag(LL_UPDATEDBAND, PR_FALSE);
|
||||
@@ -932,7 +931,6 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||
reflowState.mLineLayout = this;
|
||||
reflowState.mFlags.mIsTopOfPage = GetFlag(LL_ISTOPOFPAGE);
|
||||
SetFlag(LL_UNDERSTANDSNWHITESPACE, PR_FALSE);
|
||||
SetFlag(LL_TEXTSTARTSWITHNBSP, PR_FALSE);
|
||||
mTextJustificationNumSpaces = 0;
|
||||
mTextJustificationNumLetters = 0;
|
||||
|
||||
@@ -1262,7 +1260,6 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||
else {
|
||||
PushFrame(aFrame);
|
||||
}
|
||||
SetFlag(LL_TEXTSTARTSWITHNBSP, PR_FALSE); // reset for next time
|
||||
|
||||
#ifdef REALLY_NOISY_REFLOW
|
||||
nsFrame::IndentBy(stdout, mSpanDepth);
|
||||
@@ -1520,15 +1517,6 @@ nsLineLayout::CanPlaceFrame(PerFrameData* pfd,
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
// Yet another special check. If the text happens to have started
|
||||
// with a non-breaking space, then we make it sticky on its left
|
||||
// edge...Which means that whatever piece of text we just formatted
|
||||
// will be the piece that fits (the text frame logic knows to stop
|
||||
// when it runs out of room).
|
||||
if (pfd->GetFlag(PFD_ISNONEMPTYTEXTFRAME) && GetFlag(LL_TEXTSTARTSWITHNBSP)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
#ifdef NOISY_CAN_PLACE_FRAME
|
||||
printf(" ==> didn't fit\n");
|
||||
#endif
|
||||
|
||||
@@ -131,7 +131,6 @@ public:
|
||||
protected:
|
||||
#define LL_ENDSINWHITESPACE 0x00000001
|
||||
#define LL_UNDERSTANDSNWHITESPACE 0x00000002
|
||||
#define LL_TEXTSTARTSWITHNBSP 0x00000004
|
||||
#define LL_FIRSTLETTERSTYLEOK 0x00000008
|
||||
#define LL_ISTOPOFPAGE 0x00000010
|
||||
#define LL_UPDATEDBAND 0x00000020
|
||||
@@ -185,11 +184,6 @@ public:
|
||||
mTextJustificationNumLetters = aNumLetters;
|
||||
}
|
||||
|
||||
|
||||
void SetTextStartsWithNBSP(PRBool aYes) {
|
||||
SetFlag(LL_TEXTSTARTSWITHNBSP, aYes);
|
||||
}
|
||||
|
||||
void RecordWordFrame(nsIFrame* aWordFrame) {
|
||||
mWordFrames.Push(aWordFrame);
|
||||
}
|
||||
|
||||
@@ -4594,7 +4594,6 @@ nsTextFrame::MeasureText(nsIPresContext* aPresContext,
|
||||
nscoord prevMaxWordWidth = 0, prevAscent = 0, prevDescent = 0;
|
||||
PRInt32 lastWordLen = 0;
|
||||
PRUnichar* lastWordPtr = nsnull;
|
||||
PRBool textStartsWithNBSP = PR_FALSE;
|
||||
PRBool endsInWhitespace = PR_FALSE;
|
||||
PRBool endsInNewline = PR_FALSE;
|
||||
PRBool justDidFirstLetter = PR_FALSE;
|
||||
@@ -4813,12 +4812,6 @@ nsTextFrame::MeasureText(nsIPresContext* aPresContext,
|
||||
} //(aTextData.mMeasureText)
|
||||
}
|
||||
else {
|
||||
// See if the first thing in the section of text is a
|
||||
// non-breaking space (html nbsp entity). If it is then make
|
||||
// note of that fact for the line layout logic.
|
||||
if (aTextData.mWrapping && firstThing && (firstChar == ' ')) {
|
||||
textStartsWithNBSP = PR_TRUE;
|
||||
}
|
||||
aTextData.mSkipWhitespace = PR_FALSE;
|
||||
|
||||
if (aTextData.mFirstLetterOK) {
|
||||
@@ -5186,7 +5179,6 @@ nsTextFrame::MeasureText(nsIPresContext* aPresContext,
|
||||
// effect the current setting of the ends-in-whitespace flag.
|
||||
lineLayout.SetColumn(column);
|
||||
lineLayout.SetUnderstandsWhiteSpace(PR_TRUE);
|
||||
lineLayout.SetTextStartsWithNBSP(textStartsWithNBSP);
|
||||
if (0 != aTextData.mX) {
|
||||
lineLayout.SetEndsInWhiteSpace(endsInWhitespace);
|
||||
}
|
||||
|
||||
@@ -262,7 +262,6 @@ nsLineLayout::BeginLineReflow(nscoord aX, nscoord aY,
|
||||
|
||||
SetFlag(LL_ENDSINWHITESPACE, PR_TRUE);
|
||||
SetFlag(LL_UNDERSTANDSNWHITESPACE, PR_FALSE);
|
||||
SetFlag(LL_TEXTSTARTSWITHNBSP, PR_FALSE);
|
||||
SetFlag(LL_FIRSTLETTERSTYLEOK, PR_FALSE);
|
||||
SetFlag(LL_ISTOPOFPAGE, aIsTopOfPage);
|
||||
SetFlag(LL_UPDATEDBAND, PR_FALSE);
|
||||
@@ -932,7 +931,6 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||
reflowState.mLineLayout = this;
|
||||
reflowState.mFlags.mIsTopOfPage = GetFlag(LL_ISTOPOFPAGE);
|
||||
SetFlag(LL_UNDERSTANDSNWHITESPACE, PR_FALSE);
|
||||
SetFlag(LL_TEXTSTARTSWITHNBSP, PR_FALSE);
|
||||
mTextJustificationNumSpaces = 0;
|
||||
mTextJustificationNumLetters = 0;
|
||||
|
||||
@@ -1262,7 +1260,6 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||
else {
|
||||
PushFrame(aFrame);
|
||||
}
|
||||
SetFlag(LL_TEXTSTARTSWITHNBSP, PR_FALSE); // reset for next time
|
||||
|
||||
#ifdef REALLY_NOISY_REFLOW
|
||||
nsFrame::IndentBy(stdout, mSpanDepth);
|
||||
@@ -1520,15 +1517,6 @@ nsLineLayout::CanPlaceFrame(PerFrameData* pfd,
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
// Yet another special check. If the text happens to have started
|
||||
// with a non-breaking space, then we make it sticky on its left
|
||||
// edge...Which means that whatever piece of text we just formatted
|
||||
// will be the piece that fits (the text frame logic knows to stop
|
||||
// when it runs out of room).
|
||||
if (pfd->GetFlag(PFD_ISNONEMPTYTEXTFRAME) && GetFlag(LL_TEXTSTARTSWITHNBSP)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
#ifdef NOISY_CAN_PLACE_FRAME
|
||||
printf(" ==> didn't fit\n");
|
||||
#endif
|
||||
|
||||
@@ -131,7 +131,6 @@ public:
|
||||
protected:
|
||||
#define LL_ENDSINWHITESPACE 0x00000001
|
||||
#define LL_UNDERSTANDSNWHITESPACE 0x00000002
|
||||
#define LL_TEXTSTARTSWITHNBSP 0x00000004
|
||||
#define LL_FIRSTLETTERSTYLEOK 0x00000008
|
||||
#define LL_ISTOPOFPAGE 0x00000010
|
||||
#define LL_UPDATEDBAND 0x00000020
|
||||
@@ -185,11 +184,6 @@ public:
|
||||
mTextJustificationNumLetters = aNumLetters;
|
||||
}
|
||||
|
||||
|
||||
void SetTextStartsWithNBSP(PRBool aYes) {
|
||||
SetFlag(LL_TEXTSTARTSWITHNBSP, aYes);
|
||||
}
|
||||
|
||||
void RecordWordFrame(nsIFrame* aWordFrame) {
|
||||
mWordFrames.Push(aWordFrame);
|
||||
}
|
||||
|
||||
@@ -4594,7 +4594,6 @@ nsTextFrame::MeasureText(nsIPresContext* aPresContext,
|
||||
nscoord prevMaxWordWidth = 0, prevAscent = 0, prevDescent = 0;
|
||||
PRInt32 lastWordLen = 0;
|
||||
PRUnichar* lastWordPtr = nsnull;
|
||||
PRBool textStartsWithNBSP = PR_FALSE;
|
||||
PRBool endsInWhitespace = PR_FALSE;
|
||||
PRBool endsInNewline = PR_FALSE;
|
||||
PRBool justDidFirstLetter = PR_FALSE;
|
||||
@@ -4813,12 +4812,6 @@ nsTextFrame::MeasureText(nsIPresContext* aPresContext,
|
||||
} //(aTextData.mMeasureText)
|
||||
}
|
||||
else {
|
||||
// See if the first thing in the section of text is a
|
||||
// non-breaking space (html nbsp entity). If it is then make
|
||||
// note of that fact for the line layout logic.
|
||||
if (aTextData.mWrapping && firstThing && (firstChar == ' ')) {
|
||||
textStartsWithNBSP = PR_TRUE;
|
||||
}
|
||||
aTextData.mSkipWhitespace = PR_FALSE;
|
||||
|
||||
if (aTextData.mFirstLetterOK) {
|
||||
@@ -5186,7 +5179,6 @@ nsTextFrame::MeasureText(nsIPresContext* aPresContext,
|
||||
// effect the current setting of the ends-in-whitespace flag.
|
||||
lineLayout.SetColumn(column);
|
||||
lineLayout.SetUnderstandsWhiteSpace(PR_TRUE);
|
||||
lineLayout.SetTextStartsWithNBSP(textStartsWithNBSP);
|
||||
if (0 != aTextData.mX) {
|
||||
lineLayout.SetEndsInWhiteSpace(endsInWhitespace);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user