зеркало из https://github.com/mozilla/gecko-dev.git
Bug 775624 Part 19 - Convert NS_INLINE_BREAK_FIRST_LETTER_COMPLETE to use bit-field and methods. r=dholbert
MozReview-Commit-ID: k1CSWJNMns --HG-- extra : rebase_source : 1aa775a1e835f3d001f8b2093d0c4fb9f6651630
This commit is contained in:
Родитель
65116ee49c
Коммит
37d27159af
|
@ -4255,7 +4255,7 @@ nsBlockFrame::ReflowInlineFrame(BlockReflowInput& aState,
|
|||
// If we just ended a first-letter frame or reflowed a placeholder then
|
||||
// don't split the line and don't stop the line reflow...
|
||||
// But if we are going to stop anyways we'd better split the line.
|
||||
if ((!(frameReflowStatus & NS_INLINE_BREAK_FIRST_LETTER_COMPLETE) &&
|
||||
if ((!frameReflowStatus.FirstLetterComplete() &&
|
||||
nsGkAtoms::placeholderFrame != aFrame->GetType()) ||
|
||||
*aLineReflowStatus == LineReflowStatus::Stop) {
|
||||
// Split line after the current frame
|
||||
|
|
|
@ -209,6 +209,7 @@ public:
|
|||
, mTruncated(false)
|
||||
, mInlineBreak(false)
|
||||
, mInlineBreakAfter(false)
|
||||
, mFirstLetterComplete(false)
|
||||
{}
|
||||
|
||||
// Reset all the bit-fields.
|
||||
|
@ -220,6 +221,7 @@ public:
|
|||
mTruncated = false;
|
||||
mInlineBreak = false;
|
||||
mInlineBreakAfter = false;
|
||||
mFirstLetterComplete = false;
|
||||
}
|
||||
|
||||
nsReflowStatus(uint32_t aStatus)
|
||||
|
@ -345,6 +347,11 @@ public:
|
|||
mInlineBreakAfter = true;
|
||||
}
|
||||
|
||||
// mFirstLetterComplete bit flag means the break was induced by
|
||||
// completion of a first-letter.
|
||||
bool FirstLetterComplete() const { return mFirstLetterComplete; }
|
||||
void SetFirstLetterComplete() { mFirstLetterComplete = true; }
|
||||
|
||||
private:
|
||||
uint32_t mStatus;
|
||||
|
||||
|
@ -359,15 +366,13 @@ private:
|
|||
// Inline break status bit flags.
|
||||
bool mInlineBreak : 1;
|
||||
bool mInlineBreakAfter : 1;
|
||||
bool mFirstLetterComplete : 1;
|
||||
};
|
||||
|
||||
#define NS_FRAME_COMPLETE 0 // Note: not a bit!
|
||||
#define NS_FRAME_NOT_COMPLETE 0x1
|
||||
#define NS_FRAME_OVERFLOW_INCOMPLETE 0x4
|
||||
|
||||
// Set when a break was induced by completion of a first-letter
|
||||
#define NS_INLINE_BREAK_FIRST_LETTER_COMPLETE 0x10000
|
||||
|
||||
#define NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics) \
|
||||
aStatus.UpdateTruncated(aReflowInput, aMetrics);
|
||||
|
||||
|
|
|
@ -9560,7 +9560,7 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
|
|||
}
|
||||
if (completedFirstLetter) {
|
||||
aLineLayout.SetFirstLetterStyleOK(false);
|
||||
aStatus |= NS_INLINE_BREAK_FIRST_LETTER_COMPLETE;
|
||||
aStatus.SetFirstLetterComplete();
|
||||
}
|
||||
|
||||
// Updated the cached NewlineProperty, or delete it.
|
||||
|
|
Загрузка…
Ссылка в новой задаче