Bug 1490730 part 1 - [css-grid] Static position should use content-box, not padding-box. r=dholbert
authorMats Palmgren <mats@mozilla.com>
Sat, 15 Sep 2018 01:30:18 +0200
changeset 436474 df4e19315cd308ce146ffb6dd81385b4e690833a
parent 436473 b2a536ba5d4bbf0be909652caee1d2d4d63ddcb4
child 436475 69980706914c31ea69ce66eaeacdfe0cae78ee8c
push id107864
push usermpalmgren@mozilla.com
push dateFri, 14 Sep 2018 23:30:30 +0000
treeherdermozilla-inbound@e5c0ba4149fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1490730
milestone64.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 1490730 part 1 - [css-grid] Static position should use content-box, not padding-box. r=dholbert
layout/generic/nsGridContainerFrame.cpp
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -4977,18 +4977,16 @@ nsGridContainerFrame::ReflowInFlowChild(
                                         const GridReflowInput& aState,
                                         const LogicalRect&     aContentArea,
                                         ReflowOutput&   aDesiredSize,
                                         nsReflowStatus&        aStatus)
 {
   nsPresContext* pc = PresContext();
   ComputedStyle* containerSC = Style();
   WritingMode wm = aState.mReflowInput->GetWritingMode();
-  LogicalMargin pad(aState.mReflowInput->ComputedLogicalPadding());
-  const LogicalPoint padStart(wm, pad.IStart(wm), pad.BStart(wm));
   const bool isGridItem = !!aGridItemInfo;
   MOZ_ASSERT(isGridItem == !aChild->IsPlaceholderFrame());
   LogicalRect cb(wm);
   WritingMode childWM = aChild->GetWritingMode();
   bool isConstrainedBSize = false;
   nscoord toFragmentainerEnd;
   // The part of the child's grid area that's in previous container fragments.
   nscoord consumedGridAreaBSize = 0;
@@ -5041,24 +5039,24 @@ nsGridContainerFrame::ReflowInFlowChild(
     };
     SetProp(eLogicalAxisBlock, isOrthogonal ? IBaselinePadProperty() :
                                               BBaselinePadProperty());
     SetProp(eLogicalAxisInline, isOrthogonal ? BBaselinePadProperty() :
                                                IBaselinePadProperty());
   } else {
     // By convention, for frames that perform CSS Box Alignment, we position
     // placeholder children at the start corner of their alignment container,
-    // and in this case that's usually the grid's padding box.
+    // and in this case that's usually the grid's content-box.
     // ("Usually" - the exception is when the grid *also* forms the
     // abs.pos. containing block. In that case, the alignment container isn't
-    // the padding box -- it's some grid area instead.  But that case doesn't
+    // the content-box -- it's some grid area instead.  But that case doesn't
     // require any special handling here, because we handle it later using a
     // special flag (STATIC_POS_IS_CB_ORIGIN) which will make us ignore the
     // placeholder's position entirely.)
-    cb = aContentArea - padStart;
+    cb = aContentArea;
     aChild->AddStateBits(PLACEHOLDER_STATICPOS_NEEDS_CSSALIGN);
   }
 
   LogicalSize reflowSize(cb.Size(wm));
   if (isConstrainedBSize) {
     reflowSize.BSize(wm) = toFragmentainerEnd;
   }
   LogicalSize childCBSize = reflowSize.ConvertTo(childWM, wm);