diff --git a/extensions/layout-debug/src/nsILayoutRegressionTester.idl b/extensions/layout-debug/src/nsILayoutRegressionTester.idl index f14568d79d9..56f310d7461 100644 --- a/extensions/layout-debug/src/nsILayoutRegressionTester.idl +++ b/extensions/layout-debug/src/nsILayoutRegressionTester.idl @@ -56,8 +56,7 @@ interface nsILayoutRegressionTester : nsISupports whether the page was still loading, or whether some other error happened. */ const short DUMP_FLAGS_MASK_DEFAULT = 0; - const short DUMP_FLAGS_MASK_DUMP_STYLE = 1; - const short DUMP_FLAGS_MASK_PRINT_MODE = 2; + const short DUMP_FLAGS_MASK_PRINT_MODE = 1; const long DUMP_RESULT_COMPLETED = 0; // loaded OK const long DUMP_RESULT_LOADING = 1; // still loading diff --git a/extensions/layout-debug/src/nsRegressionTester.cpp b/extensions/layout-debug/src/nsRegressionTester.cpp index 1353b042235..832292eb59f 100644 --- a/extensions/layout-debug/src/nsRegressionTester.cpp +++ b/extensions/layout-debug/src/nsRegressionTester.cpp @@ -114,8 +114,6 @@ nsRegressionTester::DumpFrameModel(nsIDOMWindow *aWindowToDump, nsILocalFile *aD nsIFrameDebug* fdbg = do_QueryFrame(root); if (NS_FAILED(rv)) return rv; - PRBool dumpStyle = (aFlagsMask & DUMP_FLAGS_MASK_DUMP_STYLE) != 0; - FILE* fp = stdout; if (aDestFile) { @@ -133,7 +131,7 @@ nsRegressionTester::DumpFrameModel(nsIDOMWindow *aWindowToDump, nsILocalFile *aD } } else { - fdbg->DumpRegressionData(presShell->GetPresContext(), fp, 0, dumpStyle); + fdbg->DumpRegressionData(presShell->GetPresContext(), fp, 0); } if (fp != stdout) fclose(fp); diff --git a/extensions/layout-debug/ui/content/layoutdebug.js b/extensions/layout-debug/ui/content/layoutdebug.js index e1e2136989f..5c5eeac02b5 100644 --- a/extensions/layout-debug/ui/content/layoutdebug.js +++ b/extensions/layout-debug/ui/content/layoutdebug.js @@ -425,8 +425,7 @@ RTestURLList.prototype = { nsILayoutRegressionTester.DUMP_FLAGS_MASK_PRINT_MODE); } else { - this.mRegressionTester.dumpFrameModel(gBrowser.contentWindow, data, - nsILayoutRegressionTester.DUMP_FLAGS_MASK_DUMP_STYLE); + this.mRegressionTester.dumpFrameModel(gBrowser.contentWindow, data, 0); } diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 13e524fa6b8..5e375aeb23b 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -4294,7 +4294,7 @@ nsIFrame::GetConstFrameSelection() #ifdef NS_DEBUG NS_IMETHODIMP -nsFrame::DumpRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData) +nsFrame::DumpRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent) { IndentBy(out, aIndent); fprintf(out, "\n"); } - if(aIncludeStyleData) { - if(mStyleContext) { - IndentBy(out, aIndent); - fprintf(out, "\n", PRUptrdiff(mStyleContext)); - aIndent++; - // Dump style context regression data - mStyleContext->DumpRegressionData(aPresContext, out, aIndent); - aIndent--; - IndentBy(out, aIndent); - fprintf(out, "\n"); - } - } - IndentBy(out, aIndent); fprintf(out, "\n", mRect.x, mRect.y, mRect.width, mRect.height); @@ -4373,7 +4360,7 @@ nsFrame::DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 while (kid) { nsIFrameDebug* frameDebug = do_QueryFrame(kid); if (kid) { - frameDebug->DumpRegressionData(aPresContext, out, aIndent, aIncludeStyleData); + frameDebug->DumpRegressionData(aPresContext, out, aIndent); } kid = kid->GetNextSibling(); } diff --git a/layout/generic/nsFrame.h b/layout/generic/nsFrame.h index f464934b256..fd2cab20503 100644 --- a/layout/generic/nsFrame.h +++ b/layout/generic/nsFrame.h @@ -234,7 +234,7 @@ public: NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD GetFrameName(nsAString& aResult) const; NS_IMETHOD_(nsFrameState) GetDebugStateBits() const; - NS_IMETHOD DumpRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData); + NS_IMETHOD DumpRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent); NS_IMETHOD VerifyTree() const; #endif @@ -465,7 +465,7 @@ public: * some custom behavior that requires changing how the outer "frame" * XML container is dumped. */ - virtual void DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData); + virtual void DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent); nsresult MakeFrameName(const nsAString& aKind, nsAString& aResult) const; diff --git a/layout/generic/nsIFrameDebug.h b/layout/generic/nsIFrameDebug.h index 7dc035a088d..46d8a9de773 100644 --- a/layout/generic/nsIFrameDebug.h +++ b/layout/generic/nsIFrameDebug.h @@ -77,10 +77,8 @@ public: * specific kind of data dumped is up to the frame itself, with * the caveat that some base types are defined. * For more information, see XXX. - * - * Argument aIncludeStyleData: if PR_TRUE, style information is dumpted, otherwise it is not */ - NS_IMETHOD DumpRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData) = 0; + NS_IMETHOD DumpRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent) = 0; NS_IMETHOD VerifyTree() const = 0; diff --git a/layout/generic/nsSplittableFrame.cpp b/layout/generic/nsSplittableFrame.cpp index cbf7f360038..f15943c3965 100644 --- a/layout/generic/nsSplittableFrame.cpp +++ b/layout/generic/nsSplittableFrame.cpp @@ -254,9 +254,9 @@ nsSplittableFrame::BreakFromPrevFlow(nsIFrame* aFrame) #ifdef DEBUG void -nsSplittableFrame::DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData) +nsSplittableFrame::DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent) { - nsFrame::DumpBaseRegressionData(aPresContext, out, aIndent, aIncludeStyleData); + nsFrame::DumpBaseRegressionData(aPresContext, out, aIndent); if (nsnull != mNextContinuation) { IndentBy(out, aIndent); fprintf(out, "\n", PRUptrdiff(mNextContinuation)); diff --git a/layout/generic/nsSplittableFrame.h b/layout/generic/nsSplittableFrame.h index 45bf0d212e8..864d0ba9d03 100644 --- a/layout/generic/nsSplittableFrame.h +++ b/layout/generic/nsSplittableFrame.h @@ -109,7 +109,7 @@ protected: nsSplittableFrame(nsStyleContext* aContext) : nsFrame(aContext) {} #ifdef DEBUG - virtual void DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData); + virtual void DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent); #endif nsIFrame* mPrevContinuation; diff --git a/layout/printing/nsPrintEngine.cpp b/layout/printing/nsPrintEngine.cpp index 7b1c076683a..227e96180aa 100644 --- a/layout/printing/nsPrintEngine.cpp +++ b/layout/printing/nsPrintEngine.cpp @@ -2147,7 +2147,7 @@ nsPrintEngine::DoPrint(nsPrintObject * aPO) nsIFrame* root = poPresShell->FrameManager()->GetRootFrame(); nsIFrameDebug* fdbg = do_QueryFrame(root); if (fdbg) { - fdbg->DumpRegressionData(poPresContext, mPrt->mDebugFilePtr, 0, PR_TRUE); + fdbg->DumpRegressionData(poPresContext, mPrt->mDebugFilePtr, 0); } fclose(mPrt->mDebugFilePtr); SetIsPrinting(PR_FALSE); diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index 3aa93d7e95b..8b39f8f1349 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -490,44 +490,6 @@ nsStyleContext::Mark() } #ifdef DEBUG - -class URICString : public nsCAutoString { -public: - URICString(nsIURI* aURI) { - if (aURI) { - aURI->GetSpec(*this); - } else { - Assign("[none]"); - } - } - - URICString(imgIRequest* aImageRequest) { - nsCOMPtr uri; - if (aImageRequest) { - aImageRequest->GetURI(getter_AddRefs(uri)); - } - if (uri) { - uri->GetSpec(*this); - } else { - Assign("[none]"); - } - } - - URICString(nsCSSValue::URL* aURI) { - if (aURI) { - NS_ASSERTION(aURI->mURI, "Must have URI here!"); - aURI->mURI->GetSpec(*this); - } else { - Assign("[none]"); - } - } - - URICString& operator=(const URICString& aOther) { - Assign(aOther); - return *this; - } -}; - void nsStyleContext::List(FILE* out, PRInt32 aIndent) { // Indent @@ -574,323 +536,6 @@ void nsStyleContext::List(FILE* out, PRInt32 aIndent) } while (mEmptyChild != child); } } - -static void IndentBy(FILE* out, PRInt32 aIndent) { - while (--aIndent >= 0) fputs(" ", out); -} -// virtual -void nsStyleContext::DumpRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent) -{ - nsAutoString str; - - // FONT - IndentBy(out,aIndent); - const nsStyleFont* font = GetStyleFont(); - fprintf(out, "\n", - NS_ConvertUTF16toUTF8(font->mFont.name).get(), - font->mFont.size, - font->mSize, - font->mGenericID); - - // COLOR - IndentBy(out,aIndent); - const nsStyleColor* color = GetStyleColor(); - fprintf(out, "\n", - (long)color->mColor); - - // BACKGROUND - IndentBy(out,aIndent); - const nsStyleBackground* bg = GetStyleBackground(); - fprintf(out, "\n", - (int)bg->mBackgroundAttachment, - (int)bg->mBackgroundFlags, - (int)bg->mBackgroundRepeat, - (long)bg->mBackgroundColor, - // XXX These aren't initialized unless flags are set: - (long)bg->mBackgroundXPosition.mCoord, // potentially lossy on some platforms - (long)bg->mBackgroundYPosition.mCoord, // potentially lossy on some platforms - URICString(bg->mBackgroundImage).get()); - - // SPACING (ie. margin, padding, border, outline) - IndentBy(out,aIndent); - fprintf(out, "mMargin.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - - const nsStylePadding* padding = GetStylePadding(); - padding->mPadding.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - - const nsStyleBorder* border = GetStyleBorder(); -#ifdef NS_COORD_IS_FLOAT - const char format [] = "top: %ftw right: %ftw bottom: %ftw left: %ftw"; -#else - const char format [] = "top: %dtw right: %dtw bottom: %dtw left: %dtw"; -#endif - nsPrintfCString output(format, - border->GetActualBorderWidth(NS_SIDE_TOP), - border->GetActualBorderWidth(NS_SIDE_RIGHT), - border->GetActualBorderWidth(NS_SIDE_BOTTOM), - border->GetActualBorderWidth(NS_SIDE_LEFT)); - fprintf(out, "%s ", output.get()); - border->mBorderRadius.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - - const nsStyleOutline* outline = GetStyleOutline(); - outline->mOutlineRadius.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - outline->mOutlineWidth.ToString(str); - fprintf(out, "%s", NS_ConvertUTF16toUTF8(str).get()); - fprintf(out, "%d", (int)border->mFloatEdge); - fprintf(out, "\" />\n"); - - // LIST - IndentBy(out,aIndent); - const nsStyleList* list = GetStyleList(); - fprintf(out, "\n", - (int)list->mListStyleType, - (int)list->mListStyleType, - URICString(list->mListStyleImage).get()); - - // POSITION - IndentBy(out,aIndent); - const nsStylePosition* pos = GetStylePosition(); - fprintf(out, "mOffset.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - pos->mWidth.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - pos->mMinWidth.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - pos->mMaxWidth.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - pos->mHeight.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - pos->mMinHeight.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - pos->mMaxHeight.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - fprintf(out, "%d ", (int)pos->mBoxSizing); - pos->mZIndex.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - fprintf(out, "\" />\n"); - - // TEXT - IndentBy(out,aIndent); - const nsStyleText* text = GetStyleText(); - fprintf(out, "mTextAlign, - (int)text->mTextTransform, - (int)text->mWhiteSpace, - (int)text->mWordWrap); - text->mLetterSpacing.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - text->mLineHeight.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - text->mTextIndent.ToString(str); - fprintf(out, "%s %d", NS_ConvertUTF16toUTF8(str).get(), - (int)text->mWordSpacing); - fprintf(out, "\" />\n"); - - // TEXT RESET - IndentBy(out,aIndent); - const nsStyleTextReset* textReset = GetStyleTextReset(); - fprintf(out, "mTextDecoration); - textReset->mVerticalAlign.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - fprintf(out, "\" />\n"); - - // DISPLAY - IndentBy(out,aIndent); - const nsStyleDisplay* disp = GetStyleDisplay(); - fprintf(out, "\n", - (int)disp->mPosition, - (int)disp->mDisplay, - (float)disp->mOpacity, - (int)disp->mFloats, - (int)disp->mBreakType, - (int)disp->mBreakBefore, - (int)disp->mBreakAfter, - (int)disp->mOverflowX, - (int)disp->mOverflowY, - (int)disp->mClipFlags, - (long)disp->mClip.x, - (long)disp->mClip.y, - (long)disp->mClip.width, - (long)disp->mClip.height, - URICString(disp->mBinding).get() - ); - - // VISIBILITY - IndentBy(out,aIndent); - const nsStyleVisibility* vis = GetStyleVisibility(); - fprintf(out, "\n", - (int)vis->mDirection, - (int)vis->mVisible - ); - - // TABLE - IndentBy(out,aIndent); - const nsStyleTable* table = GetStyleTable(); - fprintf(out, "mLayoutStrategy, - (int)table->mFrame, - (int)table->mRules); - fprintf(out, "%ld %ld ", - (long)table->mCols, - (long)table->mSpan); - fprintf(out, "\" />\n"); - - // TABLEBORDER - IndentBy(out,aIndent); - const nsStyleTableBorder* tableBorder = GetStyleTableBorder(); - fprintf(out, "mBorderCollapse, - (int)tableBorder->mBorderSpacingX, - (int)tableBorder->mBorderSpacingY, - (int)tableBorder->mCaptionSide, - (int)tableBorder->mEmptyCells); - fprintf(out, "\" />\n"); - - // CONTENT - IndentBy(out,aIndent); - const nsStyleContent* content = GetStyleContent(); - fprintf(out, "ContentCount(), - (long)content->CounterIncrementCount(), - (long)content->CounterResetCount()); - // XXX: iterate over the content and counters... - content->mMarkerOffset.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - fprintf(out, "\" />\n"); - - // QUOTES - IndentBy(out,aIndent); - const nsStyleQuotes* quotes = GetStyleQuotes(); - fprintf(out, "QuotesCount()); - // XXX: iterate over the quotes... - fprintf(out, "\" />\n"); - - // UI - IndentBy(out,aIndent); - const nsStyleUserInterface* ui = GetStyleUserInterface(); - fprintf(out, "\n", - (int)ui->mUserInput, - (int)ui->mUserModify, - (int)ui->mUserFocus, - (int)ui->mCursor); - - // UIReset - IndentBy(out,aIndent); - const nsStyleUIReset* uiReset = GetStyleUIReset(); - fprintf(out, "\n", - (int)uiReset->mUserSelect, - (int)uiReset->mIMEMode, - (int)uiReset->mWindowShadow); - - // Column - IndentBy(out,aIndent); - const nsStyleColumn* column = GetStyleColumn(); - fprintf(out, "mColumnCount); - column->mColumnWidth.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - column->mColumnGap.ToString(str); - fprintf(out, "%s ", NS_ConvertUTF16toUTF8(str).get()); - fprintf(out, "%d %d %ld", - (int)column->GetComputedColumnRuleWidth(), - (int)column->mColumnRuleStyle, - (long)column->mColumnRuleColor); - fprintf(out, "\" />\n"); - - // XUL - IndentBy(out,aIndent); - const nsStyleXUL* xul = GetStyleXUL(); - fprintf(out, "mBoxAlign, - (int)xul->mBoxDirection, - (int)xul->mBoxFlex, - (int)xul->mBoxOrient, - (int)xul->mBoxPack, - (int)xul->mBoxOrdinal); - fprintf(out, "\" />\n"); - -#ifdef MOZ_SVG - // SVG - IndentBy(out,aIndent); - const nsStyleSVG* svg = GetStyleSVG(); - fprintf(out, "mFill.mType); - if (svg->mFill.mType == eStyleSVGPaintType_Server) - fprintf(out, "%s %ld ", URICString(svg->mFill.mPaint.mPaintServer).get(), - (long)svg->mFill.mFallbackColor); - else - fprintf(out, "%ld ", (long)svg->mFill.mPaint.mColor); - - fprintf(out, "%d ", (int)svg->mStroke.mType); - if (svg->mStroke.mType == eStyleSVGPaintType_Server) - fprintf(out, "%s %ld ", URICString(svg->mStroke.mPaint.mPaintServer).get(), - (long)svg->mStroke.mFallbackColor); - else - fprintf(out, "%ld ", (long)svg->mStroke.mPaint.mColor); - - fprintf(out, "%s %s %s ", - URICString(svg->mMarkerEnd).get(), - URICString(svg->mMarkerMid).get(), - URICString(svg->mMarkerStart).get()); - - for (PRUint32 i = 0; i < svg->mStrokeDasharrayLength; i++) { - svg->mStrokeDasharray[i].ToString(str); - fprintf(out, - "%s%c", - NS_ConvertUTF16toUTF8(str).get(), - (i == svg->mStrokeDasharrayLength) ? ' ' : ','); - } - - svg->mStrokeDashoffset.ToString(str); - fprintf(out, "%f %s %f %f ", - svg->mFillOpacity, - NS_ConvertUTF16toUTF8(str).get(), - svg->mStrokeMiterlimit, - svg->mStrokeOpacity); - svg->mStrokeWidth.ToString(str); - fprintf(out, "%s %d %d %d %d %d %d %d %d %d %d %d\" />\n", - NS_ConvertUTF16toUTF8(str).get(), - (int)svg->mStrokeDasharrayLength, - (int)svg->mClipRule, - (int)svg->mColorInterpolation, - (int)svg->mColorInterpolationFilters, - (int)svg->mFillRule, - (int)svg->mPointerEvents, - (int)svg->mShapeRendering, - (int)svg->mStrokeLinecap, - (int)svg->mStrokeLinejoin, - (int)svg->mTextAnchor, - (int)svg->mTextRendering); - - // SVGReset - IndentBy(out,aIndent); - const nsStyleSVGReset* svgReset = GetStyleSVGReset(); - - fprintf(out, "mStopColor); - - fprintf(out, "%ld ", (long)svgReset->mFloodColor); - - fprintf(out, "%ld ", (long)svgReset->mLightingColor); - - fprintf(out, "%s %s %s %f %f %d\" />\n", - URICString(svgReset->mClipPath).get(), - URICString(svgReset->mFilter).get(), - URICString(svgReset->mMask).get(), - svgReset->mStopOpacity, - svgReset->mFloodOpacity, - (int)svgReset->mDominantBaseline); -#endif - //#insert new style structs here# -} #endif // Overloaded new operator. Initializes the memory to 0 and relies on an arena diff --git a/layout/style/nsStyleContext.h b/layout/style/nsStyleContext.h index e00bbe218ec..b9fb6c079fe 100644 --- a/layout/style/nsStyleContext.h +++ b/layout/style/nsStyleContext.h @@ -163,9 +163,6 @@ public: NS_HIDDEN_(nsChangeHint) CalcStyleDifference(nsStyleContext* aOther); #ifdef DEBUG - NS_HIDDEN_(void) DumpRegressionData(nsPresContext* aPresContext, FILE* out, - PRInt32 aIndent); - NS_HIDDEN_(void) List(FILE* out, PRInt32 aIndent); #endif diff --git a/layout/style/nsStyleCoord.cpp b/layout/style/nsStyleCoord.cpp index 16dd2afe858..e72b98c4a96 100644 --- a/layout/style/nsStyleCoord.cpp +++ b/layout/style/nsStyleCoord.cpp @@ -171,42 +171,6 @@ void nsStyleCoord::SetNoneValue(void) mValue.mInt = 0; } -#ifdef DEBUG -void nsStyleCoord::AppendToString(nsString& aBuffer) const -{ - if ((eStyleUnit_Percent <= mUnit) && (mUnit < eStyleUnit_Coord)) { - aBuffer.AppendFloat(mValue.mFloat); - } - else if ((eStyleUnit_Coord == mUnit) || - (eStyleUnit_Enumerated == mUnit) || - (eStyleUnit_Integer == mUnit)) { - aBuffer.AppendInt(mValue.mInt, 10); - aBuffer.AppendLiteral("[0x"); - aBuffer.AppendInt(mValue.mInt, 16); - aBuffer.Append(PRUnichar(']')); - } - - switch (mUnit) { - case eStyleUnit_Null: aBuffer.AppendLiteral("Null"); break; - case eStyleUnit_Coord: aBuffer.AppendLiteral("tw"); break; - case eStyleUnit_Percent: aBuffer.AppendLiteral("%"); break; - case eStyleUnit_Factor: aBuffer.AppendLiteral("f"); break; - case eStyleUnit_Normal: aBuffer.AppendLiteral("Normal"); break; - case eStyleUnit_Auto: aBuffer.AppendLiteral("Auto"); break; - case eStyleUnit_None: aBuffer.AppendLiteral("None"); break; - case eStyleUnit_Enumerated: aBuffer.AppendLiteral("enum"); break; - case eStyleUnit_Integer: aBuffer.AppendLiteral("int"); break; - } - aBuffer.Append(PRUnichar(' ')); -} - -void nsStyleCoord::ToString(nsString& aBuffer) const -{ - aBuffer.Truncate(); - AppendToString(aBuffer); -} -#endif - // used by nsStyleSides and nsStyleCorners #define COMPARE_INDEXED_COORD(i) \ PR_BEGIN_MACRO \ @@ -242,29 +206,6 @@ void nsStyleSides::Reset(void) memset(this, 0x00, sizeof(nsStyleSides)); } -#ifdef DEBUG -void nsStyleSides::AppendToString(nsString& aBuffer) const -{ - aBuffer.AppendLiteral("left: "); - GetLeft().AppendToString(aBuffer); - - aBuffer.AppendLiteral("top: "); - GetTop().AppendToString(aBuffer); - - aBuffer.AppendLiteral("right: "); - GetRight().AppendToString(aBuffer); - - aBuffer.AppendLiteral("bottom: "); - GetBottom().AppendToString(aBuffer); -} - -void nsStyleSides::ToString(nsString& aBuffer) const -{ - aBuffer.Truncate(); - AppendToString(aBuffer); -} -#endif - nsStyleCorners::nsStyleCorners() { memset(this, 0x00, sizeof(nsStyleCorners)); @@ -284,33 +225,6 @@ void nsStyleCorners::Reset(void) memset(this, 0x00, sizeof(nsStyleCorners)); } -#ifdef DEBUG -void nsStyleCorners::AppendToString(nsString& aBuffer) const -{ - aBuffer.AppendLiteral("top-left: "); - Get(NS_CORNER_TOP_LEFT_X).AppendToString(aBuffer); - Get(NS_CORNER_TOP_LEFT_Y).AppendToString(aBuffer); - - aBuffer.AppendLiteral("top-right: "); - Get(NS_CORNER_TOP_RIGHT_X).AppendToString(aBuffer); - Get(NS_CORNER_TOP_RIGHT_Y).AppendToString(aBuffer); - - aBuffer.AppendLiteral("bottom-right: "); - Get(NS_CORNER_BOTTOM_RIGHT_X).AppendToString(aBuffer); - Get(NS_CORNER_BOTTOM_RIGHT_Y).AppendToString(aBuffer); - - aBuffer.AppendLiteral("bottom-left: "); - Get(NS_CORNER_BOTTOM_LEFT_X).AppendToString(aBuffer); - Get(NS_CORNER_BOTTOM_LEFT_Y).AppendToString(aBuffer); -} - -void nsStyleCorners::ToString(nsString& aBuffer) const -{ - aBuffer.Truncate(); - AppendToString(aBuffer); -} -#endif - // Validation of NS_SIDE_IS_VERTICAL and NS_HALF_CORNER_IS_X. #define CASE(side, result) \ PR_STATIC_ASSERT(NS_SIDE_IS_VERTICAL(side) == result) diff --git a/layout/style/nsStyleCoord.h b/layout/style/nsStyleCoord.h index aa2fdd39bba..d5608db1c66 100644 --- a/layout/style/nsStyleCoord.h +++ b/layout/style/nsStyleCoord.h @@ -103,11 +103,6 @@ public: void SetAutoValue(void); void SetNoneValue(void); -#ifdef DEBUG - void AppendToString(nsString& aBuffer) const; - void ToString(nsString& aBuffer) const; -#endif - public: nsStyleUnit mUnit; nsStyleUnion mValue; @@ -149,11 +144,6 @@ public: inline void SetRight(const nsStyleCoord& aCoord); inline void SetBottom(const nsStyleCoord& aCoord); -#ifdef DEBUG - void AppendToString(nsString& aBuffer) const; - void ToString(nsString& aBuffer) const; -#endif - protected: PRUint8 mUnits[4]; nsStyleUnion mValues[4]; @@ -182,11 +172,6 @@ public: inline void Set(PRUint8 aHalfCorner, const nsStyleCoord& aCoord); -#ifdef DEBUG - void AppendToString(nsString& aBuffer) const; - void ToString(nsString& aBuffer) const; -#endif - protected: PRUint8 mUnits[8]; nsStyleUnion mValues[8];