Bug 1624684 Part 3 - Let BaseMargin::ApplySkipSides return a reference to itself, and convert some callers. r=jfkthame

Differential Revision: https://phabricator.services.mozilla.com/D69759

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2020-04-07 18:43:51 +00:00
Родитель 9306d8b5ef
Коммит 5a44b5df11
2 изменённых файлов: 5 добавлений и 7 удалений

Просмотреть файл

@ -88,7 +88,7 @@ struct BaseMargin {
return *(&top + int(aSide));
}
void ApplySkipSides(Sides aSkipSides) {
Sub& ApplySkipSides(Sides aSkipSides) {
if (aSkipSides.Top()) {
top = 0;
}
@ -101,6 +101,7 @@ struct BaseMargin {
if (aSkipSides.Left()) {
left = 0;
}
return *static_cast<Sub*>(this);
}
// Overloaded operators. Note that '=' isn't defined so we'll get the

Просмотреть файл

@ -1707,8 +1707,7 @@ nsIFrame::Sides nsIFrame::GetSkipSides(const ReflowInput* aReflowInput) const {
}
nsRect nsIFrame::GetPaddingRectRelativeToSelf() const {
nsMargin border(GetUsedBorder());
border.ApplySkipSides(GetSkipSides());
nsMargin border = GetUsedBorder().ApplySkipSides(GetSkipSides());
nsRect r(0, 0, mRect.width, mRect.height);
r.Deflate(border);
return r;
@ -1732,8 +1731,7 @@ WritingMode nsIFrame::WritingModeForLine(WritingMode aSelfWM,
}
nsRect nsIFrame::GetMarginRectRelativeToSelf() const {
nsMargin m = GetUsedMargin();
m.ApplySkipSides(GetSkipSides());
nsMargin m = GetUsedMargin().ApplySkipSides(GetSkipSides());
nsRect r(0, 0, mRect.width, mRect.height);
r.Inflate(m);
return r;
@ -1850,8 +1848,7 @@ bool nsIFrame::HasPerspective(const nsStyleDisplay* aStyleDisplay) const {
}
nsRect nsIFrame::GetContentRectRelativeToSelf() const {
nsMargin bp(GetUsedBorderAndPadding());
bp.ApplySkipSides(GetSkipSides());
nsMargin bp = GetUsedBorderAndPadding().ApplySkipSides(GetSkipSides());
nsRect r(0, 0, mRect.width, mRect.height);
r.Deflate(bp);
return r;