Bug 1089388 - Convert nsBlockFrame::SlideLine to use logical coordinates. r=smontagu

This commit is contained in:
Jonathan Kew 2014-11-13 08:58:02 +00:00
parent 5922ab8a63
commit 150a68da5c
2 changed files with 16 additions and 12 deletions

View File

@ -2731,12 +2731,12 @@ nsBlockFrame::PullFrameFrom(nsLineBox* aLine,
void
nsBlockFrame::SlideLine(nsBlockReflowState& aState,
nsLineBox* aLine, nscoord aDY)
nsLineBox* aLine, nscoord aDeltaBCoord)
{
NS_PRECONDITION(aDY != 0, "why slide a line nowhere?");
NS_PRECONDITION(aDeltaBCoord != 0, "why slide a line nowhere?");
// Adjust line state
aLine->SlideBy(aDY, aState.mContainerWidth);
aLine->SlideBy(aDeltaBCoord, aState.mContainerWidth);
// Adjust the frames in the line
nsIFrame* kid = aLine->mFirstChild;
@ -2744,23 +2744,27 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState,
return;
}
WritingMode wm = GetWritingMode();
nsPoint physicalDelta =
LogicalPoint(wm, 0, aDeltaBCoord).GetPhysicalPoint(wm, 0);
if (aLine->IsBlock()) {
if (aDY) {
kid->MovePositionBy(nsPoint(0, aDY));
if (aDeltaBCoord) {
kid->MovePositionBy(physicalDelta);
}
// Make sure the frame's view and any child views are updated
nsContainerFrame::PlaceFrameView(kid);
}
else {
// Adjust the Y coordinate of the frames in the line.
// Note: we need to re-position views even if aDY is 0, because
// Adjust the block-dir coordinate of the frames in the line.
// Note: we need to re-position views even if aDeltaBCoord is 0, because
// one of our parent frames may have moved and so the view's position
// relative to its parent may have changed
// relative to its parent may have changed.
int32_t n = aLine->GetChildCount();
while (--n >= 0) {
if (aDY) {
kid->MovePositionBy(nsPoint(0, aDY));
if (aDeltaBCoord) {
kid->MovePositionBy(physicalDelta);
}
// Make sure the frame's view and any child views are updated
nsContainerFrame::PlaceFrameView(kid);

View File

@ -408,11 +408,11 @@ protected:
mState |= aFlags;
}
/** move the frames contained by aLine by aDY
/** move the frames contained by aLine by aDeltaBCoord
* if aLine is a block, its child floats are added to the state manager
*/
void SlideLine(nsBlockReflowState& aState,
nsLineBox* aLine, nscoord aDY);
nsLineBox* aLine, nscoord aDeltaBCoord);
void ComputeFinalSize(const nsHTMLReflowState& aReflowState,
nsBlockReflowState& aState,