Bug 958714 Remove special case for flex & grid items' percent block-axis margin/padding resolution, to align with other browsers

This commit is contained in:
janekptacijarabaci 2018-07-20 09:09:36 +02:00 committed by Roy Tam
commit a99820e3ab
8 changed files with 30 additions and 51 deletions

View file

@ -2142,14 +2142,11 @@ OffsetPercentBasis(const nsIFrame* aFrame,
WritingMode aWM,
const LogicalSize& aContainingBlockSize)
{
// XXX The next patch in this series will get rid of this function and have
// the upstream/downstream code just work with the one nscoord value that
// we'll be dealing with now (which is aContainingBlockSize.ISize(aWM)).
LogicalSize offsetPercentBasis = aContainingBlockSize;
if (MOZ_LIKELY(!aFrame->GetParent() ||
!aFrame->GetParent()->IsFlexOrGridContainer())) {
offsetPercentBasis.BSize(aWM) = offsetPercentBasis.ISize(aWM);
} else if (offsetPercentBasis.BSize(aWM) == NS_AUTOHEIGHT) {
offsetPercentBasis.BSize(aWM) = 0;
}
offsetPercentBasis.BSize(aWM) = offsetPercentBasis.ISize(aWM);
return offsetPercentBasis;
}