mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1699327 - Add nsIFrame::GetMarginRect(), and comparison operators for LogicalMargin. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D107935
This commit is contained in:
parent
3a2795a286
commit
8c90a87873
@ -1429,6 +1429,16 @@ class LogicalMargin {
|
||||
mMargin.bottom == 0);
|
||||
}
|
||||
|
||||
bool operator==(const LogicalMargin& aMargin) const {
|
||||
CHECK_WRITING_MODE(aMargin.GetWritingMode());
|
||||
return mMargin == aMargin.mMargin;
|
||||
}
|
||||
|
||||
bool operator!=(const LogicalMargin& aMargin) const {
|
||||
CHECK_WRITING_MODE(aMargin.GetWritingMode());
|
||||
return mMargin != aMargin.mMargin;
|
||||
}
|
||||
|
||||
LogicalMargin operator+(const LogicalMargin& aMargin) const {
|
||||
CHECK_WRITING_MODE(aMargin.GetWritingMode());
|
||||
return LogicalMargin(GetWritingMode(), BStart() + aMargin.BStart(),
|
||||
|
@ -1692,6 +1692,10 @@ WritingMode nsIFrame::WritingModeForLine(WritingMode aSelfWM,
|
||||
return writingMode;
|
||||
}
|
||||
|
||||
nsRect nsIFrame::GetMarginRect() const {
|
||||
return GetMarginRectRelativeToSelf() + GetPosition();
|
||||
}
|
||||
|
||||
nsRect nsIFrame::GetMarginRectRelativeToSelf() const {
|
||||
nsMargin m = GetUsedMargin().ApplySkipSides(GetSkipSides());
|
||||
nsRect r(0, 0, mRect.width, mRect.height);
|
||||
|
@ -1071,6 +1071,7 @@ class nsIFrame : public nsQueryFrame {
|
||||
nsRect GetPaddingRectRelativeToSelf() const;
|
||||
nsRect GetContentRect() const;
|
||||
nsRect GetContentRectRelativeToSelf() const;
|
||||
nsRect GetMarginRect() const;
|
||||
nsRect GetMarginRectRelativeToSelf() const;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user