Bug 1126140 - Remove duplicated selector lists in StyleRule::List output. r=dbaron
authorCameron McCormack <cam@mcc.id.au>
Tue, 27 Jan 2015 16:08:57 +1100
changeset 239284 a38c9be1a4be049605c63a9c89a8fe0d8bda561a
parent 239283 a9edb65373b8d0c3874a69461dc069fb04ab96b2
child 239285 daaf6d3b3db95af2fc43069c6aedab6d0804c9a6
push id497
push usermleibovic@mozilla.com
push dateWed, 28 Jan 2015 16:43:37 +0000
reviewersdbaron
bugs1126140
milestone38.0a1
Bug 1126140 - Remove duplicated selector lists in StyleRule::List output. r=dbaron
layout/style/StyleRule.cpp
--- a/layout/style/StyleRule.cpp
+++ b/layout/style/StyleRule.cpp
@@ -1475,24 +1475,25 @@ StyleRule::MapRuleInfoInto(nsRuleData* a
 StyleRule::List(FILE* out, int32_t aIndent) const
 {
   nsAutoCString str;
   // Indent
   for (int32_t index = aIndent; --index >= 0; ) {
     str.AppendLiteral("  ");
   }
 
-  nsAutoString buffer;
   if (mSelector) {
+    nsAutoString buffer;
     mSelector->ToString(buffer, GetStyleSheet());
     AppendUTF16toUTF8(buffer, str);
     str.Append(' ');
   }
 
   if (nullptr != mDeclaration) {
+    nsAutoString buffer;
     str.AppendLiteral("{ ");
     mDeclaration->ToString(buffer);
     AppendUTF16toUTF8(buffer, str);
     str.Append('}');
   }
   else {
     str.AppendLiteral("{ null declaration }");
   }