Bug 1322570 Part 2 - Resolve {align,justify}-self using StyleContext from alignment container frame in ReflowInput::InitConstraints(). r=dholbert

Per bug 1322570 comment 46, it's not easy to replace ComputedJustifyItems()
and UsedJustifySelf()'s internal nsStyleContext::GetParent() without
correctness penalty, so we use GetParentAllowServo() for now.

Also, fix the reftest.list added in bug 1334403 which incorrectly wrote test
page as reference page.

MozReview-Commit-ID: 6kAAWSFojd5
This commit is contained in:
Ting-Yu Lin
2017-03-20 14:12:08 +08:00
parent fefa431928
commit 6b854b6f48
5 changed files with 11 additions and 9 deletions

View File

@@ -2399,9 +2399,10 @@ ReflowInput::InitConstraints(nsPresContext* aPresContext,
if (alignCBType == nsGkAtoms::gridContainerFrame) {
// Shrink-wrap grid items that will be aligned (rather than stretched)
// in its inline axis.
auto inlineAxisAlignment = wm.IsOrthogonalTo(cbwm) ?
mStylePosition->UsedAlignSelf(mFrame->StyleContext()->GetParent()) :
mStylePosition->UsedJustifySelf(mFrame->StyleContext()->GetParent());
auto inlineAxisAlignment =
wm.IsOrthogonalTo(cbwm)
? mStylePosition->UsedAlignSelf(alignCB->StyleContext())
: mStylePosition->UsedJustifySelf(alignCB->StyleContext());
if ((inlineAxisAlignment != NS_STYLE_ALIGN_STRETCH &&
inlineAxisAlignment != NS_STYLE_ALIGN_NORMAL) ||
mStyleMargin->mMargin.GetIStartUnit(wm) == eStyleUnit_Auto ||