зеркало из https://github.com/mozilla/pjs.git
Add bit to lines indicating that they may have a placeholder for a float that was pushed to the next line (and bump the child count up to 32 bits). (Bug 563584, patch 24) r=roc
This commit is contained in:
Родитель
481ee77350
Коммит
9e1e6a54f0
|
@ -2409,7 +2409,8 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
|
||||||
aState.mCurrentLine = aLine;
|
aState.mCurrentLine = aLine;
|
||||||
aLine->ClearDirty();
|
aLine->ClearDirty();
|
||||||
aLine->InvalidateCachedIsEmpty();
|
aLine->InvalidateCachedIsEmpty();
|
||||||
|
aLine->ClearHadFloatPushed();
|
||||||
|
|
||||||
// Now that we know what kind of line we have, reflow it
|
// Now that we know what kind of line we have, reflow it
|
||||||
if (aLine->IsBlock()) {
|
if (aLine->IsBlock()) {
|
||||||
nsRect oldBounds = aLine->mFirstChild->GetRect();
|
nsRect oldBounds = aLine->mFirstChild->GetRect();
|
||||||
|
@ -4213,7 +4214,7 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
|
||||||
if (aState.mBelowCurrentLineFloats.NotEmpty()) {
|
if (aState.mBelowCurrentLineFloats.NotEmpty()) {
|
||||||
// Reflow the below-current-line floats, which places on the line's
|
// Reflow the below-current-line floats, which places on the line's
|
||||||
// float list.
|
// float list.
|
||||||
aState.PlaceBelowCurrentLineFloats(aState.mBelowCurrentLineFloats);
|
aState.PlaceBelowCurrentLineFloats(aState.mBelowCurrentLineFloats, aLine);
|
||||||
aLine->AppendFloats(aState.mBelowCurrentLineFloats);
|
aLine->AppendFloats(aState.mBelowCurrentLineFloats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -605,6 +605,8 @@ nsBlockReflowState::AddFloat(nsLineLayout* aLineLayout,
|
||||||
aLineLayout->UpdateBand(availSpace, aFloat);
|
aLineLayout->UpdateBand(availSpace, aFloat);
|
||||||
// Record this float in the current-line list
|
// Record this float in the current-line list
|
||||||
mCurrentLineFloats.Append(mFloatCacheFreeList.Alloc(aFloat));
|
mCurrentLineFloats.Append(mFloatCacheFreeList.Alloc(aFloat));
|
||||||
|
} else {
|
||||||
|
(*aLineLayout->GetLine())->SetHadFloatPushed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -956,7 +958,8 @@ nsBlockReflowState::PushFloatPastBreak(nsIFrame *aFloat)
|
||||||
* Place below-current-line floats.
|
* Place below-current-line floats.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
nsBlockReflowState::PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aList)
|
nsBlockReflowState::PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aList,
|
||||||
|
nsLineBox* aLine)
|
||||||
{
|
{
|
||||||
nsFloatCache* fc = aList.Head();
|
nsFloatCache* fc = aList.Head();
|
||||||
while (fc) {
|
while (fc) {
|
||||||
|
@ -974,6 +977,7 @@ nsBlockReflowState::PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aList)
|
||||||
if (!placed) {
|
if (!placed) {
|
||||||
aList.Remove(fc);
|
aList.Remove(fc);
|
||||||
delete fc;
|
delete fc;
|
||||||
|
aLine->SetHadFloatPushed();
|
||||||
}
|
}
|
||||||
fc = next;
|
fc = next;
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,8 @@ public:
|
||||||
private:
|
private:
|
||||||
void PushFloatPastBreak(nsIFrame* aFloat);
|
void PushFloatPastBreak(nsIFrame* aFloat);
|
||||||
public:
|
public:
|
||||||
void PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aFloats);
|
void PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aFloats,
|
||||||
|
nsLineBox* aLine);
|
||||||
|
|
||||||
// Returns the first coordinate >= aY that clears the
|
// Returns the first coordinate >= aY that clears the
|
||||||
// floats indicated by aBreakType and has enough width between floats
|
// floats indicated by aBreakType and has enough width between floats
|
||||||
|
|
|
@ -174,7 +174,7 @@ protected:
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
#define LINE_MAX_BREAK_TYPE ((1 << 4) - 1)
|
#define LINE_MAX_BREAK_TYPE ((1 << 4) - 1)
|
||||||
#define LINE_MAX_CHILD_COUNT ((1 << 20) - 1)
|
#define LINE_MAX_CHILD_COUNT PR_INT32_MAX
|
||||||
|
|
||||||
#if NS_STYLE_CLEAR_LAST_VALUE > 15
|
#if NS_STYLE_CLEAR_LAST_VALUE > 15
|
||||||
need to rearrange the mBits bitfield;
|
need to rearrange the mBits bitfield;
|
||||||
|
@ -330,8 +330,19 @@ public:
|
||||||
PRBool HasBullet() const {
|
PRBool HasBullet() const {
|
||||||
return mFlags.mHasBullet;
|
return mFlags.mHasBullet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mHadFloatPushed bit
|
||||||
|
void SetHadFloatPushed() {
|
||||||
|
mFlags.mHadFloatPushed = PR_TRUE;
|
||||||
|
}
|
||||||
|
void ClearHadFloatPushed() {
|
||||||
|
mFlags.mHadFloatPushed = PR_FALSE;
|
||||||
|
}
|
||||||
|
PRBool HadFloatPushed() const {
|
||||||
|
return mFlags.mHadFloatPushed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// mChildCount value
|
// mChildCount value
|
||||||
PRInt32 GetChildCount() const {
|
PRInt32 GetChildCount() const {
|
||||||
return (PRInt32) mFlags.mChildCount;
|
return (PRInt32) mFlags.mChildCount;
|
||||||
|
@ -501,9 +512,13 @@ public:
|
||||||
// mHasBullet indicates that this is an inline line whose block's
|
// mHasBullet indicates that this is an inline line whose block's
|
||||||
// bullet is adjacent to this line and non-empty.
|
// bullet is adjacent to this line and non-empty.
|
||||||
PRUint32 mHasBullet : 1;
|
PRUint32 mHasBullet : 1;
|
||||||
|
// Indicates that this line *may* have a placeholder for a float
|
||||||
|
// that was pushed to a later column or page.
|
||||||
|
PRUint32 mHadFloatPushed : 1;
|
||||||
PRUint32 mBreakType : 4;
|
PRUint32 mBreakType : 4;
|
||||||
|
|
||||||
PRUint32 mChildCount : 17;
|
// FIXME: Move this out of FlagBits
|
||||||
|
PRUint32 mChildCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ExtraData {
|
struct ExtraData {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче