зеркало из https://github.com/mozilla/gecko-dev.git
Factored out whitespace trimming from horizontal alignment
This commit is contained in:
Родитель
a475e77dd2
Коммит
076247ac56
|
@ -887,10 +887,8 @@ nsInlineReflow::VerticalAlignFrames(nsRect& aLineBox,
|
|||
}
|
||||
|
||||
void
|
||||
nsInlineReflow::HorizontalAlignFrames(nsRect& aLineBox, PRBool aAllowJustify)
|
||||
nsInlineReflow::TrimTrailingWhiteSpace(nsRect& aLineBox)
|
||||
{
|
||||
// Before we start, trim any trailing whitespace off of the last
|
||||
// frame in the line.
|
||||
nscoord deltaWidth;
|
||||
PerFrameData* pfd = mFrameDataBase + (mFrameNum - 1);
|
||||
if (pfd->mBounds.width > 0) {
|
||||
|
@ -904,7 +902,11 @@ nsInlineReflow::HorizontalAlignFrames(nsRect& aLineBox, PRBool aAllowJustify)
|
|||
pfd->mBounds.width -= deltaWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsInlineReflow::HorizontalAlignFrames(nsRect& aLineBox, PRBool aAllowJustify)
|
||||
{
|
||||
const nsStyleText* styleText = mOuterReflowState.mStyleText;
|
||||
nscoord maxWidth = mRightEdge - mLeftEdge;
|
||||
if (aLineBox.width < maxWidth) {
|
||||
|
@ -946,7 +948,7 @@ nsInlineReflow::HorizontalAlignFrames(nsRect& aLineBox, PRBool aAllowJustify)
|
|||
|
||||
if (0 != dx) {
|
||||
// Position children
|
||||
pfd = mFrameDataBase;
|
||||
PerFrameData* pfd = mFrameDataBase;
|
||||
PerFrameData* end = pfd + mFrameNum;
|
||||
nsPoint origin;
|
||||
for (; pfd < end; pfd++) {
|
||||
|
|
|
@ -60,6 +60,8 @@ public:
|
|||
|
||||
void HorizontalAlignFrames(nsRect& aLineBox, PRBool aAllowJustify);
|
||||
|
||||
void TrimTrailingWhiteSpace(nsRect& aLineBox);
|
||||
|
||||
void RelativePositionFrames(nsRect& aCombinedArea);
|
||||
|
||||
PRInt32 GetCurrentFrameNum() const { return mFrameNum; }
|
||||
|
|
Загрузка…
Ссылка в новой задаче