Adding support in line layout for the CSS "direction" property.

git-svn-id: svn://10.0.0.236/trunk@30798 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nisheeth%netscape.com
1999-05-08 00:48:39 +00:00
parent 93bedd7e79
commit 4e92a7e798
4 changed files with 34 additions and 0 deletions

View File

@@ -250,6 +250,7 @@ nsLineLayout::BeginLineReflow(nscoord aX, nscoord aY,
break;
}
psd->mDirection = mBlockReflowState->mStyleDisplay->mDirection;
psd->mChangedFrameDirection = PR_FALSE;
}
void
@@ -461,6 +462,7 @@ nsLineLayout::BeginSpan(nsIFrame* aFrame,
break;
}
psd->mDirection = aSpanReflowState->mStyleDisplay->mDirection;
psd->mChangedFrameDirection = PR_FALSE;
// Switch to new span
mCurrentSpan = psd;
@@ -1900,6 +1902,20 @@ nsLineLayout::HorizontalAlignFrames(nsRect& aLineBounds, PRBool aAllowJustify)
pfd = pfd->mNext;
}
}
if (NS_STYLE_DIRECTION_RTL == psd->mDirection && !psd->mChangedFrameDirection) {
psd->mChangedFrameDirection = PR_TRUE;
/* Assume that all frames have been right aligned.*/
PerFrameData* pfd = psd->mFirstFrame;
PRUint32 maxX = psd->mRightEdge;
while (nsnull != pfd) {
pfd->mBounds.x = maxX - pfd->mBounds.width;
pfd->mFrame->SetRect(pfd->mBounds);
maxX = pfd->mBounds.x;
pfd = pfd->mNext;
}
}
}
}