Bug 1298008 Part 1: Update GeometryUtils::GetBoxRectForFrame to use GetMarginRectRelativeToSelf for margin boxes. r=dholbert
authorBrad Werth <bwerth@mozilla.com>
Mon, 22 Jan 2018 15:12:37 -0800
changeset 776457 f8977bb0471f9702c8de13c625d517ae65f629a2
parent 776456 2ac2b364cf5d83c6a336622cbda6b3ddb5f1e799
child 776458 94c0105f79d00f1309e413346c533752e522471d
push id104888
push userbmo:emilio@crisal.io
push dateTue, 03 Apr 2018 07:00:14 +0000
reviewersdholbert
bugs1298008
milestone61.0a1
Bug 1298008 Part 1: Update GeometryUtils::GetBoxRectForFrame to use GetMarginRectRelativeToSelf for margin boxes. r=dholbert 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: