Bug 1298008 Part 1: Update GeometryUtils::GetBoxRectForFrame to use GetMarginRectRelativeToSelf for margin boxes. draft
authorBrad Werth <bwerth@mozilla.com>
Mon, 22 Jan 2018 15:12:37 -0800
changeset 776037 f519f0f732adc5b181912bfc6653293c271d34ae
parent 776018 c44f60c43432d468639b5fe078420e60c13fd3de
child 776038 8ea7bb07b8a9b54b721151eb897ed0615fcfd936
push id104798
push userbwerth@mozilla.com
push dateMon, 02 Apr 2018 16:04:40 +0000
bugs1298008
milestone61.0a1
Bug 1298008 Part 1: Update GeometryUtils::GetBoxRectForFrame to use GetMarginRectRelativeToSelf for margin boxes. MozReview-Commit-ID: HpOi0TnqEgw
layout/base/GeometryUtils.cpp
--- a/layout/base/GeometryUtils.cpp
+++ b/layout/base/GeometryUtils.cpp
@@ -147,21 +147,17 @@ GetBoxRectForFrame(nsIFrame** aFrame, CS
     return r;
   }
 
   f = *aFrame;
   switch (aType) {
   case CSSBoxType::Content: r = f->GetContentRectRelativeToSelf(); break;
   case CSSBoxType::Padding: r = f->GetPaddingRectRelativeToSelf(); break;
   case CSSBoxType::Border: r = nsRect(nsPoint(0, 0), f->GetSize()); break;
-  case CSSBoxType::Margin: {
-    r = nsRect(nsPoint(0, 0), f->GetSize());
-    r.Inflate(f->GetUsedMargin());
-    break;
-  }
+  case CSSBoxType::Margin: r = f->GetMarginRectRelativeToSelf(); break;
   default: MOZ_ASSERT(false, "unknown box type"); return r;
   }
 
   return r;
 }
 
 class AccumulateQuadCallback : public nsLayoutUtils::BoxCallback {
 public: