зеркало из https://github.com/mozilla/pjs.git
Collapse trailing whitespace even if there is a placeholder after it. Bug
233451, r+sr=dbaron
This commit is contained in:
Родитель
cd147556bd
Коммит
ab4c59230c
|
@ -1040,6 +1040,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||||
// the float.
|
// the float.
|
||||||
if (frameType) {
|
if (frameType) {
|
||||||
if (nsLayoutAtoms::placeholderFrame == frameType) {
|
if (nsLayoutAtoms::placeholderFrame == frameType) {
|
||||||
|
pfd->SetFlag(PFD_ISPLACEHOLDERFRAME, PR_TRUE);
|
||||||
nsIFrame* outOfFlowFrame = ((nsPlaceholderFrame*)aFrame)->GetOutOfFlowFrame();
|
nsIFrame* outOfFlowFrame = ((nsPlaceholderFrame*)aFrame)->GetOutOfFlowFrame();
|
||||||
if (outOfFlowFrame) {
|
if (outOfFlowFrame) {
|
||||||
// Make sure it's floated and not absolutely positioned
|
// Make sure it's floated and not absolutely positioned
|
||||||
|
@ -2642,9 +2643,10 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!pfd->GetFlag(PFD_ISTEXTFRAME)) {
|
else if (!pfd->GetFlag(PFD_ISTEXTFRAME) &&
|
||||||
// If we hit a frame on the end that's not text, then there is
|
!pfd->GetFlag(PFD_ISPLACEHOLDERFRAME)) {
|
||||||
// no trailing whitespace to trim. Stop the search.
|
// 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;
|
*aDeltaWidth = 0;
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -353,7 +353,8 @@ protected:
|
||||||
#define PFD_ISLETTERFRAME 0x00000010
|
#define PFD_ISLETTERFRAME 0x00000010
|
||||||
#define PFD_ISSTICKY 0x00000020
|
#define PFD_ISSTICKY 0x00000020
|
||||||
#define PFD_ISBULLET 0x00000040
|
#define PFD_ISBULLET 0x00000040
|
||||||
#define PFD_LASTFLAG PFD_ISBULLET
|
#define PFD_ISPLACEHOLDERFRAME 0x00000080
|
||||||
|
#define PFD_LASTFLAG PFD_ISPLACEHOLDERFRAME
|
||||||
|
|
||||||
PRPackedBool mFlags;
|
PRPackedBool mFlags;
|
||||||
|
|
||||||
|
|
|
@ -1040,6 +1040,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||||
// the float.
|
// the float.
|
||||||
if (frameType) {
|
if (frameType) {
|
||||||
if (nsLayoutAtoms::placeholderFrame == frameType) {
|
if (nsLayoutAtoms::placeholderFrame == frameType) {
|
||||||
|
pfd->SetFlag(PFD_ISPLACEHOLDERFRAME, PR_TRUE);
|
||||||
nsIFrame* outOfFlowFrame = ((nsPlaceholderFrame*)aFrame)->GetOutOfFlowFrame();
|
nsIFrame* outOfFlowFrame = ((nsPlaceholderFrame*)aFrame)->GetOutOfFlowFrame();
|
||||||
if (outOfFlowFrame) {
|
if (outOfFlowFrame) {
|
||||||
// Make sure it's floated and not absolutely positioned
|
// Make sure it's floated and not absolutely positioned
|
||||||
|
@ -2642,9 +2643,10 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!pfd->GetFlag(PFD_ISTEXTFRAME)) {
|
else if (!pfd->GetFlag(PFD_ISTEXTFRAME) &&
|
||||||
// If we hit a frame on the end that's not text, then there is
|
!pfd->GetFlag(PFD_ISPLACEHOLDERFRAME)) {
|
||||||
// no trailing whitespace to trim. Stop the search.
|
// 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;
|
*aDeltaWidth = 0;
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -353,7 +353,8 @@ protected:
|
||||||
#define PFD_ISLETTERFRAME 0x00000010
|
#define PFD_ISLETTERFRAME 0x00000010
|
||||||
#define PFD_ISSTICKY 0x00000020
|
#define PFD_ISSTICKY 0x00000020
|
||||||
#define PFD_ISBULLET 0x00000040
|
#define PFD_ISBULLET 0x00000040
|
||||||
#define PFD_LASTFLAG PFD_ISBULLET
|
#define PFD_ISPLACEHOLDERFRAME 0x00000080
|
||||||
|
#define PFD_LASTFLAG PFD_ISPLACEHOLDERFRAME
|
||||||
|
|
||||||
PRPackedBool mFlags;
|
PRPackedBool mFlags;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче