diff --git a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp index 5555e2d792a..c46705bc43e 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp @@ -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, diff --git a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.h b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.h index 37d01219d05..cb9e507eadf 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.h +++ b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.h @@ -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, diff --git a/mozilla/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp index d4cf5d18e67..da6b55fc83c 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp @@ -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; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmoFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmoFrame.cpp index ece44ea5596..0751f5c3062 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmoFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmoFrame.cpp @@ -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; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmsubFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmsubFrame.cpp index 05192898701..c8b3ea9b5ec 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmsubFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmsubFrame.cpp @@ -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; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp index 8c1febea2cc..1d59625dfc4 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp @@ -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; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmsupFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmsupFrame.cpp index 424f9343121..1e18c65ad70 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmsupFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmsupFrame.cpp @@ -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; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLmsupFrame.h b/mozilla/layout/mathml/base/src/nsMathMLmsupFrame.h index d74aeb806ac..9e2ff5671dc 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmsupFrame.h +++ b/mozilla/layout/mathml/base/src/nsMathMLmsupFrame.h @@ -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___ */