mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Add some more logical getters to nsIFrame.h. Bug 735577, r=jfkthame
This commit is contained in:
parent
f8a68ec80e
commit
f3f1e4c964
@ -839,6 +839,24 @@ public:
|
||||
mMargin.right == 0 && mMargin.bottom == 0);
|
||||
}
|
||||
|
||||
LogicalMargin operator+(const LogicalMargin& aMargin) {
|
||||
CHECK_WRITING_MODE(aMargin.GetWritingMode());
|
||||
return LogicalMargin(GetWritingMode(),
|
||||
BStart() + aMargin.BStart(),
|
||||
IEnd() + aMargin.IEnd(),
|
||||
BEnd() + aMargin.BEnd(),
|
||||
IStart() + aMargin.IStart());
|
||||
}
|
||||
|
||||
LogicalMargin operator-(const LogicalMargin& aMargin) {
|
||||
CHECK_WRITING_MODE(aMargin.GetWritingMode());
|
||||
return LogicalMargin(GetWritingMode(),
|
||||
BStart() - aMargin.BStart(),
|
||||
IEnd() - aMargin.IEnd(),
|
||||
BEnd() - aMargin.BEnd(),
|
||||
IStart() - aMargin.IStart());
|
||||
}
|
||||
|
||||
private:
|
||||
friend class LogicalRect;
|
||||
|
||||
|
@ -811,6 +811,13 @@ public:
|
||||
* Return frame's position without relative positioning
|
||||
*/
|
||||
nsPoint GetNormalPosition() const;
|
||||
mozilla::LogicalPoint
|
||||
GetLogicalNormalPosition(mozilla::WritingMode aWritingMode,
|
||||
nscoord aContainerWidth) const
|
||||
{
|
||||
return mozilla::LogicalPoint(aWritingMode,
|
||||
GetNormalPosition(), aContainerWidth);
|
||||
}
|
||||
|
||||
virtual nsPoint GetPositionOfChildIgnoringScrolling(nsIFrame* aChild)
|
||||
{ return aChild->GetPosition(); }
|
||||
@ -908,6 +915,10 @@ public:
|
||||
* having their original values.
|
||||
*/
|
||||
virtual nsMargin GetUsedMargin() const;
|
||||
virtual mozilla::LogicalMargin
|
||||
GetLogicalUsedMargin(mozilla::WritingMode aWritingMode) const {
|
||||
return mozilla::LogicalMargin(aWritingMode, GetUsedMargin());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the distance between the border edge of the frame (which is
|
||||
@ -920,6 +931,10 @@ public:
|
||||
* for tables, particularly border-collapse tables.
|
||||
*/
|
||||
virtual nsMargin GetUsedBorder() const;
|
||||
virtual mozilla::LogicalMargin
|
||||
GetLogicalUsedBorder(mozilla::WritingMode aWritingMode) const {
|
||||
return mozilla::LogicalMargin(aWritingMode, GetUsedBorder());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the distance between the padding edge of the frame and the
|
||||
@ -927,10 +942,18 @@ public:
|
||||
* as of the most recent reflow.
|
||||
*/
|
||||
virtual nsMargin GetUsedPadding() const;
|
||||
virtual mozilla::LogicalMargin
|
||||
GetLogicalUsedPadding(mozilla::WritingMode aWritingMode) const {
|
||||
return mozilla::LogicalMargin(aWritingMode, GetUsedPadding());
|
||||
}
|
||||
|
||||
nsMargin GetUsedBorderAndPadding() const {
|
||||
return GetUsedBorder() + GetUsedPadding();
|
||||
}
|
||||
mozilla::LogicalMargin
|
||||
GetLogicalUsedBorderAndPadding(mozilla::WritingMode aWritingMode) const {
|
||||
return mozilla::LogicalMargin(aWritingMode, GetUsedBorderAndPadding());
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the result of GetSkipSides() on this frame to an nsMargin by
|
||||
|
Loading…
Reference in New Issue
Block a user