Bug 1088900 - Parse console.group/groupCollapse for custom styling. r=baku draft
authornchevobbe <nchevobbe@mozilla.com>
Tue, 11 Apr 2017 15:14:40 +0200 (2017-04-11)
changeset 561106 256ef1ffc80157751cb202cc163cb2ca42c7397a
parent 559608 731639fccc709a4dd95fed7e9dda88efb2227906
child 561107 b185f66e240448e5fc2858c9454ecd33439dd514
push id53639
push userbmo:nchevobbe@mozilla.com
push dateWed, 12 Apr 2017 08:32:07 +0000 (2017-04-12)
reviewersbaku
bugs1088900
milestone55.0a1
Bug 1088900 - Parse console.group/groupCollapse for custom styling. r=baku Process the arguments of "MethodGroup" and "MethodGroupCollapsed" Use the result of ProcessArguments to compute the groupName so we can get rid of the "%c" parts. MozReview-Commit-ID: 5B2jqG5RoRj
dom/console/Console.cpp
--- a/dom/console/Console.cpp
+++ b/dom/console/Console.cpp
@@ -1555,16 +1555,19 @@ Console::PopulateConsoleNotificationInTh
   switch (aData->mMethodName) {
     case MethodLog:
     case MethodInfo:
     case MethodWarn:
     case MethodError:
     case MethodException:
     case MethodDebug:
     case MethodAssert:
+    case MethodGroup:
+    case MethodGroupCollapsed:
+    case MethodGroupEnd:
       event.mArguments.Construct();
       event.mStyles.Construct();
       if (NS_WARN_IF(!ProcessArguments(aCx, aArguments,
                                        event.mArguments.Value(),
                                        event.mStyles.Value()))) {
         return false;
       }
 
@@ -1576,17 +1579,17 @@ Console::PopulateConsoleNotificationInTh
                                            event.mArguments.Value()))) {
         return false;
       }
   }
 
   if (aData->mMethodName == MethodGroup ||
       aData->mMethodName == MethodGroupCollapsed ||
       aData->mMethodName == MethodGroupEnd) {
-    ComposeGroupName(aCx, aArguments, event.mGroupName);
+    ComposeGroupName(aCx, event.mArguments.Value(), event.mGroupName);
   }
 
   else if (aData->mMethodName == MethodTime && !aArguments.IsEmpty()) {
     event.mTimer = CreateStartTimerValue(aCx, aData->mStartTimerLabel,
                                          aData->mStartTimerStatus);
   }
 
   else if (aData->mMethodName == MethodTimeEnd && !aArguments.IsEmpty()) {