Bug 1079154 patch 3: logical versions of ApplyRelativePositioning, r=jfkthame
This commit is contained in:
@@ -825,6 +825,34 @@ public:
|
|||||||
ApplyRelativePositioning(frame, ComputedPhysicalOffsets(), aPosition);
|
ApplyRelativePositioning(frame, ComputedPhysicalOffsets(), aPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ApplyRelativePositioning(nsIFrame* aFrame,
|
||||||
|
mozilla::WritingMode aWritingMode,
|
||||||
|
const mozilla::LogicalMargin& aComputedOffsets,
|
||||||
|
mozilla::LogicalPoint* aPosition,
|
||||||
|
nscoord aContainerWidth) {
|
||||||
|
// Subtract the width of the frame from the container width that we
|
||||||
|
// use for converting between the logical and physical origins of
|
||||||
|
// the frame. This accounts for the fact that logical origins in RTL
|
||||||
|
// coordinate systems are at the top right of the frame instead of
|
||||||
|
// the top left.
|
||||||
|
nscoord frameWidth = aFrame->GetSize().width;
|
||||||
|
nsPoint pos = aPosition->GetPhysicalPoint(aWritingMode,
|
||||||
|
aContainerWidth - frameWidth);
|
||||||
|
ApplyRelativePositioning(aFrame,
|
||||||
|
aComputedOffsets.GetPhysicalMargin(aWritingMode),
|
||||||
|
&pos);
|
||||||
|
*aPosition = mozilla::LogicalPoint(aWritingMode, pos,
|
||||||
|
aContainerWidth - frameWidth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApplyRelativePositioning(mozilla::LogicalPoint* aPosition,
|
||||||
|
nscoord aContainerWidth) const {
|
||||||
|
ApplyRelativePositioning(frame, mWritingMode,
|
||||||
|
ComputedLogicalOffsets(), aPosition,
|
||||||
|
aContainerWidth);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// Reflow trace methods. Defined in nsFrame.cpp so they have access
|
// Reflow trace methods. Defined in nsFrame.cpp so they have access
|
||||||
// to the display-reflow infrastructure.
|
// to the display-reflow infrastructure.
|
||||||
|
|||||||
Reference in New Issue
Block a user