diff --git a/mozilla/content/base/src/nsStyleContext.cpp b/mozilla/content/base/src/nsStyleContext.cpp index 232805daf44..d1200c9093d 100644 --- a/mozilla/content/base/src/nsStyleContext.cpp +++ b/mozilla/content/base/src/nsStyleContext.cpp @@ -553,8 +553,11 @@ void StylePositionImpl::ResetFrom(const nsStylePosition* aParent, nsIPresContext { // positioning values not inherited mPosition = NS_STYLE_POSITION_NORMAL; - mLeftOffset.SetAutoValue(); - mTopOffset.SetAutoValue(); + nsStyleCoord autoCoord(eStyleUnit_Auto); + mOffset.SetLeft(autoCoord); + mOffset.SetTop(autoCoord); + mOffset.SetRight(autoCoord); + mOffset.SetBottom(autoCoord); mWidth.SetAutoValue(); mMinWidth.SetCoordValue(0); mMaxWidth.Reset(); diff --git a/mozilla/content/html/style/src/nsCSSLayout.cpp b/mozilla/content/html/style/src/nsCSSLayout.cpp index bfed185e18a..326284ef60f 100644 --- a/mozilla/content/html/style/src/nsCSSLayout.cpp +++ b/mozilla/content/html/style/src/nsCSSLayout.cpp @@ -98,23 +98,23 @@ nsCSSLayout::RelativePositionChildren(nsIPresContext* aCX, if (NS_STYLE_POSITION_RELATIVE == kidPosition->mPosition) { kid->GetOrigin(origin); nscoord dx = 0; - switch (kidPosition->mLeftOffset.GetUnit()) { + switch (kidPosition->mOffset.GetLeftUnit()) { case eStyleUnit_Percent: printf("XXX: not yet implemented: % relative position\n"); case eStyleUnit_Auto: break; case eStyleUnit_Coord: - dx = kidPosition->mLeftOffset.GetCoordValue(); + dx = kidPosition->mOffset.GetLeft().GetCoordValue(); break; } nscoord dy = 0; - switch (kidPosition->mTopOffset.GetUnit()) { + switch (kidPosition->mOffset.GetTopUnit()) { case eStyleUnit_Percent: printf("XXX: not yet implemented: % relative position\n"); case eStyleUnit_Auto: break; case eStyleUnit_Coord: - dy = kidPosition->mTopOffset.GetCoordValue(); + dy = kidPosition->mOffset.GetTop().GetCoordValue(); break; } kid->MoveTo(origin.x + dx, origin.y + dy); diff --git a/mozilla/content/html/style/src/nsCSSStyleRule.cpp b/mozilla/content/html/style/src/nsCSSStyleRule.cpp index 58a6394dae4..59105c0055d 100644 --- a/mozilla/content/html/style/src/nsCSSStyleRule.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleRule.cpp @@ -1813,9 +1813,19 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration, // box offsets: length, percent, auto, inherit if (nsnull != ourPosition->mOffset) { - SetCoord(ourPosition->mOffset->mTop, position->mTopOffset, SETCOORD_LPAH, font, aPresContext); - // XXX right bottom - SetCoord(ourPosition->mOffset->mLeft, position->mLeftOffset, SETCOORD_LPAH, font, aPresContext); + nsStyleCoord coord; + if (SetCoord(ourPosition->mOffset->mTop, coord, SETCOORD_LPAH, font, aPresContext)) { + position->mOffset.SetTop(coord); + } + if (SetCoord(ourPosition->mOffset->mRight, coord, SETCOORD_LPAH, font, aPresContext)) { + position->mOffset.SetRight(coord); + } + if (SetCoord(ourPosition->mOffset->mBottom, coord, SETCOORD_LPAH, font, aPresContext)) { + position->mOffset.SetBottom(coord); + } + if (SetCoord(ourPosition->mOffset->mLeft, coord, SETCOORD_LPAH, font, aPresContext)) { + position->mOffset.SetLeft(coord); + } } SetCoord(ourPosition->mWidth, position->mWidth, SETCOORD_LPAH, font, aPresContext); diff --git a/mozilla/layout/base/public/nsIStyleContext.h b/mozilla/layout/base/public/nsIStyleContext.h index b16ff4e13c9..f070edea6e2 100644 --- a/mozilla/layout/base/public/nsIStyleContext.h +++ b/mozilla/layout/base/public/nsIStyleContext.h @@ -124,8 +124,7 @@ protected: struct nsStylePosition : public nsStyleStruct { PRUint8 mPosition; // [reset] see nsStyleConsts.h - nsStyleCoord mLeftOffset; // [reset] - nsStyleCoord mTopOffset; // [reset] + nsStyleSides mOffset; // [reset] nsStyleCoord mWidth; // [reset] coord, percent, auto, inherit nsStyleCoord mMinWidth; // [reset] coord, percent, inherit nsStyleCoord mMaxWidth; // [reset] coord, percent, null, inherit diff --git a/mozilla/layout/base/src/nsStyleContext.cpp b/mozilla/layout/base/src/nsStyleContext.cpp index 232805daf44..d1200c9093d 100644 --- a/mozilla/layout/base/src/nsStyleContext.cpp +++ b/mozilla/layout/base/src/nsStyleContext.cpp @@ -553,8 +553,11 @@ void StylePositionImpl::ResetFrom(const nsStylePosition* aParent, nsIPresContext { // positioning values not inherited mPosition = NS_STYLE_POSITION_NORMAL; - mLeftOffset.SetAutoValue(); - mTopOffset.SetAutoValue(); + nsStyleCoord autoCoord(eStyleUnit_Auto); + mOffset.SetLeft(autoCoord); + mOffset.SetTop(autoCoord); + mOffset.SetRight(autoCoord); + mOffset.SetBottom(autoCoord); mWidth.SetAutoValue(); mMinWidth.SetCoordValue(0); mMaxWidth.Reset(); diff --git a/mozilla/layout/generic/nsAreaFrame.cpp b/mozilla/layout/generic/nsAreaFrame.cpp index c2096752799..17bcf2b54ce 100644 --- a/mozilla/layout/generic/nsAreaFrame.cpp +++ b/mozilla/layout/generic/nsAreaFrame.cpp @@ -530,8 +530,8 @@ nsAreaFrame::ReflowAbsoluteItems(nsIPresContext& aPresContext, #endif // We need to place the frame if the left-offset or the top-offset are // auto or a percentage - if ((eStyleUnit_Coord != position->mLeftOffset.GetUnit()) || - (eStyleUnit_Coord != position->mTopOffset.GetUnit())) { + if ((eStyleUnit_Coord != position->mOffset.GetLeftUnit()) || + (eStyleUnit_Coord != position->mOffset.GetTopUnit())) { placeFrame = PR_TRUE; } @@ -622,8 +622,8 @@ void nsAreaFrame::ComputeAbsoluteFrameBounds(nsIPresContext& aPresConte // If either the left or top are 'auto' then get the offset of the anchor // frame from this frame nsPoint offset(0, 0); - if ((eStyleUnit_Auto == aPosition->mLeftOffset.GetUnit()) || - (eStyleUnit_Auto == aPosition->mTopOffset.GetUnit())) { + if ((eStyleUnit_Auto == aPosition->mOffset.GetLeftUnit()) || + (eStyleUnit_Auto == aPosition->mOffset.GetTopUnit())) { // Get the placeholder frame nsIFrame* placeholderFrame; nsIPresShell* presShell = aPresContext.GetShell(); @@ -638,42 +638,46 @@ void nsAreaFrame::ComputeAbsoluteFrameBounds(nsIPresContext& aPresConte } // left-offset - if (eStyleUnit_Auto == aPosition->mLeftOffset.GetUnit()) { + if (eStyleUnit_Auto == aPosition->mOffset.GetLeftUnit()) { // Use the current x-offset of the anchor frame translated into our // coordinate space aRect.x = offset.x; - } else if (eStyleUnit_Coord == aPosition->mLeftOffset.GetUnit()) { - aRect.x = aPosition->mLeftOffset.GetCoordValue(); + } else if (eStyleUnit_Coord == aPosition->mOffset.GetLeftUnit()) { + nsStyleCoord coord; + aRect.x = aPosition->mOffset.GetLeft(coord).GetCoordValue(); } else { - NS_ASSERTION(eStyleUnit_Percent == aPosition->mLeftOffset.GetUnit(), + NS_ASSERTION(eStyleUnit_Percent == aPosition->mOffset.GetLeftUnit(), "unexpected offset type"); // Percentage values refer to the width of the containing block. If the // width is unconstrained then just use 0 if (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) { aRect.x = 0; } else { + nsStyleCoord coord; aRect.x = (nscoord)((float)aReflowState.availableWidth * - aPosition->mLeftOffset.GetPercentValue()); + aPosition->mOffset.GetLeft(coord).GetPercentValue()); } } // top-offset - if (eStyleUnit_Auto == aPosition->mTopOffset.GetUnit()) { + if (eStyleUnit_Auto == aPosition->mOffset.GetTopUnit()) { // Use the current y-offset of the anchor frame translated into our // coordinate space aRect.y = offset.y; - } else if (eStyleUnit_Coord == aPosition->mTopOffset.GetUnit()) { - aRect.y = aPosition->mTopOffset.GetCoordValue(); + } else if (eStyleUnit_Coord == aPosition->mOffset.GetTopUnit()) { + nsStyleCoord coord; + aRect.y = aPosition->mOffset.GetTop(coord).GetCoordValue(); } else { - NS_ASSERTION(eStyleUnit_Percent == aPosition->mTopOffset.GetUnit(), + NS_ASSERTION(eStyleUnit_Percent == aPosition->mOffset.GetTopUnit(), "unexpected offset type"); // Percentage values refer to the height of the containing block. If the // height is unconstrained then interpret it like 'auto' if (NS_UNCONSTRAINEDSIZE == aReflowState.availableHeight) { aRect.y = offset.y; } else { + nsStyleCoord coord; aRect.y = (nscoord)((float)aReflowState.availableHeight * - aPosition->mTopOffset.GetPercentValue()); + aPosition->mOffset.GetTop(coord).GetPercentValue()); } } diff --git a/mozilla/layout/generic/nsBlockReflowContext.cpp b/mozilla/layout/generic/nsBlockReflowContext.cpp index 01b9de1977b..8903633df77 100644 --- a/mozilla/layout/generic/nsBlockReflowContext.cpp +++ b/mozilla/layout/generic/nsBlockReflowContext.cpp @@ -396,26 +396,28 @@ nsBlockReflowContext::ComputeRelativePosition(nsIFrame* aFrame, const nsStylePosition* aStylePos, nscoord& aX, nscoord& aY) { + nsStyleCoord coord; + nscoord dx = 0; - switch (aStylePos->mLeftOffset.GetUnit()) { + switch (aStylePos->mOffset.GetLeftUnit()) { case eStyleUnit_Percent: printf("XXX: not yet implemented: % relative position\n"); case eStyleUnit_Auto: break; case eStyleUnit_Coord: - dx = aStylePos->mLeftOffset.GetCoordValue(); + dx = aStylePos->mOffset.GetLeft(coord).GetCoordValue(); break; } aX += dx; nscoord dy = 0; - switch (aStylePos->mTopOffset.GetUnit()) { + switch (aStylePos->mOffset.GetTopUnit()) { case eStyleUnit_Percent: printf("XXX: not yet implemented: % relative position\n"); case eStyleUnit_Auto: break; case eStyleUnit_Coord: - dy = aStylePos->mTopOffset.GetCoordValue(); + dy = aStylePos->mOffset.GetTop(coord).GetCoordValue(); break; } aY += dy; diff --git a/mozilla/layout/html/base/src/nsAreaFrame.cpp b/mozilla/layout/html/base/src/nsAreaFrame.cpp index c2096752799..17bcf2b54ce 100644 --- a/mozilla/layout/html/base/src/nsAreaFrame.cpp +++ b/mozilla/layout/html/base/src/nsAreaFrame.cpp @@ -530,8 +530,8 @@ nsAreaFrame::ReflowAbsoluteItems(nsIPresContext& aPresContext, #endif // We need to place the frame if the left-offset or the top-offset are // auto or a percentage - if ((eStyleUnit_Coord != position->mLeftOffset.GetUnit()) || - (eStyleUnit_Coord != position->mTopOffset.GetUnit())) { + if ((eStyleUnit_Coord != position->mOffset.GetLeftUnit()) || + (eStyleUnit_Coord != position->mOffset.GetTopUnit())) { placeFrame = PR_TRUE; } @@ -622,8 +622,8 @@ void nsAreaFrame::ComputeAbsoluteFrameBounds(nsIPresContext& aPresConte // If either the left or top are 'auto' then get the offset of the anchor // frame from this frame nsPoint offset(0, 0); - if ((eStyleUnit_Auto == aPosition->mLeftOffset.GetUnit()) || - (eStyleUnit_Auto == aPosition->mTopOffset.GetUnit())) { + if ((eStyleUnit_Auto == aPosition->mOffset.GetLeftUnit()) || + (eStyleUnit_Auto == aPosition->mOffset.GetTopUnit())) { // Get the placeholder frame nsIFrame* placeholderFrame; nsIPresShell* presShell = aPresContext.GetShell(); @@ -638,42 +638,46 @@ void nsAreaFrame::ComputeAbsoluteFrameBounds(nsIPresContext& aPresConte } // left-offset - if (eStyleUnit_Auto == aPosition->mLeftOffset.GetUnit()) { + if (eStyleUnit_Auto == aPosition->mOffset.GetLeftUnit()) { // Use the current x-offset of the anchor frame translated into our // coordinate space aRect.x = offset.x; - } else if (eStyleUnit_Coord == aPosition->mLeftOffset.GetUnit()) { - aRect.x = aPosition->mLeftOffset.GetCoordValue(); + } else if (eStyleUnit_Coord == aPosition->mOffset.GetLeftUnit()) { + nsStyleCoord coord; + aRect.x = aPosition->mOffset.GetLeft(coord).GetCoordValue(); } else { - NS_ASSERTION(eStyleUnit_Percent == aPosition->mLeftOffset.GetUnit(), + NS_ASSERTION(eStyleUnit_Percent == aPosition->mOffset.GetLeftUnit(), "unexpected offset type"); // Percentage values refer to the width of the containing block. If the // width is unconstrained then just use 0 if (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) { aRect.x = 0; } else { + nsStyleCoord coord; aRect.x = (nscoord)((float)aReflowState.availableWidth * - aPosition->mLeftOffset.GetPercentValue()); + aPosition->mOffset.GetLeft(coord).GetPercentValue()); } } // top-offset - if (eStyleUnit_Auto == aPosition->mTopOffset.GetUnit()) { + if (eStyleUnit_Auto == aPosition->mOffset.GetTopUnit()) { // Use the current y-offset of the anchor frame translated into our // coordinate space aRect.y = offset.y; - } else if (eStyleUnit_Coord == aPosition->mTopOffset.GetUnit()) { - aRect.y = aPosition->mTopOffset.GetCoordValue(); + } else if (eStyleUnit_Coord == aPosition->mOffset.GetTopUnit()) { + nsStyleCoord coord; + aRect.y = aPosition->mOffset.GetTop(coord).GetCoordValue(); } else { - NS_ASSERTION(eStyleUnit_Percent == aPosition->mTopOffset.GetUnit(), + NS_ASSERTION(eStyleUnit_Percent == aPosition->mOffset.GetTopUnit(), "unexpected offset type"); // Percentage values refer to the height of the containing block. If the // height is unconstrained then interpret it like 'auto' if (NS_UNCONSTRAINEDSIZE == aReflowState.availableHeight) { aRect.y = offset.y; } else { + nsStyleCoord coord; aRect.y = (nscoord)((float)aReflowState.availableHeight * - aPosition->mTopOffset.GetPercentValue()); + aPosition->mOffset.GetTop(coord).GetPercentValue()); } } diff --git a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp index 01b9de1977b..8903633df77 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowContext.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowContext.cpp @@ -396,26 +396,28 @@ nsBlockReflowContext::ComputeRelativePosition(nsIFrame* aFrame, const nsStylePosition* aStylePos, nscoord& aX, nscoord& aY) { + nsStyleCoord coord; + nscoord dx = 0; - switch (aStylePos->mLeftOffset.GetUnit()) { + switch (aStylePos->mOffset.GetLeftUnit()) { case eStyleUnit_Percent: printf("XXX: not yet implemented: % relative position\n"); case eStyleUnit_Auto: break; case eStyleUnit_Coord: - dx = aStylePos->mLeftOffset.GetCoordValue(); + dx = aStylePos->mOffset.GetLeft(coord).GetCoordValue(); break; } aX += dx; nscoord dy = 0; - switch (aStylePos->mTopOffset.GetUnit()) { + switch (aStylePos->mOffset.GetTopUnit()) { case eStyleUnit_Percent: printf("XXX: not yet implemented: % relative position\n"); case eStyleUnit_Auto: break; case eStyleUnit_Coord: - dy = aStylePos->mTopOffset.GetCoordValue(); + dy = aStylePos->mOffset.GetTop(coord).GetCoordValue(); break; } aY += dy; diff --git a/mozilla/layout/html/base/src/nsInlineReflow.cpp b/mozilla/layout/html/base/src/nsInlineReflow.cpp index 0f27307be85..b8cf1b050fc 100644 --- a/mozilla/layout/html/base/src/nsInlineReflow.cpp +++ b/mozilla/layout/html/base/src/nsInlineReflow.cpp @@ -985,24 +985,25 @@ nsInlineReflow::RelativePositionFrames(nsRect& aCombinedArea) (const nsStyleStruct*&)kidPosition); if (NS_STYLE_POSITION_RELATIVE == kidPosition->mPosition) { kid->GetOrigin(origin); + nsStyleCoord coord; nscoord dx = 0; - switch (kidPosition->mLeftOffset.GetUnit()) { + switch (kidPosition->mOffset.GetLeftUnit()) { case eStyleUnit_Percent: printf("XXX: not yet implemented: % relative position\n"); case eStyleUnit_Auto: break; case eStyleUnit_Coord: - dx = kidPosition->mLeftOffset.GetCoordValue(); + dx = kidPosition->mOffset.GetLeft(coord).GetCoordValue(); break; } nscoord dy = 0; - switch (kidPosition->mTopOffset.GetUnit()) { + switch (kidPosition->mOffset.GetTopUnit()) { case eStyleUnit_Percent: printf("XXX: not yet implemented: % relative position\n"); case eStyleUnit_Auto: break; case eStyleUnit_Coord: - dy = kidPosition->mTopOffset.GetCoordValue(); + dy = kidPosition->mOffset.GetTop(coord).GetCoordValue(); break; } kid->MoveTo(origin.x + dx, origin.y + dy); diff --git a/mozilla/layout/html/content/src/nsHTMLLayerElement.cpp b/mozilla/layout/html/content/src/nsHTMLLayerElement.cpp index a8c13f75266..3253aedbe32 100644 --- a/mozilla/layout/html/content/src/nsHTMLLayerElement.cpp +++ b/mozilla/layout/html/content/src/nsHTMLLayerElement.cpp @@ -216,14 +216,14 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes, aAttributes->GetAttribute(nsHTMLAtoms::left, value); if (value.GetUnit() == eHTMLUnit_Pixel) { nscoord twips = NSIntPixelsToTwips(value.GetPixelValue(), p2t); - position->mLeftOffset.SetCoordValue(twips); + position->mOffset.SetLeft(nsStyleCoord(twips)); } // Top aAttributes->GetAttribute(nsHTMLAtoms::top, value); if (value.GetUnit() == eHTMLUnit_Pixel) { nscoord twips = NSIntPixelsToTwips(value.GetPixelValue(), p2t); - position->mTopOffset.SetCoordValue(twips); + position->mOffset.SetTop(nsStyleCoord(twips)); } // Width diff --git a/mozilla/layout/html/style/src/nsCSSLayout.cpp b/mozilla/layout/html/style/src/nsCSSLayout.cpp index bfed185e18a..326284ef60f 100644 --- a/mozilla/layout/html/style/src/nsCSSLayout.cpp +++ b/mozilla/layout/html/style/src/nsCSSLayout.cpp @@ -98,23 +98,23 @@ nsCSSLayout::RelativePositionChildren(nsIPresContext* aCX, if (NS_STYLE_POSITION_RELATIVE == kidPosition->mPosition) { kid->GetOrigin(origin); nscoord dx = 0; - switch (kidPosition->mLeftOffset.GetUnit()) { + switch (kidPosition->mOffset.GetLeftUnit()) { case eStyleUnit_Percent: printf("XXX: not yet implemented: % relative position\n"); case eStyleUnit_Auto: break; case eStyleUnit_Coord: - dx = kidPosition->mLeftOffset.GetCoordValue(); + dx = kidPosition->mOffset.GetLeft().GetCoordValue(); break; } nscoord dy = 0; - switch (kidPosition->mTopOffset.GetUnit()) { + switch (kidPosition->mOffset.GetTopUnit()) { case eStyleUnit_Percent: printf("XXX: not yet implemented: % relative position\n"); case eStyleUnit_Auto: break; case eStyleUnit_Coord: - dy = kidPosition->mTopOffset.GetCoordValue(); + dy = kidPosition->mOffset.GetTop().GetCoordValue(); break; } kid->MoveTo(origin.x + dx, origin.y + dy); diff --git a/mozilla/layout/html/style/src/nsCSSStyleRule.cpp b/mozilla/layout/html/style/src/nsCSSStyleRule.cpp index 58a6394dae4..59105c0055d 100644 --- a/mozilla/layout/html/style/src/nsCSSStyleRule.cpp +++ b/mozilla/layout/html/style/src/nsCSSStyleRule.cpp @@ -1813,9 +1813,19 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration, // box offsets: length, percent, auto, inherit if (nsnull != ourPosition->mOffset) { - SetCoord(ourPosition->mOffset->mTop, position->mTopOffset, SETCOORD_LPAH, font, aPresContext); - // XXX right bottom - SetCoord(ourPosition->mOffset->mLeft, position->mLeftOffset, SETCOORD_LPAH, font, aPresContext); + nsStyleCoord coord; + if (SetCoord(ourPosition->mOffset->mTop, coord, SETCOORD_LPAH, font, aPresContext)) { + position->mOffset.SetTop(coord); + } + if (SetCoord(ourPosition->mOffset->mRight, coord, SETCOORD_LPAH, font, aPresContext)) { + position->mOffset.SetRight(coord); + } + if (SetCoord(ourPosition->mOffset->mBottom, coord, SETCOORD_LPAH, font, aPresContext)) { + position->mOffset.SetBottom(coord); + } + if (SetCoord(ourPosition->mOffset->mLeft, coord, SETCOORD_LPAH, font, aPresContext)) { + position->mOffset.SetLeft(coord); + } } SetCoord(ourPosition->mWidth, position->mWidth, SETCOORD_LPAH, font, aPresContext); diff --git a/mozilla/layout/style/nsCSSStyleRule.cpp b/mozilla/layout/style/nsCSSStyleRule.cpp index 58a6394dae4..59105c0055d 100644 --- a/mozilla/layout/style/nsCSSStyleRule.cpp +++ b/mozilla/layout/style/nsCSSStyleRule.cpp @@ -1813,9 +1813,19 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration, // box offsets: length, percent, auto, inherit if (nsnull != ourPosition->mOffset) { - SetCoord(ourPosition->mOffset->mTop, position->mTopOffset, SETCOORD_LPAH, font, aPresContext); - // XXX right bottom - SetCoord(ourPosition->mOffset->mLeft, position->mLeftOffset, SETCOORD_LPAH, font, aPresContext); + nsStyleCoord coord; + if (SetCoord(ourPosition->mOffset->mTop, coord, SETCOORD_LPAH, font, aPresContext)) { + position->mOffset.SetTop(coord); + } + if (SetCoord(ourPosition->mOffset->mRight, coord, SETCOORD_LPAH, font, aPresContext)) { + position->mOffset.SetRight(coord); + } + if (SetCoord(ourPosition->mOffset->mBottom, coord, SETCOORD_LPAH, font, aPresContext)) { + position->mOffset.SetBottom(coord); + } + if (SetCoord(ourPosition->mOffset->mLeft, coord, SETCOORD_LPAH, font, aPresContext)) { + position->mOffset.SetLeft(coord); + } } SetCoord(ourPosition->mWidth, position->mWidth, SETCOORD_LPAH, font, aPresContext); diff --git a/mozilla/layout/style/nsStyleContext.cpp b/mozilla/layout/style/nsStyleContext.cpp index 232805daf44..d1200c9093d 100644 --- a/mozilla/layout/style/nsStyleContext.cpp +++ b/mozilla/layout/style/nsStyleContext.cpp @@ -553,8 +553,11 @@ void StylePositionImpl::ResetFrom(const nsStylePosition* aParent, nsIPresContext { // positioning values not inherited mPosition = NS_STYLE_POSITION_NORMAL; - mLeftOffset.SetAutoValue(); - mTopOffset.SetAutoValue(); + nsStyleCoord autoCoord(eStyleUnit_Auto); + mOffset.SetLeft(autoCoord); + mOffset.SetTop(autoCoord); + mOffset.SetRight(autoCoord); + mOffset.SetBottom(autoCoord); mWidth.SetAutoValue(); mMinWidth.SetCoordValue(0); mMaxWidth.Reset();