mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1079154 patch 3: logical versions of ApplyRelativePositioning, r=jfkthame
This commit is contained in:
parent
02b85bac8f
commit
16d0d92ccc
@ -825,6 +825,34 @@ public:
|
||||
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
|
||||
// Reflow trace methods. Defined in nsFrame.cpp so they have access
|
||||
// to the display-reflow infrastructure.
|
||||
|
Loading…
Reference in New Issue
Block a user