зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
7168e2649c
Коммит
1fa25f597f
|
@ -152,7 +152,11 @@ GetBoxRectForFrame(nsIFrame** aFrame, CSSBoxType aType)
|
||||||
case CSSBoxType::Content: r = f->GetContentRectRelativeToSelf(); break;
|
case CSSBoxType::Content: r = f->GetContentRectRelativeToSelf(); break;
|
||||||
case CSSBoxType::Padding: r = f->GetPaddingRectRelativeToSelf(); break;
|
case CSSBoxType::Padding: r = f->GetPaddingRectRelativeToSelf(); break;
|
||||||
case CSSBoxType::Border: r = nsRect(nsPoint(0, 0), f->GetSize()); 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;
|
default: MOZ_ASSERT(false, "unknown box type"); return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2531,7 +2531,7 @@ static void
|
||||||
UpdateProp(nsIFrame* aFrame,
|
UpdateProp(nsIFrame* aFrame,
|
||||||
const FramePropertyDescriptor<nsMargin>* aProperty,
|
const FramePropertyDescriptor<nsMargin>* aProperty,
|
||||||
bool aNeeded,
|
bool aNeeded,
|
||||||
const nsMargin& aNewValue)
|
nsMargin& aNewValue)
|
||||||
{
|
{
|
||||||
if (aNeeded) {
|
if (aNeeded) {
|
||||||
nsMargin* propValue = aFrame->GetProperty(aProperty);
|
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
|
// XXX fix to provide 0,0 for the top&bottom margins for
|
||||||
// inline-non-replaced elements
|
// inline-non-replaced elements
|
||||||
bool needMarginProp = ComputeMargin(aWM, aPercentBasis);
|
bool needMarginProp = ComputeMargin(aWM, aPercentBasis);
|
||||||
// Note that ComputeMargin() simplistically resolves 'auto' margins to 0.
|
// XXX We need to include 'auto' horizontal margins in this too!
|
||||||
// In formatting contexts where this isn't correct, some later code will
|
// ... but if we did that, we'd need to fix nsFrame::GetUsedMargin
|
||||||
// need to update the UsedMargin() property with the actual resolved value.
|
// to use it even when the margins are all zero (since sometimes
|
||||||
// One example of this is ::CalculateBlockSideMargins().
|
// they get treated as auto)
|
||||||
::UpdateProp(mFrame, nsIFrame::UsedMarginProperty(), needMarginProp,
|
::UpdateProp(mFrame, nsIFrame::UsedMarginProperty(), needMarginProp,
|
||||||
ComputedPhysicalMargin());
|
ComputedPhysicalMargin());
|
||||||
|
|
||||||
|
@ -2800,16 +2800,7 @@ ReflowInput::CalculateBlockSideMargins(LayoutFrameType aFrameType)
|
||||||
} else if (isAutoEndMargin) {
|
} else if (isAutoEndMargin) {
|
||||||
margin.IEnd(cbWM) += availMarginSpace;
|
margin.IEnd(cbWM) += availMarginSpace;
|
||||||
}
|
}
|
||||||
LogicalMargin marginInOurWM = margin.ConvertTo(mWritingMode, cbWM);
|
SetComputedLogicalMargin(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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NORMAL_LINE_HEIGHT_FACTOR 1.2f // in term of emHeight
|
#define NORMAL_LINE_HEIGHT_FACTOR 1.2f // in term of emHeight
|
||||||
|
|
|
@ -553,9 +553,6 @@ public:
|
||||||
bool NeedsMinSizeAutoResolution() const
|
bool NeedsMinSizeAutoResolution() const
|
||||||
{ return mNeedsMinSizeAutoResolution; }
|
{ return mNeedsMinSizeAutoResolution; }
|
||||||
|
|
||||||
bool HasAnyAutoMargin() const
|
|
||||||
{ return mHasAnyAutoMargin; }
|
|
||||||
|
|
||||||
// Indicates whether this item is a "strut" left behind by an element with
|
// Indicates whether this item is a "strut" left behind by an element with
|
||||||
// visibility:collapse.
|
// visibility:collapse.
|
||||||
bool IsStrut() const { return mIsStrut; }
|
bool IsStrut() const { return mIsStrut; }
|
||||||
|
@ -861,9 +858,6 @@ protected:
|
||||||
// Does this item need to resolve a min-[width|height]:auto (in main-axis).
|
// Does this item need to resolve a min-[width|height]:auto (in main-axis).
|
||||||
bool mNeedsMinSizeAutoResolution;
|
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"
|
uint8_t mAlignSelf; // My "align-self" computed value (with "auto"
|
||||||
// swapped out for parent"s "align-items" value,
|
// swapped out for parent"s "align-items" value,
|
||||||
// in our constructor).
|
// in our constructor).
|
||||||
|
@ -1822,7 +1816,7 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
|
||||||
mIsInlineAxisMainAxis(aAxisTracker.IsRowOriented() !=
|
mIsInlineAxisMainAxis(aAxisTracker.IsRowOriented() !=
|
||||||
aAxisTracker.GetWritingMode().IsOrthogonalTo(mWM))
|
aAxisTracker.GetWritingMode().IsOrthogonalTo(mWM))
|
||||||
// mNeedsMinSizeAutoResolution is initialized in CheckForMinSizeAuto()
|
// mNeedsMinSizeAutoResolution is initialized in CheckForMinSizeAuto()
|
||||||
// mAlignSelf, mHasAnyAutoMargin see below
|
// mAlignSelf, see below
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
|
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
|
||||||
MOZ_ASSERT(!mFrame->IsPlaceholderFrame(),
|
MOZ_ASSERT(!mFrame->IsPlaceholderFrame(),
|
||||||
|
@ -1859,16 +1853,12 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
|
||||||
SetFlexBaseSizeAndMainSize(aFlexBaseSize);
|
SetFlexBaseSizeAndMainSize(aFlexBaseSize);
|
||||||
CheckForMinSizeAuto(aFlexItemReflowInput, aAxisTracker);
|
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.
|
// 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.)
|
// (We'll resolve them later; until then, we want to treat them as 0-sized.)
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
{
|
{
|
||||||
|
const nsStyleSides& styleMargin =
|
||||||
|
aFlexItemReflowInput.mStyleMargin->mMargin;
|
||||||
NS_FOR_CSS_SIDES(side) {
|
NS_FOR_CSS_SIDES(side) {
|
||||||
if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
|
if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
|
||||||
MOZ_ASSERT(GetMarginComponentForSide(side) == 0,
|
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)
|
mIsStrut(true), // (this is the constructor for making struts, after all)
|
||||||
mIsInlineAxisMainAxis(true), // (doesn't matter b/c we're not doing layout)
|
mIsInlineAxisMainAxis(true), // (doesn't matter b/c we're not doing layout)
|
||||||
mNeedsMinSizeAutoResolution(false),
|
mNeedsMinSizeAutoResolution(false),
|
||||||
mHasAnyAutoMargin(false),
|
|
||||||
mAlignSelf(NS_STYLE_ALIGN_FLEX_START)
|
mAlignSelf(NS_STYLE_ALIGN_FLEX_START)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
|
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
|
||||||
|
@ -4766,16 +4755,6 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
||||||
*item, framePos, containerSize);
|
*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
|
// 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
|
// 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
|
// 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);
|
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
|
// If we're overriding the computed width or height, *and* we had an
|
||||||
// earlier "measuring" reflow, then this upcoming reflow needs to be
|
// earlier "measuring" reflow, then this upcoming reflow needs to be
|
||||||
// treated as a resize.
|
// treated as a resize.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче