Bug 1269046 part 5: If an abspos child's offset depends on CSS Box Alignment, ask nsContainerFrame for the alignment enum to use, and align with CSSAlignUtils. r=mats

Right now, this method has only one stub impl, in nsContainerFrame; a later
patch will add a more interesting (overriding) impl in nsFlexContainerFrame.

MozReview-Commit-ID: 3U3vTTX4vdm
This commit is contained in:
Daniel Holbert
2016-10-31 08:58:18 -07:00
parent 6f4f739c51
commit a78dcebda8
3 changed files with 223 additions and 8 deletions

View File

@@ -1981,6 +1981,20 @@ nsContainerFrame::RenumberChildFrames(int32_t* aOrdinal,
return renumbered;
}
uint16_t
nsContainerFrame::CSSAlignmentForAbsPosChild(const ReflowInput& aChildRI,
LogicalAxis aLogicalAxis) const
{
MOZ_ASSERT(aChildRI.mFrame->IsAbsolutelyPositioned(),
"This method should only be called for abspos children");
NS_ERROR("Child classes that use css box alignment for abspos children "
"should provide their own implementation of this method!");
// In the unexpected/unlikely event that this implementation gets invoked,
// just use "start" alignment.
return NS_STYLE_ALIGN_START;
}
nsresult
nsContainerFrame::AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,