Bug 1269017 part 4 - [css-grid] When doing CSS Box Alignment, opt out of a CalculateHypotheticalPosition() clause that disregards placeholder's inline position. r=mats
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 08 Nov 2016 16:30:00 -0800
changeset 321817 9f2bdebbdb89d5be01e11a148812f01211dcae64
parent 321816 ab70dc086596dc45abba729112247a7b6c684b57
child 321818 11829d96d9016ce42522fb9f4452faccd6a201b8
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
reviewersmats
bugs1269017
milestone52.0a1
Bug 1269017 part 4 - [css-grid] When doing CSS Box Alignment, opt out of a CalculateHypotheticalPosition() clause that disregards placeholder's inline position. r=mats (We don't want to disregard this position -- it's what we use to encode the start of the alignment container for this child, when we're doing CSS Box Alignment. So we need it to be reflected in the hypothetical position, not disregarded.) MozReview-Commit-ID: 28IgPn8z1Hr
layout/generic/ReflowInput.cpp
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -1410,18 +1410,21 @@ ReflowInput::CalculateHypotheticalPositi
     // like a XUL box, etc.
     // Just use the placeholder's block-offset
     aHypotheticalPos.mBStart = placeholderOffset.B(wm);
   }
 
   // Second, determine the hypothetical box's mIStart.
   // How we determine the hypothetical box depends on whether the element
   // would have been inline-level or block-level
-  if (mStyleDisplay->IsOriginalDisplayInlineOutsideStyle()) {
-    // The placeholder represents the left edge of the hypothetical box
+  if (mStyleDisplay->IsOriginalDisplayInlineOutsideStyle() ||
+      mFlags.mIOffsetsNeedCSSAlign) {
+    // The placeholder represents the IStart edge of the hypothetical box.
+    // (Or if mFlags.mIOffsetsNeedCSSAlign is set, it represents the IStart
+    // edge of the Alignment Container.)
     aHypotheticalPos.mIStart = placeholderOffset.I(wm);
   } else {
     aHypotheticalPos.mIStart = blockIStartContentEdge;
   }
 
   // The current coordinate space is that of the nearest block to the placeholder.
   // Convert to the coordinate space of the absolute containing block
   // One weird thing here is that for fixed-positioned elements we want to do