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 draft
authorDaniel Holbert <dholbert@cs.stanford.edu>
Mon, 07 Nov 2016 12:45:32 -0800
changeset 435076 61c3677ace82a9265a55434aa0ad013838cdb8ec
parent 435075 26e6b54fe3ba382815bb517a1d118fb452df3171
child 435077 1af7172db9edb6ecb5e66ca68ed15109cb383873
push id34928
push userdholbert@mozilla.com
push dateTue, 08 Nov 2016 00:57:02 +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