mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Adding support in line layout for the CSS "direction" property.
This commit is contained in:
parent
1f0eea254c
commit
aa6ad6f2fe
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -296,6 +296,7 @@ public:
|
||||
const nsHTMLReflowState* mReflowState;
|
||||
PRBool mNoWrap;
|
||||
PRUint8 mDirection;
|
||||
PRBool mChangedFrameDirection;
|
||||
|
||||
nscoord mLeftEdge;
|
||||
nscoord mX;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -296,6 +296,7 @@ public:
|
||||
const nsHTMLReflowState* mReflowState;
|
||||
PRBool mNoWrap;
|
||||
PRUint8 mDirection;
|
||||
PRBool mChangedFrameDirection;
|
||||
|
||||
nscoord mLeftEdge;
|
||||
nscoord mX;
|
||||
|
Loading…
Reference in New Issue
Block a user