Backed out 3 changesets (bug 1298008) for devtools failures on browser_boxmodel_pseudo-element.js CLOSED TREE

Backed out changeset c18e2aac48a5 (bug 1298008)
Backed out changeset b5a4113f4649 (bug 1298008)
Backed out changeset 40f53976a5b8 (bug 1298008)
This commit is contained in:
Brindusan Cristian 2018-03-30 23:10:23 +03:00
Родитель 7168e2649c
Коммит 1fa25f597f
3 изменённых файлов: 18 добавлений и 40 удалений

Просмотреть файл

@ -152,7 +152,11 @@ GetBoxRectForFrame(nsIFrame** aFrame, CSSBoxType aType)
case CSSBoxType::Content: r = f->GetContentRectRelativeToSelf(); break;
case CSSBoxType::Padding: r = f->GetPaddingRectRelativeToSelf(); break;
case CSSBoxType::Border: r = nsRect(nsPoint(0, 0), f->GetSize()); break;
case CSSBoxType::Margin: r = f->GetMarginRectRelativeToSelf(); break;
case CSSBoxType::Margin: {
r = nsRect(nsPoint(0, 0), f->GetSize());
r.Inflate(f->GetUsedMargin());
break;
}
default: MOZ_ASSERT(false, "unknown box type"); return r;
}

Просмотреть файл

@ -2531,7 +2531,7 @@ static void
UpdateProp(nsIFrame* aFrame,
const FramePropertyDescriptor<nsMargin>* aProperty,
bool aNeeded,
const nsMargin& aNewValue)
nsMargin& aNewValue)
{
if (aNeeded) {
nsMargin* propValue = aFrame->GetProperty(aProperty);
@ -2566,10 +2566,10 @@ SizeComputationInput::InitOffsets(WritingMode aWM,
// XXX fix to provide 0,0 for the top&bottom margins for
// inline-non-replaced elements
bool needMarginProp = ComputeMargin(aWM, aPercentBasis);
// Note that ComputeMargin() simplistically resolves 'auto' margins to 0.
// In formatting contexts where this isn't correct, some later code will
// need to update the UsedMargin() property with the actual resolved value.
// One example of this is ::CalculateBlockSideMargins().
// XXX We need to include 'auto' horizontal margins in this too!
// ... but if we did that, we'd need to fix nsFrame::GetUsedMargin
// to use it even when the margins are all zero (since sometimes
// they get treated as auto)
::UpdateProp(mFrame, nsIFrame::UsedMarginProperty(), needMarginProp,
ComputedPhysicalMargin());
@ -2800,16 +2800,7 @@ ReflowInput::CalculateBlockSideMargins(LayoutFrameType aFrameType)
} else if (isAutoEndMargin) {
margin.IEnd(cbWM) += availMarginSpace;
}
LogicalMargin marginInOurWM = margin.ConvertTo(mWritingMode, cbWM);
SetComputedLogicalMargin(marginInOurWM);
if (isAutoStartMargin || isAutoEndMargin) {
// Update the UsedMargin property if we were tracking it already.
nsMargin* propValue = mFrame->GetProperty(nsIFrame::UsedMarginProperty());
if (propValue) {
*propValue = marginInOurWM.GetPhysicalMargin(mWritingMode);
}
}
SetComputedLogicalMargin(margin.ConvertTo(mWritingMode, cbWM));
}
#define NORMAL_LINE_HEIGHT_FACTOR 1.2f // in term of emHeight

Просмотреть файл

@ -553,9 +553,6 @@ public:
bool NeedsMinSizeAutoResolution() const
{ return mNeedsMinSizeAutoResolution; }
bool HasAnyAutoMargin() const
{ return mHasAnyAutoMargin; }
// Indicates whether this item is a "strut" left behind by an element with
// visibility:collapse.
bool IsStrut() const { return mIsStrut; }
@ -861,9 +858,6 @@ protected:
// Does this item need to resolve a min-[width|height]:auto (in main-axis).
bool mNeedsMinSizeAutoResolution;
// Does this item have an auto margin in either main or cross axis?
bool mHasAnyAutoMargin;
uint8_t mAlignSelf; // My "align-self" computed value (with "auto"
// swapped out for parent"s "align-items" value,
// in our constructor).
@ -1822,7 +1816,7 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
mIsInlineAxisMainAxis(aAxisTracker.IsRowOriented() !=
aAxisTracker.GetWritingMode().IsOrthogonalTo(mWM))
// mNeedsMinSizeAutoResolution is initialized in CheckForMinSizeAuto()
// mAlignSelf, mHasAnyAutoMargin see below
// mAlignSelf, see below
{
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
MOZ_ASSERT(!mFrame->IsPlaceholderFrame(),
@ -1859,16 +1853,12 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
SetFlexBaseSizeAndMainSize(aFlexBaseSize);
CheckForMinSizeAuto(aFlexItemReflowInput, aAxisTracker);
const nsStyleSides& styleMargin =
aFlexItemReflowInput.mStyleMargin->mMargin;
mHasAnyAutoMargin = styleMargin.HasInlineAxisAuto(mWM) ||
styleMargin.HasBlockAxisAuto(mWM);
// Assert that any "auto" margin components are set to 0.
// (We'll resolve them later; until then, we want to treat them as 0-sized.)
#ifdef DEBUG
{
const nsStyleSides& styleMargin =
aFlexItemReflowInput.mStyleMargin->mMargin;
NS_FOR_CSS_SIDES(side) {
if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
MOZ_ASSERT(GetMarginComponentForSide(side) == 0,
@ -1929,7 +1919,6 @@ FlexItem::FlexItem(nsIFrame* aChildFrame, nscoord aCrossSize,
mIsStrut(true), // (this is the constructor for making struts, after all)
mIsInlineAxisMainAxis(true), // (doesn't matter b/c we're not doing layout)
mNeedsMinSizeAutoResolution(false),
mHasAnyAutoMargin(false),
mAlignSelf(NS_STYLE_ALIGN_FLEX_START)
{
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
@ -4766,16 +4755,6 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
*item, framePos, containerSize);
}
// If the item has auto margins, and we were tracking the UsedMargin
// property, set the property to the computed margin values.
if (item->HasAnyAutoMargin()) {
nsMargin* propValue =
item->Frame()->GetProperty(nsIFrame::UsedMarginProperty());
if (propValue) {
*propValue = item->GetMargin();
}
}
// If this is our first item and we haven't established a baseline for
// the container yet (i.e. if we don't have 'align-self: baseline' on any
// children), then use this child's first baseline as the container's
@ -4976,6 +4955,10 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
aItem.Frame()->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
}
// XXXdholbert Might need to actually set the correct margins in the
// reflow state at some point, so that they can be saved on the frame for
// UsedMarginProperty(). Maybe doesn't matter though...?
// If we're overriding the computed width or height, *and* we had an
// earlier "measuring" reflow, then this upcoming reflow needs to be
// treated as a resize.