mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1055658 part 1 - Move code for applying relative position to an independent method. r=dbaron
--HG-- extra : source : aa1e52e91dd5ae6fdcdc6ca17bd9ec2a0b946f2b
This commit is contained in:
parent
f16f08b16e
commit
c7dcc6e79f
@ -3021,6 +3021,25 @@ nsLineLayout::RelativePositionFrames(nsOverflowAreas& aOverflowAreas)
|
||||
RelativePositionFrames(mRootSpan, aOverflowAreas);
|
||||
}
|
||||
|
||||
// This method applies any relative positioning to the given frame.
|
||||
void
|
||||
nsLineLayout::ApplyRelativePositioning(PerFrameData* aPFD)
|
||||
{
|
||||
if (!aPFD->mRelativePos) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsIFrame* frame = aPFD->mFrame;
|
||||
WritingMode frameWM = frame->GetWritingMode();
|
||||
LogicalPoint origin = frame->GetLogicalPosition(mContainerWidth);
|
||||
// right and bottom are handled by
|
||||
// nsHTMLReflowState::ComputeRelativeOffsets
|
||||
nsHTMLReflowState::ApplyRelativePositioning(frame, frameWM,
|
||||
aPFD->mOffsets, &origin,
|
||||
mContainerWidth);
|
||||
frame->SetPosition(frameWM, origin, mContainerWidth);
|
||||
}
|
||||
|
||||
void
|
||||
nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflowAreas)
|
||||
{
|
||||
@ -3059,16 +3078,7 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflo
|
||||
nsIFrame* frame = pfd->mFrame;
|
||||
|
||||
// Adjust the origin of the frame
|
||||
if (pfd->mRelativePos) {
|
||||
WritingMode frameWM = frame->GetWritingMode();
|
||||
LogicalPoint origin = frame->GetLogicalPosition(mContainerWidth);
|
||||
// right and bottom are handled by
|
||||
// nsHTMLReflowState::ComputeRelativeOffsets
|
||||
nsHTMLReflowState::ApplyRelativePositioning(frame, frameWM,
|
||||
pfd->mOffsets, &origin,
|
||||
mContainerWidth);
|
||||
frame->SetPosition(frameWM, origin, mContainerWidth);
|
||||
}
|
||||
ApplyRelativePositioning(pfd);
|
||||
|
||||
// We must position the view correctly before positioning its
|
||||
// descendants so that widgets are positioned properly (since only
|
||||
|
@ -665,6 +665,8 @@ protected:
|
||||
nscoord aDistanceFromStart,
|
||||
nscoord aLineBSize);
|
||||
|
||||
void ApplyRelativePositioning(PerFrameData* aPFD);
|
||||
|
||||
void RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflowAreas);
|
||||
|
||||
bool TrimTrailingWhiteSpaceIn(PerSpanData* psd, nscoord* aDeltaISize);
|
||||
|
Loading…
Reference in New Issue
Block a user