зеркало из https://github.com/mozilla/gecko-dev.git
Bug 700240 - Print contents of TextFrames. r=mats
This commit is contained in:
Родитель
76656ee23d
Коммит
f67db2208c
|
@ -7740,7 +7740,13 @@ nsTextFrame::IsEmpty()
|
|||
NS_IMETHODIMP
|
||||
nsTextFrame::GetFrameName(nsAString& aResult) const
|
||||
{
|
||||
return MakeFrameName(NS_LITERAL_STRING("Text"), aResult);
|
||||
MakeFrameName(NS_LITERAL_STRING("Text"), aResult);
|
||||
PRInt32 totalContentLength;
|
||||
nsCAutoString tmp;
|
||||
ToCString(tmp, &totalContentLength);
|
||||
tmp.SetLength(NS_MIN(tmp.Length(), 50u));
|
||||
aResult += NS_LITERAL_STRING("\"") + NS_ConvertASCIItoUTF16(tmp) + NS_LITERAL_STRING("\"");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(nsFrameState)
|
||||
|
@ -7762,12 +7768,8 @@ nsTextFrame::List(FILE* out, PRInt32 aIndent) const
|
|||
}
|
||||
fprintf(out, " [run=%p]", static_cast<void*>(mTextRun));
|
||||
|
||||
PRInt32 totalContentLength;
|
||||
nsCAutoString tmp;
|
||||
ToCString(tmp, &totalContentLength);
|
||||
|
||||
// Output the first/last content offset and prev/next in flow info
|
||||
bool isComplete = GetContentEnd() == totalContentLength;
|
||||
bool isComplete = GetContentEnd() == GetContent()->TextLength();
|
||||
fprintf(out, "[%d,%d,%c] ",
|
||||
GetContentOffset(), GetContentLength(),
|
||||
isComplete ? 'T':'F');
|
||||
|
@ -7811,20 +7813,7 @@ nsTextFrame::List(FILE* out, PRInt32 aIndent) const
|
|||
fprintf(out, " pst=%s",
|
||||
NS_LossyConvertUTF16toASCII(atomString).get());
|
||||
}
|
||||
fputs("<\n", out);
|
||||
|
||||
// Output the text
|
||||
aIndent++;
|
||||
|
||||
IndentBy(out, aIndent);
|
||||
fputs("\"", out);
|
||||
fputs(tmp.get(), out);
|
||||
fputs("\"\n", out);
|
||||
|
||||
aIndent--;
|
||||
IndentBy(out, aIndent);
|
||||
fputs(">\n", out);
|
||||
|
||||
fputs("\n", out);
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче