зеркало из https://github.com/mozilla/gecko-dev.git
Cleanup and flags for debug mode
This commit is contained in:
Родитель
2e258f3a44
Коммит
4bc4597ad9
|
@ -171,9 +171,12 @@ Implementation here:
|
|||
|
||||
// Adapted from nsCSSScanner.cpp & CSSParser.cpp
|
||||
PRBool
|
||||
nsMathMLContainerFrame::ParseNumericValue(const nsString& aString,
|
||||
nsCSSValue& aCSSValue)
|
||||
nsMathMLContainerFrame::ParseNumericValue(nsString& aString,
|
||||
nsCSSValue& aCSSValue)
|
||||
{
|
||||
aCSSValue.Reset();
|
||||
aString.CompressWhitespace(); // aString is not a const in this code...
|
||||
|
||||
PRInt32 stringLength = aString.Length();
|
||||
|
||||
if (!stringLength) return PR_FALSE;
|
||||
|
@ -232,7 +235,7 @@ printf("String:%s, Number:%s, Unit:%s\n", s1, s2, s3);
|
|||
else if (unit == "pc") cssUnit = eCSSUnit_Pica;
|
||||
else // unexpected unit
|
||||
return PR_FALSE;
|
||||
|
||||
|
||||
aCSSValue.SetFloatValue(floatValue, cssUnit);
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
@ -896,6 +899,7 @@ nsMathMLContainerFrame::InsertScriptLevelStyleContext(nsIPresContext* aPresConte
|
|||
* =============================================================================
|
||||
*/
|
||||
|
||||
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
|
||||
NS_IMETHODIMP
|
||||
nsMathMLContainerFrame::Paint(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
|
@ -908,7 +912,6 @@ nsMathMLContainerFrame::Paint(nsIPresContext* aPresContext,
|
|||
aRenderingContext,
|
||||
aDirtyRect,
|
||||
aWhichLayer);
|
||||
#ifdef SHOW_BOUNDING_BOX
|
||||
// for visual debug
|
||||
// ----------------
|
||||
// if you want to see your bounding box, make sure to properly fill
|
||||
|
@ -928,9 +931,9 @@ nsMathMLContainerFrame::Paint(nsIPresContext* aPresContext,
|
|||
|
||||
aRenderingContext.DrawRect(x,y,w,h);
|
||||
}
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMathMLContainerFrame::Init(nsIPresContext* aPresContext,
|
||||
|
|
|
@ -156,11 +156,13 @@ public:
|
|||
return nsHTMLContainerFrame::DidReflow(aPresContext, aStatus);
|
||||
}
|
||||
|
||||
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
|
||||
NS_IMETHOD
|
||||
Paint(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
#endif
|
||||
|
||||
// helper function to reflow token elements
|
||||
static nsresult
|
||||
|
@ -271,8 +273,8 @@ public:
|
|||
// utilities to parse and retrieve numeric values in CSS units
|
||||
// All values are stored in twips.
|
||||
static PRBool
|
||||
ParseNumericValue(const nsString& aString,
|
||||
nsCSSValue& aCSSValue);
|
||||
ParseNumericValue(nsString& aString,
|
||||
nsCSSValue& aCSSValue);
|
||||
|
||||
static nscoord
|
||||
CalcLength(nsIPresContext* aPresContext,
|
||||
|
|
|
@ -99,7 +99,9 @@ nsMathMLmmultiscriptsFrame::Init(nsIPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
|
||||
mPresentationData.flags |= NS_MATHML_SHOW_BOUNDING_METRICS;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ nsMathMLmoFrame::Paint(nsIPresContext* aPresContext,
|
|||
rv = mMathMLChar.Paint(aPresContext,
|
||||
aRenderingContext,
|
||||
mStyleContext);
|
||||
#ifdef SHOW_BOUNDING_BOX
|
||||
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
|
||||
// for visual debug
|
||||
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer &&
|
||||
NS_MATHML_PAINT_BOUNDING_METRICS(mPresentationData.flags))
|
||||
|
@ -159,7 +159,9 @@ nsMathMLmoFrame::Init(nsIPresContext* aPresContext,
|
|||
mMinSize = float(NS_UNCONSTRAINEDSIZE);
|
||||
mMaxSize = float(NS_UNCONSTRAINEDSIZE);
|
||||
|
||||
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
|
||||
mPresentationData.flags |= NS_MATHML_SHOW_BOUNDING_METRICS;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,9 @@ nsMathMLmsubFrame::Init(nsIPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
|
||||
mPresentationData.flags |= NS_MATHML_SHOW_BOUNDING_METRICS;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,9 @@ nsMathMLmsubsupFrame::Init(nsIPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
|
||||
mPresentationData.flags |= NS_MATHML_SHOW_BOUNDING_METRICS;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,9 @@ nsMathMLmsupFrame::Init(nsIPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
|
||||
mPresentationData.flags |= NS_MATHML_SHOW_BOUNDING_METRICS;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,8 +72,7 @@ protected:
|
|||
private:
|
||||
nscoord mScriptSpace; // scriptspace from TeX for extra spacing after sup/subscript
|
||||
// = 0.5pt in plain TeX
|
||||
float mSupScriptShiftFactor;
|
||||
PRBool mUserSetFlag;
|
||||
nscoord mSupScriptShift;
|
||||
};
|
||||
|
||||
#endif /* nsMathMLmsupFrame_h___ */
|
||||
|
|
Загрузка…
Ссылка в новой задаче