New issue
Advanced search Search tips

Issue 810581 link

Starred by 12 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

DevTools: console messages using style formatter with line breaks looks strange

Project Member Reported by l...@chromium.org, Feb 9 2018

Issue description

Evaluate this in the DevTools console:
console.log('foo%cbar\n\t', 'color:green')
 
Also this :

console.log("foo%cbar Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", "color:green");

When the console isn't wide enough to fit the message on one line, it'll break after style tags. %c here

Comment 2 Deleted

looks strange

console.log('%cfoo \n %cbar \n %cbaz \n', 'color: red', 'color:green', 'color: blue')

Expected:

foo 
 bar 
 baz

Actual (Chrome)
foo bar
        baz

Comment 4 Deleted

Bug

console.log(
	'%c A \n B \n C \n %c D \n E', 
	'background: #fff;color:red;'
);

 A 
 B 
 C   D 
  %c E
 Issue 830175  has been merged into this issue.
 Issue 832716  has been merged into this issue.
Project Member

Comment 8 by bugdroid1@chromium.org, May 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cf20524aad95b76a21447a354926a313f6e618f4

commit cf20524aad95b76a21447a354926a313f6e618f4
Author: Erik Luo <luoe@chromium.org>
Date: Thu May 17 22:06:12 2018

DevTools: fix console style formatter regressions

This CL addresses vertical alignment, horizontal overflow, and the
creation of newlines in Console logs that use the style formatter.

Very long fragments still break into their own block, due to the
`contain: paint` rule.

Screenshot: https://imgur.com/a/QiNbvIT

Bug:  810581 
Change-Id: Iefb5533d5696a7b91e3ff9863af67740a8e07225
Reviewed-on: https://chromium-review.googlesource.com/1058394
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559700}
[modify] https://crrev.com/cf20524aad95b76a21447a354926a313f6e618f4/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style-expected.txt
[modify] https://crrev.com/cf20524aad95b76a21447a354926a313f6e618f4/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style-whitelist-expected.txt
[modify] https://crrev.com/cf20524aad95b76a21447a354926a313f6e618f4/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style.js
[modify] https://crrev.com/cf20524aad95b76a21447a354926a313f6e618f4/third_party/blink/renderer/devtools/front_end/console/ConsoleViewMessage.js

Comment 9 by l...@chromium.org, May 17 2018

Status: Fixed (was: Assigned)

Comment 10 by woxxom@gmail.com, May 24 2018

Will you merge the fix to 67?

Comment 11 by l...@chromium.org, May 24 2018

M67 is planned for stable release soon, and might be out by next week.  There is not enough time to bake in canary and beta, so I do not plan to merge.  The patch in #8 still targets M68.
 Issue 846364  has been merged into this issue.
Cc: vamshi.kommuri@chromium.org
 Issue 860630  has been merged into this issue.

Sign in to add a comment