зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1304012 -- Part 2: Rename nsStyleStruct Computed**Self functions to Used**Self. r=dholbert
MozReview-Commit-ID: FCBuT2Z7sy6
This commit is contained in:
Родитель
b9a57c7d02
Коммит
2fe8e4a753
|
@ -5531,8 +5531,8 @@ nsLayoutUtils::ComputeSizeWithIntrinsicDimensions(WritingMode aWM,
|
|||
!aFrame->StyleMargin()->HasBlockAxisAuto(aWM)) {
|
||||
auto blockAxisAlignment =
|
||||
!aWM.IsOrthogonalTo(aFrame->GetParent()->GetWritingMode()) ?
|
||||
stylePos->ComputedAlignSelf(aFrame->StyleContext()->GetParent()) :
|
||||
stylePos->ComputedJustifySelf(aFrame->StyleContext()->GetParent());
|
||||
stylePos->UsedAlignSelf(aFrame->StyleContext()->GetParent()) :
|
||||
stylePos->UsedJustifySelf(aFrame->StyleContext()->GetParent());
|
||||
if (blockAxisAlignment == NS_STYLE_ALIGN_NORMAL ||
|
||||
blockAxisAlignment == NS_STYLE_ALIGN_STRETCH) {
|
||||
bSize = std::max(nscoord(0), cbSize -
|
||||
|
|
|
@ -2318,8 +2318,8 @@ ReflowInput::InitConstraints(nsPresContext* aPresContext,
|
|||
// Shrink-wrap grid items that will be aligned (rather than stretched)
|
||||
// in its inline axis.
|
||||
auto inlineAxisAlignment = wm.IsOrthogonalTo(cbwm) ?
|
||||
mStylePosition->ComputedAlignSelf(mFrame->StyleContext()->GetParent()) :
|
||||
mStylePosition->ComputedJustifySelf(mFrame->StyleContext()->GetParent());
|
||||
mStylePosition->UsedAlignSelf(mFrame->StyleContext()->GetParent()) :
|
||||
mStylePosition->UsedJustifySelf(mFrame->StyleContext()->GetParent());
|
||||
if ((inlineAxisAlignment != NS_STYLE_ALIGN_STRETCH &&
|
||||
inlineAxisAlignment != NS_STYLE_ALIGN_NORMAL) ||
|
||||
mStyleMargin->mMargin.GetIStartUnit(wm) == eStyleUnit_Auto ||
|
||||
|
|
|
@ -1717,7 +1717,7 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
|
|||
const nsStyleXUL* containerStyleXUL = containerRS->mFrame->StyleXUL();
|
||||
mAlignSelf = ConvertLegacyStyleToAlignItems(containerStyleXUL);
|
||||
} else {
|
||||
mAlignSelf = aFlexItemReflowInput.mStylePosition->ComputedAlignSelf(
|
||||
mAlignSelf = aFlexItemReflowInput.mStylePosition->UsedAlignSelf(
|
||||
containerRS->mFrame->StyleContext());
|
||||
if (MOZ_LIKELY(mAlignSelf == NS_STYLE_ALIGN_NORMAL)) {
|
||||
mAlignSelf = NS_STYLE_ALIGN_STRETCH;
|
||||
|
|
|
@ -4770,8 +4770,8 @@ nsFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
|||
!StyleMargin()->HasBlockAxisAuto(aWM)) {
|
||||
auto blockAxisAlignment =
|
||||
!aWM.IsOrthogonalTo(GetParent()->GetWritingMode()) ?
|
||||
StylePosition()->ComputedAlignSelf(StyleContext()->GetParent()) :
|
||||
StylePosition()->ComputedJustifySelf(StyleContext()->GetParent());
|
||||
StylePosition()->UsedAlignSelf(StyleContext()->GetParent()) :
|
||||
StylePosition()->UsedJustifySelf(StyleContext()->GetParent());
|
||||
if (blockAxisAlignment == NS_STYLE_ALIGN_NORMAL ||
|
||||
blockAxisAlignment == NS_STYLE_ALIGN_STRETCH) {
|
||||
result.BSize(aWM) = std::max(nscoord(0), cbSize -
|
||||
|
|
|
@ -3932,8 +3932,8 @@ nsGridContainerFrame::Tracks::InitializeItemBaselines(
|
|||
if (itemHasBaselineParallelToTrack) {
|
||||
// [align|justify]-self:[last-]baseline.
|
||||
auto selfAlignment = isOrthogonal ?
|
||||
child->StylePosition()->ComputedJustifySelf(containerSC) :
|
||||
child->StylePosition()->ComputedAlignSelf(containerSC);
|
||||
child->StylePosition()->UsedJustifySelf(containerSC) :
|
||||
child->StylePosition()->UsedAlignSelf(containerSC);
|
||||
selfAlignment &= ~NS_STYLE_ALIGN_FLAG_BITS;
|
||||
if (selfAlignment == NS_STYLE_ALIGN_BASELINE) {
|
||||
state |= ItemState::eFirstBaseline | ItemState::eSelfBaseline;
|
||||
|
@ -4897,7 +4897,7 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
|
|||
if (!childRI.mStyleMargin->HasBlockAxisAuto(childWM) &&
|
||||
childRI.mStylePosition->BSize(childWM).GetUnit() == eStyleUnit_Auto) {
|
||||
auto blockAxisAlignment =
|
||||
childRI.mStylePosition->ComputedAlignSelf(StyleContext());
|
||||
childRI.mStylePosition->UsedAlignSelf(StyleContext());
|
||||
if (blockAxisAlignment == NS_STYLE_ALIGN_NORMAL ||
|
||||
blockAxisAlignment == NS_STYLE_ALIGN_STRETCH) {
|
||||
stretch = true;
|
||||
|
@ -4924,7 +4924,7 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
|
|||
if (MOZ_LIKELY(isGridItem)) {
|
||||
LogicalSize size = childSize.Size(childWM); // from the ReflowChild()
|
||||
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||
auto align = childRI.mStylePosition->ComputedAlignSelf(containerSC);
|
||||
auto align = childRI.mStylePosition->UsedAlignSelf(containerSC);
|
||||
auto state = aGridItemInfo->mState[eLogicalAxisBlock];
|
||||
if (state & ItemState::eContentBaseline) {
|
||||
align = (state & ItemState::eFirstBaseline) ? NS_STYLE_ALIGN_SELF_START
|
||||
|
@ -4933,7 +4933,7 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
|
|||
nscoord cbsz = cb.BSize(wm) - consumedGridAreaBSize;
|
||||
AlignSelf(*aGridItemInfo, align, cbsz, wm, childRI, size, &childPos);
|
||||
}
|
||||
auto justify = childRI.mStylePosition->ComputedJustifySelf(containerSC);
|
||||
auto justify = childRI.mStylePosition->UsedJustifySelf(containerSC);
|
||||
auto state = aGridItemInfo->mState[eLogicalAxisInline];
|
||||
if (state & ItemState::eContentBaseline) {
|
||||
justify = (state & ItemState::eFirstBaseline) ? NS_STYLE_JUSTIFY_SELF_START
|
||||
|
|
|
@ -1686,7 +1686,7 @@ nsStylePosition::WidthCoordDependsOnContainer(const nsStyleCoord &aCoord)
|
|||
}
|
||||
|
||||
uint8_t
|
||||
nsStylePosition::ComputedAlignSelf(nsStyleContext* aParent) const
|
||||
nsStylePosition::UsedAlignSelf(nsStyleContext* aParent) const
|
||||
{
|
||||
if (mAlignSelf != NS_STYLE_ALIGN_AUTO) {
|
||||
return mAlignSelf;
|
||||
|
@ -1719,7 +1719,7 @@ nsStylePosition::ComputedJustifyItems(nsStyleContext* aParent) const
|
|||
}
|
||||
|
||||
uint8_t
|
||||
nsStylePosition::ComputedJustifySelf(nsStyleContext* aParent) const
|
||||
nsStylePosition::UsedJustifySelf(nsStyleContext* aParent) const
|
||||
{
|
||||
if (mJustifySelf != NS_STYLE_JUSTIFY_AUTO) {
|
||||
return mJustifySelf;
|
||||
|
|
|
@ -1718,10 +1718,10 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePosition
|
|||
uint8_t ComputedAlignItems() const { return mAlignItems; }
|
||||
|
||||
/**
|
||||
* Return the computed value for 'align-self' given our parent StyleContext
|
||||
* Return the used value for 'align-self' given our parent StyleContext
|
||||
* aParent (or null for the root).
|
||||
*/
|
||||
uint8_t ComputedAlignSelf(nsStyleContext* aParent) const;
|
||||
uint8_t UsedAlignSelf(nsStyleContext* aParent) const;
|
||||
|
||||
/**
|
||||
* Return the computed value for 'justify-content'.
|
||||
|
@ -1735,10 +1735,10 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePosition
|
|||
uint8_t ComputedJustifyItems(nsStyleContext* aParent) const;
|
||||
|
||||
/**
|
||||
* Return the computed value for 'justify-self' given our parent StyleContext
|
||||
* Return the used value for 'justify-self' given our parent StyleContext
|
||||
* aParent (or null for the root).
|
||||
*/
|
||||
uint8_t ComputedJustifySelf(nsStyleContext* aParent) const;
|
||||
uint8_t UsedJustifySelf(nsStyleContext* aParent) const;
|
||||
|
||||
mozilla::Position mObjectPosition; // [reset]
|
||||
nsStyleSides mOffset; // [reset] coord, percent, calc, auto
|
||||
|
|
Загрузка…
Ссылка в новой задаче