Bug 1126145 - Include style sheet URL and line number in StyleRule::List output. r=dbaron

This commit is contained in:
Cameron McCormack 2015-01-27 16:08:57 +11:00
parent 46b3c7ae9c
commit 8ec51307e6

View File

@ -1493,6 +1493,19 @@ StyleRule::List(FILE* out, int32_t aIndent) const
mDeclaration->ToString(buffer);
AppendUTF16toUTF8(buffer, str);
str.Append('}');
CSSStyleSheet* sheet = GetStyleSheet();
if (sheet) {
nsIURI* uri = sheet->GetSheetURI();
if (uri) {
nsAutoCString uristr;
str.Append(" /* ");
uri->GetSpec(uristr);
str.Append(uristr);
str.Append(':');
str.AppendInt(mLineNumber);
str.Append(" */");
}
}
}
else {
str.AppendLiteral("{ null declaration }");