Backed out 12 changesets (bug 1269045, bug 1269046) as the most likely cause of Windows build bustage

CLOSED TREE

Backed out changeset 16db55b642a9 (bug 1269046)
Backed out changeset a0008dd33cf4 (bug 1269046)
Backed out changeset 75b58c4e61e6 (bug 1269046)
Backed out changeset fb7655f3e1cf (bug 1269046)
Backed out changeset 8088e5a9e6e3 (bug 1269046)
Backed out changeset eea6479452f0 (bug 1269046)
Backed out changeset eb4b52bf06ec (bug 1269046)
Backed out changeset 539db74e4a88 (bug 1269046)
Backed out changeset f57f9ac1435e (bug 1269045)
Backed out changeset 2162d5c9fb54 (bug 1269045)
Backed out changeset 7aa8199183fc (bug 1269045)
Backed out changeset 86a391e3e163 (bug 1269045)

MozReview-Commit-ID: HYL7Bh8l02E
This commit is contained in:
Phil Ringnalda
2016-10-27 21:59:00 -07:00
parent 71884f4a18
commit 04ae3c60e8
110 changed files with 253 additions and 9553 deletions

View File

@@ -236,24 +236,11 @@ PhysicalCoordFromFlexRelativeCoord(nscoord aFlexRelativeCoord,
wm_.IsOrthogonalTo(axisTracker_.GetWritingMode()) != \
(axisTracker_).IsRowOriented() ? (bsize_) : (isize_)
// Flags to customize behavior of the FlexboxAxisTracker constructor:
enum AxisTrackerFlags {
eNoFlags = 0x0,
// Normally, FlexboxAxisTracker may attempt to reverse axes & iteration order
// to avoid bottom-to-top child ordering, for saner pagination. This flag
// suppresses that behavior (so that we allow bottom-to-top child ordering).
// (This may be helpful e.g. when we're only dealing with a single child.)
eAllowBottomToTopChildOrdering = 0x1
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(AxisTrackerFlags)
// Encapsulates our flex container's main & cross axes.
class MOZ_STACK_CLASS nsFlexContainerFrame::FlexboxAxisTracker {
public:
FlexboxAxisTracker(const nsFlexContainerFrame* aFlexContainer,
const WritingMode& aWM,
AxisTrackerFlags aFlags = eNoFlags);
const WritingMode& aWM);
// Accessors:
// XXXdholbert [BEGIN DEPRECATED]
@@ -1094,6 +1081,8 @@ IsOrderLEQWithDOMFallback(nsIFrame* aFrame1,
"this method only intended for comparing flex items");
MOZ_ASSERT(aFrame1->GetParent() == aFrame2->GetParent(),
"this method only intended for comparing siblings");
bool isInLegacyBox = nsFlexContainerFrame::IsLegacyBox(aFrame1->GetParent());
if (aFrame1 == aFrame2) {
// Anything is trivially LEQ itself, so we return "true" here... but it's
// probably bad if we end up actually needing this, so let's assert.
@@ -1101,21 +1090,17 @@ IsOrderLEQWithDOMFallback(nsIFrame* aFrame1,
return true;
}
if (aFrame1->GetType() == nsGkAtoms::placeholderFrame ||
aFrame2->GetType() == nsGkAtoms::placeholderFrame) {
// Treat placeholders (for abspos/fixedpos frames) as LEQ everything. This
// ensures we don't reorder them w.r.t. one another, which is sufficient to
// prevent them from noticeably participating in "order" reordering.
return true;
}
// If we've got a placeholder frame, use its out-of-flow frame's 'order' val.
{
nsIFrame* aRealFrame1 = nsPlaceholderFrame::GetRealFrameFor(aFrame1);
nsIFrame* aRealFrame2 = nsPlaceholderFrame::GetRealFrameFor(aFrame2);
bool isInLegacyBox = nsFlexContainerFrame::IsLegacyBox(aFrame1->GetParent());
int32_t order1 = GetOrderOrBoxOrdinalGroup(aRealFrame1, isInLegacyBox);
int32_t order2 = GetOrderOrBoxOrdinalGroup(aRealFrame2, isInLegacyBox);
int32_t order1 = GetOrderOrBoxOrdinalGroup(aFrame1, isInLegacyBox);
int32_t order2 = GetOrderOrBoxOrdinalGroup(aFrame2, isInLegacyBox);
if (order1 != order2) {
return order1 < order2;
if (order1 != order2) {
return order1 < order2;
}
}
// The "order" values are equal, so we need to fall back on DOM comparison.
@@ -1134,8 +1119,10 @@ IsOrderLEQWithDOMFallback(nsIFrame* aFrame1,
// recognize generated content as being an actual sibling of other nodes.
// We know where ::before and ::after nodes *effectively* insert in the DOM
// tree, though (at the beginning & end), so we can just special-case them.
nsIAtom* pseudo1 = aFrame1->StyleContext()->GetPseudo();
nsIAtom* pseudo2 = aFrame2->StyleContext()->GetPseudo();
nsIAtom* pseudo1 =
nsPlaceholderFrame::GetRealFrameFor(aFrame1)->StyleContext()->GetPseudo();
nsIAtom* pseudo2 =
nsPlaceholderFrame::GetRealFrameFor(aFrame2)->StyleContext()->GetPseudo();
if (pseudo1 == nsCSSPseudoElements::before ||
pseudo2 == nsCSSPseudoElements::after) {
@@ -1178,150 +1165,18 @@ IsOrderLEQ(nsIFrame* aFrame1,
"this method only intended for comparing flex items");
MOZ_ASSERT(aFrame1->GetParent() == aFrame2->GetParent(),
"this method only intended for comparing siblings");
if (aFrame1->GetType() == nsGkAtoms::placeholderFrame ||
aFrame2->GetType() == nsGkAtoms::placeholderFrame) {
// Treat placeholders (for abspos/fixedpos frames) as LEQ everything. This
// ensures we don't reorder them w.r.t. one another, which is sufficient to
// prevent them from noticeably participating in "order" reordering.
return true;
}
bool isInLegacyBox = nsFlexContainerFrame::IsLegacyBox(aFrame1->GetParent());
int32_t order1 = GetOrderOrBoxOrdinalGroup(aFrame1, isInLegacyBox);
int32_t order2 = GetOrderOrBoxOrdinalGroup(aFrame2, isInLegacyBox);
// If we've got a placeholder frame, use its out-of-flow frame's 'order' val.
nsIFrame* aRealFrame1 = nsPlaceholderFrame::GetRealFrameFor(aFrame1);
nsIFrame* aRealFrame2 = nsPlaceholderFrame::GetRealFrameFor(aFrame2);
int32_t order1 = GetOrderOrBoxOrdinalGroup(aRealFrame1, isInLegacyBox);
int32_t order2 = GetOrderOrBoxOrdinalGroup(aRealFrame2, isInLegacyBox);
return order1 <= order2;
}
uint8_t
SimplifyAlignOrJustifyContentForOneItem(uint16_t aAlignmentVal,
bool aIsAlign)
{
// Mask away any explicit fallback, to get the main (non-fallback) part of
// the specified value:
uint16_t specified = aAlignmentVal & NS_STYLE_ALIGN_ALL_BITS;
// XXX strip off <overflow-position> bits until we implement it (bug 1311892)
specified &= ~NS_STYLE_ALIGN_FLAG_BITS;
// FIRST: handle a special-case for "justify-content:stretch" (or equivalent),
// which requires that we ignore any author-provided explicit fallback value.
if (specified == NS_STYLE_ALIGN_NORMAL) {
// In a flex container, *-content: "'normal' behaves as 'stretch'".
// Do that conversion early, so it benefits from our 'stretch' special-case.
// https://drafts.csswg.org/css-align-3/#distribution-flex
specified = NS_STYLE_ALIGN_STRETCH;
}
if (!aIsAlign && specified == NS_STYLE_ALIGN_STRETCH) {
// In a flex container, in "justify-content Axis: [...] 'stretch' behaves
// as 'flex-start' (ignoring the specified fallback alignment, if any)."
// https://drafts.csswg.org/css-align-3/#distribution-flex
// So, we just directly return 'flex-start', & ignore explicit fallback..
return NS_STYLE_ALIGN_FLEX_START;
}
// Now check for an explicit fallback value (and if it's present, use it).
uint16_t explicitFallback = aAlignmentVal >> NS_STYLE_ALIGN_ALL_SHIFT;
if (explicitFallback) {
// XXX strip off <overflow-position> bits until we implement it
// (bug 1311892)
explicitFallback &= ~NS_STYLE_ALIGN_FLAG_BITS;
return explicitFallback;
}
// There's no explicit fallback. Use the implied fallback values for
// space-{between,around,evenly} (since those values only make sense with
// multiple alignment subjects), and otherwise just use the specified value:
switch (specified) {
case NS_STYLE_ALIGN_SPACE_BETWEEN:
return NS_STYLE_ALIGN_START;
case NS_STYLE_ALIGN_SPACE_AROUND:
case NS_STYLE_ALIGN_SPACE_EVENLY:
return NS_STYLE_ALIGN_CENTER;
default:
return specified;
}
}
uint16_t
nsFlexContainerFrame::CSSAlignmentForAbsPosChild(
const ReflowInput& aChildRI,
LogicalAxis aLogicalAxis) const
{
WritingMode wm = GetWritingMode();
const FlexboxAxisTracker
axisTracker(this, wm, AxisTrackerFlags::eAllowBottomToTopChildOrdering);
// If we're row-oriented and the caller is asking about our inline axis (or
// alternately, if we're column-oriented and the caller is asking about our
// block axis), then the caller is really asking about our *main* axis.
// Otherwise, the caller is asking about our cross axis.
const bool isMainAxis = (axisTracker.IsRowOriented() ==
(aLogicalAxis == eLogicalAxisInline));
const nsStylePosition* containerStylePos = StylePosition();
const bool isAxisReversed = isMainAxis ? axisTracker.IsMainAxisReversed()
: axisTracker.IsCrossAxisReversed();
uint8_t alignment;
if (isMainAxis) {
alignment = SimplifyAlignOrJustifyContentForOneItem(
containerStylePos->mJustifyContent,
/*aIsAlign = */false);
} else {
const uint8_t alignContent = SimplifyAlignOrJustifyContentForOneItem(
containerStylePos->mAlignContent,
/*aIsAlign = */true);
if (NS_STYLE_FLEX_WRAP_NOWRAP != containerStylePos->mFlexWrap &&
alignContent != NS_STYLE_ALIGN_STRETCH) {
// Multi-line, align-content isn't stretch --> align-content determines
// this child's alignment in the cross axis.
alignment = alignContent;
} else {
// Single-line, or multi-line but the (one) line stretches to fill
// container. Respect align-self.
alignment = aChildRI.mStylePosition->UsedAlignSelf(nullptr);
// XXX strip off <overflow-position> bits until we implement it
// (bug 1311892)
alignment &= ~NS_STYLE_ALIGN_FLAG_BITS;
if (alignment == NS_STYLE_ALIGN_NORMAL) {
// "the 'normal' keyword behaves as 'start' on replaced
// absolutely-positioned boxes, and behaves as 'stretch' on all other
// absolutely-positioned boxes."
// https://drafts.csswg.org/css-align/#align-abspos
alignment = aChildRI.mFrame->IsFrameOfType(nsIFrame::eReplaced) ?
NS_STYLE_ALIGN_START : NS_STYLE_ALIGN_STRETCH;
}
}
}
// Resolve flex-start, flex-end, auto, left, right, baseline, last-baseline;
if (alignment == NS_STYLE_ALIGN_FLEX_START) {
alignment = isAxisReversed ? NS_STYLE_ALIGN_END : NS_STYLE_ALIGN_START;
} else if (alignment == NS_STYLE_ALIGN_FLEX_END) {
alignment = isAxisReversed ? NS_STYLE_ALIGN_START : NS_STYLE_ALIGN_END;
} else if (alignment == NS_STYLE_ALIGN_AUTO) {
alignment = NS_STYLE_ALIGN_START;
} else if (alignment == NS_STYLE_ALIGN_LEFT ||
alignment == NS_STYLE_ALIGN_RIGHT) {
if (aLogicalAxis == eLogicalAxisInline) {
const bool isLeft = (alignment == NS_STYLE_ALIGN_LEFT);
alignment = (isLeft == wm.IsBidiLTR()) ? NS_STYLE_ALIGN_START
: NS_STYLE_ALIGN_END;
} else {
alignment = NS_STYLE_ALIGN_START;
}
} else if (alignment == NS_STYLE_ALIGN_BASELINE) {
alignment = NS_STYLE_ALIGN_START;
} else if (alignment == NS_STYLE_ALIGN_LAST_BASELINE) {
alignment = NS_STYLE_ALIGN_END;
}
return alignment;
}
bool
nsFlexContainerFrame::IsHorizontal()
{
@@ -3380,8 +3235,7 @@ BlockDirToAxisOrientation(WritingMode::BlockDir aBlockDir)
FlexboxAxisTracker::FlexboxAxisTracker(
const nsFlexContainerFrame* aFlexContainer,
const WritingMode& aWM,
AxisTrackerFlags aFlags)
const WritingMode& aWM)
: mWM(aWM),
mAreAxesInternallyReversed(false)
{
@@ -3397,10 +3251,7 @@ FlexboxAxisTracker::FlexboxAxisTracker(
// this special-case code path to be compared against the normal code path.)
static bool sPreventBottomToTopChildOrdering = true;
// Note: if the eAllowBottomToTopChildOrdering flag is set, that overrides
// the static boolean and makes us skip this special case.
if (!(aFlags & AxisTrackerFlags::eAllowBottomToTopChildOrdering) &&
sPreventBottomToTopChildOrdering) {
if (sPreventBottomToTopChildOrdering) {
// If either axis is bottom-to-top, we flip both axes (and set a flag
// so that we can flip some logic to make the reversal transparent).
if (eAxis_BT == mMainAxis || eAxis_BT == mCrossAxis) {
@@ -3545,8 +3396,7 @@ nsFlexContainerFrame::GenerateFlexLines(
nscoord aAvailableBSizeForContent,
const nsTArray<StrutInfo>& aStruts,
const FlexboxAxisTracker& aAxisTracker,
nsTArray<nsIFrame*>& aPlaceholders, /* out */
LinkedList<FlexLine>& aLines /* out */)
LinkedList<FlexLine>& aLines)
{
MOZ_ASSERT(aLines.isEmpty(), "Expecting outparam to start out empty");
@@ -3603,12 +3453,6 @@ nsFlexContainerFrame::GenerateFlexLines(
uint32_t itemIdxInContainer = 0;
for (nsIFrame* childFrame : mFrames) {
// Don't create flex items / lines for placeholder frames:
if (childFrame->GetType() == nsGkAtoms::placeholderFrame) {
aPlaceholders.AppendElement(childFrame);
continue;
}
// Honor "page-break-before", if we're multi-line and this line isn't empty:
if (!isSingleLine && !curLine->IsEmpty() &&
childFrame->StyleDisplay()->mBreakBefore) {
@@ -4184,14 +4028,12 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
aStatus = NS_FRAME_COMPLETE;
LinkedList<FlexLine> lines;
nsTArray<nsIFrame*> placeholderKids;
AutoFlexLineListClearer cleanupLines(lines);
GenerateFlexLines(aPresContext, aReflowInput,
aContentBoxMainSize,
aAvailableBSizeForContent,
aStruts, aAxisTracker,
placeholderKids, lines);
aStruts, aAxisTracker, lines);
aContentBoxMainSize =
ResolveFlexContainerMainSize(aReflowInput, aAxisTracker,
@@ -4420,12 +4262,6 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
}
}
if (!placeholderKids.IsEmpty()) {
ReflowPlaceholders(aPresContext, aReflowInput,
placeholderKids, containerContentBoxOrigin,
containerSize);
}
// Compute flex container's desired size (in its own writing-mode),
// starting w/ content-box size & growing from there:
LogicalSize desiredSizeInFlexWM =
@@ -4627,42 +4463,6 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
aItem.SetAscent(childDesiredSize.BlockStartAscent());
}
void
nsFlexContainerFrame::ReflowPlaceholders(nsPresContext* aPresContext,
const ReflowInput& aReflowInput,
nsTArray<nsIFrame*>& aPlaceholders,
const LogicalPoint& aContentBoxOrigin,
const nsSize& aContainerSize)
{
WritingMode outerWM = aReflowInput.GetWritingMode();
// As noted in this method's documentation, we'll reflow every entry in
// |aPlaceholders| at the container's content-box origin.
for (nsIFrame* placeholder : aPlaceholders) {
MOZ_ASSERT(placeholder->GetType() == nsGkAtoms::placeholderFrame,
"placeholders array should only contain placeholder frames");
WritingMode wm = placeholder->GetWritingMode();
LogicalSize availSize = aReflowInput.ComputedSize(wm);
ReflowInput childReflowInput(aPresContext, aReflowInput,
placeholder, availSize);
ReflowOutput childDesiredSize(childReflowInput);
nsReflowStatus childReflowStatus;
ReflowChild(placeholder, aPresContext,
childDesiredSize, childReflowInput,
outerWM, aContentBoxOrigin, aContainerSize, 0,
childReflowStatus);
FinishReflowChild(placeholder, aPresContext,
childDesiredSize, &childReflowInput,
outerWM, aContentBoxOrigin, aContainerSize, 0);
// Mark the placeholder frame to indicate that it's not actually at the
// element's static position, because we need to apply CSS Alignment after
// we determine the OOF's size:
placeholder->AddStateBits(PLACEHOLDER_STATICPOS_NEEDS_CSSALIGN);
}
}
/* virtual */ nscoord
nsFlexContainerFrame::GetMinISize(nsRenderingContext* aRenderingContext)
{