Remove nsStyleContext::DumpRegressionData, code that uses it, and code that exists only for it. (Bug 477522) r+sr=bzbarsky
This commit is contained in:
Родитель
4b385cfec3
Коммит
47b517d128
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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, "<frame va=\"%ld\" type=\"", PRUptrdiff(this));
|
||||
|
@ -4306,7 +4306,7 @@ nsFrame::DumpRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aInd
|
|||
GetDebugStateBits(), PRUptrdiff(mParent));
|
||||
|
||||
aIndent++;
|
||||
DumpBaseRegressionData(aPresContext, out, aIndent, aIncludeStyleData);
|
||||
DumpBaseRegressionData(aPresContext, out, aIndent);
|
||||
aIndent--;
|
||||
|
||||
IndentBy(out, aIndent);
|
||||
|
@ -4316,7 +4316,7 @@ nsFrame::DumpRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aInd
|
|||
}
|
||||
|
||||
void
|
||||
nsFrame::DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData)
|
||||
nsFrame::DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32 aIndent)
|
||||
{
|
||||
if (nsnull != mNextSibling) {
|
||||
IndentBy(out, aIndent);
|
||||
|
@ -4333,19 +4333,6 @@ nsFrame::DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32
|
|||
fprintf(out, "</view>\n");
|
||||
}
|
||||
|
||||
if(aIncludeStyleData) {
|
||||
if(mStyleContext) {
|
||||
IndentBy(out, aIndent);
|
||||
fprintf(out, "<stylecontext va=\"%ld\">\n", PRUptrdiff(mStyleContext));
|
||||
aIndent++;
|
||||
// Dump style context regression data
|
||||
mStyleContext->DumpRegressionData(aPresContext, out, aIndent);
|
||||
aIndent--;
|
||||
IndentBy(out, aIndent);
|
||||
fprintf(out, "</stylecontext>\n");
|
||||
}
|
||||
}
|
||||
|
||||
IndentBy(out, aIndent);
|
||||
fprintf(out, "<bbox x=\"%d\" y=\"%d\" w=\"%d\" h=\"%d\"/>\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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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, "<next-continuation va=\"%ld\"/>\n", PRUptrdiff(mNextContinuation));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<nsIURI> 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, "<font %s %d %d %d />\n",
|
||||
NS_ConvertUTF16toUTF8(font->mFont.name).get(),
|
||||
font->mFont.size,
|
||||
font->mSize,
|
||||
font->mGenericID);
|
||||
|
||||
// COLOR
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleColor* color = GetStyleColor();
|
||||
fprintf(out, "<color data=\"%ld\"/>\n",
|
||||
(long)color->mColor);
|
||||
|
||||
// BACKGROUND
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleBackground* bg = GetStyleBackground();
|
||||
fprintf(out, "<background data=\"%d %d %d %ld %ld %ld %s\"/>\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, "<spacing data=\"");
|
||||
|
||||
const nsStyleMargin* margin = GetStyleMargin();
|
||||
margin->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, "<list data=\"%d %d %s\" />\n",
|
||||
(int)list->mListStyleType,
|
||||
(int)list->mListStyleType,
|
||||
URICString(list->mListStyleImage).get());
|
||||
|
||||
// POSITION
|
||||
IndentBy(out,aIndent);
|
||||
const nsStylePosition* pos = GetStylePosition();
|
||||
fprintf(out, "<position data=\"");
|
||||
pos->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, "<text data=\"%d %d %d %d",
|
||||
(int)text->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, "<textreset data=\"%d ",
|
||||
(int)textReset->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, "<display data=\"%d %d %f %d %d %d %d %d %d %d %ld %ld %ld %ld %s\" />\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, "<visibility data=\"%d %d\" />\n",
|
||||
(int)vis->mDirection,
|
||||
(int)vis->mVisible
|
||||
);
|
||||
|
||||
// TABLE
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleTable* table = GetStyleTable();
|
||||
fprintf(out, "<table data=\"%d %d %d ",
|
||||
(int)table->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, "<tableborder data=\"%d %d %d %d %d ",
|
||||
(int)tableBorder->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, "<content data=\"%ld %ld %ld ",
|
||||
(long)content->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, "<quotes data=\"%ld ",
|
||||
(long)quotes->QuotesCount());
|
||||
// XXX: iterate over the quotes...
|
||||
fprintf(out, "\" />\n");
|
||||
|
||||
// UI
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleUserInterface* ui = GetStyleUserInterface();
|
||||
fprintf(out, "<ui data=\"%d %d %d %d\" />\n",
|
||||
(int)ui->mUserInput,
|
||||
(int)ui->mUserModify,
|
||||
(int)ui->mUserFocus,
|
||||
(int)ui->mCursor);
|
||||
|
||||
// UIReset
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleUIReset* uiReset = GetStyleUIReset();
|
||||
fprintf(out, "<uireset data=\"%d %d %d\" />\n",
|
||||
(int)uiReset->mUserSelect,
|
||||
(int)uiReset->mIMEMode,
|
||||
(int)uiReset->mWindowShadow);
|
||||
|
||||
// Column
|
||||
IndentBy(out,aIndent);
|
||||
const nsStyleColumn* column = GetStyleColumn();
|
||||
fprintf(out, "<column data=\"%d ",
|
||||
(int)column->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, "<xul data=\"%d %d %d %d %d %d",
|
||||
(int)xul->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, "<svg data=\"%d ",(int)svg->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, "<svgreset data=\"%ld ", (long)svgReset->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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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];
|
||||
|
|
Загрузка…
Ссылка в новой задаче