Bug 717546 - Partial support for negative mspace@width. r=karlt

This commit is contained in:
Frédéric Wang 2013-04-17 07:47:09 -04:00
parent e23794f0ad
commit 7c79da9ab8
2 changed files with 5 additions and 7 deletions

View File

@ -1286,7 +1286,7 @@ nsMathMLContainerFrame::Place(nsRenderingContext& aRenderingContext,
// another math frame
mBoundingMetrics.width = child.X();
aDesiredSize.width = mBoundingMetrics.width;
aDesiredSize.width = std::max(0, mBoundingMetrics.width);
aDesiredSize.height = ascent + descent;
aDesiredSize.ascent = ascent;
aDesiredSize.mBoundingMetrics = mBoundingMetrics;

View File

@ -106,18 +106,16 @@ nsMathMLmspaceFrame::Reflow(nsPresContext* aPresContext,
nsReflowStatus& aStatus)
{
ProcessAttributes(aPresContext);
// nsLineLayout doesn't expect negative widths.
// XXXfredw Negative spaces are not implemented. See bug 717546
mBoundingMetrics = nsBoundingMetrics();
mBoundingMetrics.width = std::max(0, mWidth);
mBoundingMetrics.width = mWidth;
mBoundingMetrics.ascent = mHeight;
mBoundingMetrics.descent = mDepth;
mBoundingMetrics.leftBearing = 0;
mBoundingMetrics.rightBearing = mBoundingMetrics.width;
aDesiredSize.ascent = mHeight;
aDesiredSize.width = mBoundingMetrics.width;
aDesiredSize.width = std::max(0, mBoundingMetrics.width);
aDesiredSize.height = aDesiredSize.ascent + mDepth;
// Also return our bounding metrics
aDesiredSize.mBoundingMetrics = mBoundingMetrics;
@ -133,8 +131,8 @@ nsMathMLmspaceFrame::MeasureForWidth(nsRenderingContext& aRenderingContext,
{
ProcessAttributes(PresContext());
mBoundingMetrics = nsBoundingMetrics();
mBoundingMetrics.width = std::max(0, mWidth);
aDesiredSize.width = mBoundingMetrics.width;
mBoundingMetrics.width = mWidth;
aDesiredSize.width = std::max(0, mBoundingMetrics.width);
aDesiredSize.mBoundingMetrics = mBoundingMetrics;
return NS_OK;
}