Bug 1298008 Part 1: Update GeometryUtils::GetBoxRectForFrame to use GetMarginRectRelativeToSelf for margin boxes. r=dholbert
☠☠ backed out by 0f2d2c86412c ☠ ☠
authorBrad Werth <bwerth@mozilla.com>
Mon, 22 Jan 2018 15:12:37 -0800
changeset 410805 40f53976a5b8adce2955c72ca952898271c69297
parent 410804 908749c3b8584dcbe7d4dcccf0f4c06921eee68d
child 410806 b5a4113f4649687c0ccc53d793263dd61a79c010
push id61973
push userbwerth@mozilla.com
push dateFri, 30 Mar 2018 18:18:13 +0000
treeherderautoland@f5d5d6a09965 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1298008
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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: