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
--- 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