Bug 174842 - Web Inspector: Don't output "No message" for multi-value logs like console.log(x, y)
Summary: Web Inspector: Don't output "No message" for multi-value logs like console.lo...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-25 16:15 PDT by Joseph Pecoraro
Modified: 2017-07-25 19:27 PDT (History)
4 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (5.98 KB, patch)
2017-07-25 16:28 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
[PATCH] Proposed Fix (5.98 KB, patch)
2017-07-25 16:32 PDT, Joseph Pecoraro
mattbaker: review+
joepeck: commit-queue-
Details | Formatted Diff | Diff
[PATCH] For Landing (6.23 KB, patch)
2017-07-25 18:48 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2017-07-25 16:15:03 PDT
Don't output "No message" for multi-value logs like console.log(x, y)

Test:
console.log(100, 200)

Expected:
[Log] 100 – 200

Actual:
[Log] No Message – 100 – 200
Comment 1 Joseph Pecoraro 2017-07-25 16:28:09 PDT
Created attachment 316404 [details]
[PATCH] Proposed Fix
Comment 2 Joseph Pecoraro 2017-07-25 16:32:21 PDT
Created attachment 316405 [details]
[PATCH] Proposed Fix

Now that commit-queue has caught up to the rest of the world.
Comment 3 Matt Baker 2017-07-25 16:49:14 PDT
Comment on attachment 316405 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=316405&action=review

r=me

> Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js:476
> +                    }

I know it's only in two places, but a helper might be nice:

function createDivider() {
    let divider = document.createElement("span");
    divider.textContent = ` ${enDash} `;
    divider.classList.add("console-message-preview-divider");
    return divider;
}

if (needsDivider) {
    builderElement.appendChild(createDivider());
Comment 4 Joseph Pecoraro 2017-07-25 18:48:04 PDT
Comment on attachment 316405 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=316405&action=review

>> Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js:476
>> +                    }
> 
> I know it's only in two places, but a helper might be nice:
> 
> function createDivider() {
>     let divider = document.createElement("span");
>     divider.textContent = ` ${enDash} `;
>     divider.classList.add("console-message-preview-divider");
>     return divider;
> }
> 
> if (needsDivider) {
>     builderElement.appendChild(createDivider());

This actually exposed an issue, in the case below `enclosedElement` is used later on to add the "inline-lossless" class if it is needed.

I extracted this out into an: `appendDividerIfNeeded` method which then makes it easy to correct the code below as well.
Comment 5 Joseph Pecoraro 2017-07-25 18:48:47 PDT
Created attachment 316417 [details]
[PATCH] For Landing
Comment 6 WebKit Commit Bot 2017-07-25 19:27:11 PDT
Comment on attachment 316417 [details]
[PATCH] For Landing

Clearing flags on attachment: 316417

Committed r219900: <http://trac.webkit.org/changeset/219900>