Commit Graph
181 Commits
Author SHA1 Message Date
Kateryna Prokopenko fbb2247690 Type all path and URL variables in ui/legacy to Branded Types
Bug: 1299791
Change-Id: I3648366445238aeb30fa699556fa9d9a4ee937e6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3629859
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-05-11 09:39:12 +00:00
Jack Franklin e839c0cf22 Enable long import wrapping for JS imports
DISABLE_THIRD_PARTY_CHECK=big clang format run against all files in
front_end and test/

Bug: 1319340
Change-Id: I1fff63cb07544ccd0e3059fc901f9a48ff4af13b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598879
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
2022-05-03 10:22:12 +00:00
Jack Franklin 311b4a28a0 De-prototype #deepActiveElement
Removes `deepActiveElement` from the prototype and defines a util for
it.

Bug: 1050549
Change-Id: I0376ba0b3a00d82c070f2d4ada12350771046790
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3586910
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-04-19 11:12:54 +00:00
Johan Bay 6f59bfbb3b Move autocomplete hints into devtools-text-editor component
Having the autocomplete element live outside of the components shadow
dom breaks accessibility of the editor. The console editor references
the autocomplete element by id through aria-activedescendant and
aria-controls but the id does not resolve as the editor is encapsulated
in shadow dom.

Bug: 1314078, 1314101
Change-Id: I414dbb7829bd2a1c6a0b1127422a0398263a598d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3581034
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Johan Bay <jobay@chromium.org>
2022-04-19 06:40:24 +00:00
Andres Olivares fe2954c5a7 Add tooltips with description to console checkbox settings
Some labels of the checkboxes in the console settings didn't have titles
that explained the setting with a tooltip. This CL adds them for those
that were lacking.

Took the opportunity to introduce a helper function to extract and
remove redundant code.

Fixed: 1246785
Change-Id: Ic64234f580d137e739d80988a924533991fbe1b1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3568993
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
2022-04-05 18:04:23 +00:00
Kateryna Prokopenko 768dea3c3c Partly type path and URL variables in files in panel/ to Branded Types
Bug: 1299781
Change-Id: I8c3b9a0131f94c3e129ec966bd457d5efb2a9b22
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3563072
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-04-05 11:19:55 +00:00
Benedikt Meurer f6f73b8d9e [console] Commit live expressions with 'Enter'.
The live expression editor in the Console tab didn't commit the live
expression when hitting 'Enter', but was adding new lines instead. That
was quite different from other parts of the DevTools UI. Instead the
user would have to hit 'Ctrl-Enter'. This CL changes the editor to also
commit on 'Enter' (leaving the 'Ctrl-Enter' shortcut as well for now).

Fixed: chromium:1260744
Change-Id: I1cf54f26508be43cc8f6ffb915c577898bc6df93
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3563077
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
2022-04-01 14:09:01 +00:00
Yang Guo 63b2259b98 Fully scroll console history into view when going back through history
R=kimanh@chromium.org

Fixed: 1310810
Change-Id: Ifbac4a87ee768bb4dcddef8e5e6f87056c7e2ade
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3560427
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2022-03-31 08:00:00 +00:00
Kateryna Prokopenko 2a1b3a93b0 Type all path and URL variables in WorkspaceImpl to Branded Types
Bug: 1299780
Change-Id: I1dffe6edc834cf5914d48c4e331510b1866f78b8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3484200
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-03-22 10:45:29 +00:00
Kateryna Prokopenko 380fdfac97 Type all URL and path variables in FileManager to Branded Types
Bug: 1299780
Change-Id: I65c083c166ea4e57938f14e4d9ff3b96b2c03083
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3484197
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-03-16 17:26:57 +00:00
Jaroslav Sevcik 4819559329 Block urls in console.log %c formatter styles
We block some URL schemes (such as http or file) from style values in
the %c formatter for console.log. This is to prevent the requests from
bypassing security policies and leaking data.

Bug: chromium:1223475
Change-Id: I779cb95f523fcfbc84ce5edf1320d1ffde4d94fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3522264
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
2022-03-15 10:55:37 +00:00
Jaroslav Sevcik 97a93b6671 Substitution of minified identifiers in expressions
Without this patch, we only substituted single identifiers. With
the patch, we substitute in arbitrary expressions. (Still only
as an experiment.)

Bug: chromium:1297047
Change-Id: Ifae5cab1a42823559751fbd9dc515edfae02255e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3487866
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
2022-03-09 09:13:21 +00:00
Kateryna Prokopenko abbbc28fe8 Remove casts to UrlString from several files
Bug: 1253323
Change-Id: Id5ec0639de629e0b08c6e7cc8137b0ce5f5253fa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3468520
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-03-07 15:54:30 +00:00
Tim van der Lippe a7f31bcf1f Hide console drawer if no argument hints are shown
In https://crrev.com/c/3477109 the logic for the escape keybinding was
updated to hide the argument hints tooltip. However, this also overwrote
the default escape keybinding for the console panel. That's because we
returned `true` (which signals CodeMirror to stop propagation of
keybindings) regardless of the tooltip was open or not.

Now, we store the state of the tooltip and when we want to attempt to
close the tooltip, we check if it was actually opened. If it wasn't, we
return `false`, which means that the default escape keybinding behavior
is triggered. However, if we can find it, we close the tooltip as we did
before.

R=yangguo@chromium.org

Fixed: 1300115
Change-Id: I8ea5a490365b0f67e0f50056724d2fe495d2338b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3484203
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-23 16:01:23 +00:00
Kateryna Prokopenko bf7b615577 Remove casts to UrlString from SourcesMap.ts
The one remaining cast has to stay as it types the empty string.

Bug: 1299773
Change-Id: I67a400fc9ac26105e067320e96e74bbfe29cf8fc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3468515
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-02-22 15:45:07 +00:00
Tim van der Lippe ab78bc61ba Close arguments hints tooltip when finished
The console prompt is one of two places (the other being the edit
breakpoint prompt) that uses arguments hints. However, when the user
would show the arguments hints and be finished with it (e.g. hitting
escape or entering a command), they wouldn't properly hide.

The functionality is implemented in `cursor_tooltip`, which defines
the two view effects that trigger opening/closing the tooltip. However,
there was no outside access to these effects and they were not hooked
up to the corresponding view (in this case residing in `ConsolePrompt.ts`).

To make sure that the ConsolePrompt doesn't learn too much about the
inner workings of the text editor, we expose a separate function on
the JavaScript functionality of the editor. It dispatches the close
effect on the view, which ensures that the arguments hints tooltip
is properly hidden. This is also true for entering a command,
which is implemented in `handleEnter`.

Lastly, update the internal cursor_tooltip plugin to use private methods,
to clearly denote what is part of the public API (`update`) and what
isn't (the rest).

R=yangguo@chromium.org

Fixed: 1299196, 1299186
Change-Id: I650c25f42564be8992a849b6b8deefff51ff7826
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3477109
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2022-02-21 16:23:35 +00:00
Simon Zünd fd32a1664e [cleanup] Remove explicit undefineds from Linkifier option bags
Explicit undefineds in objectl iterals are left-over artifact when
we had to make the Closure and TypeScript compiler happy at the same
time. Closure has been gone for a while so we don't have to
explicitly set properties that can be undefined.

R=kimanh@chromium.org

Bug: None
Change-Id: I9c01fc8efe82dc1cf377f8663f132ff0026263bb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3461551
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-02-16 09:21:15 +00:00
Jaroslav Sevcik f336ccf23d Expression evaluation with sourcemaps (under flag)
This is a first step towards evaluating expressions with source map
resolution in the console.

This patch only replaces single variables expressions with the name
inferred from the source map. The feature is behind a flag because it is
still far from being usable (e.g., no support for more complex
expressions, auto-complete, partial expression evaluation, fallback UI,
etc.).

Bug: chromium:1297047
Change-Id: I5d4a233f65cf27112c370eeb81c509cd3e14623d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3461558
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
2022-02-16 08:01:52 +00:00
Simon Zünd 4e3348ef46 [console] Always append the source location for SyntaxErrors
This CL changes how we render SyntaxErrors in the DevTools console.
SyntaxErrors don't contain a stack frame with the source position
where exactly the SyntaxError is. This is because V8 throws
SyntaxErrors while parsing, not at runtime. At most, the top-most
stack frame is a call to 'eval'.

This CL uses the info from `Runtime.getExceptionDetails` to append
the source location of the error to the console message.

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

Please note that the Runtime.getExceptionDetails info is only
available when DevTools was already open when the script fails
to parse. This is because the inspector does not cache failed
parse events (opposed to successful script parses).

R=bmeurer@chromium.org

Bug: 1066909
Change-Id: Ibf013d978c13970a688326d9afb9bf0bb14eff99
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3461550
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-02-15 08:48:58 +00:00
Yang Guo 23dd4bcf0e Reduce uses of cursor: pointer
DevTools UI should behave like browser UI. Therefore interactive UI
elements should not need to change the mouse cursor to a hand with
pointing finger.

In particular, this CL removes `cursor: pointer` for

 - toolbar icons
 - buttons
 - panel tabs (vertical and horizontal)
 - issues hint icon
 - computed styles
 - Trust token delete button
 - adorners
 - data grid header for sorting
 - code folding marker in CodeMirror
 - animation previews
 - DOM tree guttor '...' menu
 - elements bread crumbs overflow buttons
 - color blocks in CSS Overview
 - device preset bars
 - devices list items
 - network request header and payload views
 - Media panel
 - delete buttons for watch expression and event listeners

Bug: 1291516
Change-Id: I182c43a43b94de31d1d8f2db4cd7831e82c535bb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3447411
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2022-02-11 12:29:34 +00:00
Simon Zünd 6ee03fa8ed [console] Return prefix and suffix directly instead of indices
Small refactoring around the data structure returned by the
ErrorStackParser. With returned prefix + suffix its easier for a
follow-up CL to "spoof" a stack frame.

R=pfaffe@chromium.org

Bug: 1066909
Change-Id: Ie2c694ea3b955ac526c76aa5bd2d462c03243d52
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3443341
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-02-07 17:13:45 +00:00
Simon Zünd 6a1a3c6c4c [console] Use scriptId for better Error#stack linking
This CL combines the info from Runtime#getExceptionDetails with the
parsed Error#stack to improve linkification. With the additional
exception details we can link to a concrete scriptId rather then
having to guess the script.

R=pfaffe@chromium.org

Fixed: 1280141
Change-Id: I580a2d824f9d90b6376dfc77c6017d7649d2ceba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3418499
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-02-01 08:09:00 +00:00
Jack Lynch 846327d74b Announce sidebar expansion for screen readers
This CL adds a screen reader announcement when a SplitWidget sidebar is
expanded or collapsed to improve navigation for screen reader users,
similarly to how an announcement was added [1] for the main drawer.

[1] https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3307501

Bug: 1278136
Change-Id: I24edee00aea279b4f6ccf039b81338abfe07c656
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3325481
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
2022-01-19 19:03:11 +00:00
Simon Zünd df63e266a6 Add unit tests for ErrorStackParser
This CL documents the existing behavior of Error#stack parsing in the
form of unit tests. This will allow safer refactorings of the same
code going forward.

Drive-by: Remove an unnecessary null check.

R=pfaffe@chromium.org

Bug: 1280141
Change-Id: I933062f44a5ab9bf0fec7c5e4282715db033b6a2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3398888
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-01-18 17:07:06 +00:00
Simon Zünd 7df8f14bb5 [console] Replace Error prefix list with regex only
The regex is already a superset of the current prefix list so there
is no need for the static prefix list.
The regex was changed slightly to also allow the standard "Error".

R=pfaffe@chromium.org

Bug: 1280141
Change-Id: Id5977123dccd544bde7a293b2fa515e8cf18bb82
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3397924
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-01-18 17:00:56 +00:00
Simon Zünd da7f13eeaa [cleanup] Move Error#stack parsing into standalone function
This is a mostly mechanical change extracting part of the code of
"tryFormatAsError" into a standalone function.

Follow-up changes will refactor the code to not have any dependencies
to the Debugger or Runtime model and add tests.

R=pfaffe@chromium.org

Bug: 1280141
Change-Id: Ibcb1d42c914919e50ffbb66fec65fbfc260af6e1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3397918
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-01-18 12:36:25 +00:00
Paul Lewis 982b1a562e Removes aerotwist from OWNERS
Thanks for everything :)

DISABLE_THIRD_PARTY_CHECK=Necessary for change

Bug: None
Change-Id: I1769098f0379eb919fb77ba8e98564642c8cc387
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3386941
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-01-14 16:41:50 +00:00
Tim van der Lippe 6bcbe0f26d Use window.setTimeout to avoid TS errors in VS Code
R=aerotwist@chromium.org

Bug: none
Change-Id: I632aa0beb0e157197f5c2f982c2082a6d67f87f4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3380595
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-01-11 19:17:48 +00:00
Takuto Ikuta 0365ceeb72 tweak some import/code layout for esbuild
This is extracted from https://crrev.com/c/3330076/11

Change for front_end/panels/console/ConsoleSidebar.ts is to fix
GroupName reference before declaration for esbuild.

Bug: 1278663
Change-Id: I5f582a3d90922f8269a0e5bb647a8ff30644220d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3372081
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2022-01-07 10:12:59 +00:00
Tim van der Lippe 2d9a95ce7b Suppress all existing promise races
To suppress the races, we mark these invocations with `void` per
the instructions of `no-floating-promises`. This explicitly marks
these statements as side-effect promises.

Engineers can later analyze these void statements and determine
whether the promise races are intentional or accidental.

R=jacktfranklin@chromium.org

Bug: 1239617
Change-Id: I6b7a24cf21029d6ff73b112b3e8255ebab8c60ec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3366467
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-01-04 16:08:08 +00:00
Yang Guo 94734947c4 Implement intuitive filter for console groups
Until now, console group titles were always shown despite filter.

Now, a console message is shown if:
 - its message content matches the filter
 - the title of the group (or parent group, grand-parent group, etc.
   matches the filter.

If a console message is shown, then the group it belongs to
(including parent group, grand-parent group, etc.) are also shown.


Fixed: 1068788
Change-Id: I04f280b185d183bd9992b9b65ef9a9d20da0a36f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3364094
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2022-01-03 15:38:16 +00:00
Jecelyn Yeen f061ee77a8 Add dark-theme color palette for console format
Screenshot: https://imgur.com/a/tPHWN2k

Bug: 1283173
Change-Id: Iaa8a38e6571b985d9c449eef9ee6ba750c997852
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3358225
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jecelyn Yeen <jec@chromium.org>
2022-01-03 14:08:36 +00:00
Yang Guo 9f7cf70b8a Fix overflow layout for object preview
Fixed: 1282982
Change-Id: I794a927868e1bfa33281a1538f52ef03e6eefd93
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3358536
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
2021-12-29 16:10:03 +00:00
Benedikt Meurer 2ec299d49c [console] Support more ANSI color codes.
Previously the DevTools console had some very limited support for ANSI
color codes, and only a single code could take effect at any point in
time (i.e. it was impossible to control both foreground and background
color at the same time).

With this change, we're adding support for controlling the font weight
and style, as well as the text decoration, via the respective ANSI color
codes. We also support setting foreground and background color via RGB
codes now. And there's support to reset individual display attributes or
all of them together.

All of this is implemented as state that is maintained between and
updated by ANSI color codes, so that you can now appropriately set both
the background and the foreground color.

The colors used were updated to make sense for the browser (i.e. some of
the color names used before weren't even valid in CSS). Now this is
using the standard VGA palette (including the brownish yellow color
trick).

Fixed: chromium:1282837
Bug: chromium:1282076
Change-Id: I3a1f9ef0de539cac595a2122e5eaf790fae04858
Doc: https://bit.ly/devtools-console-ansi-support
Before: https://imgur.com/aEhEUIe.png
After: https://imgur.com/PvjHOlZ.png
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3358537
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
2021-12-29 09:00:31 +00:00
Benedikt Meurer 22a372d445 [console] Align message formatting with Console Standard.
This introduces a dedicated `ConsoleFormat.format()` function, which
correctly implements the (potentially) recursive formatting of arguments
to console.log() and friends as specified in the Console Standard.

I intentionally did not extend the generic `StringUtilities.format()`
function, which was designed to be used in many different ways, and for
other users, it would be surprising to get the console behavior (which
is why we previously already decoupled the `StringUtilities.sprintf()`
function in http://crrev.com/c/3354896).

Bug: chromium:1277944
Fixed: chromium:1282076
Spec: https://console.spec.whatwg.org
Doc: https://bit.ly/v8-proper-console-type-conversions
Change-Id: If51cc9a2bbb7eccb088f3351045c05ef37628029
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3358196
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
2021-12-28 06:10:00 +00:00
Tim van der Lippe 0441802c9b Cleanup legacy-defs.d.ts
Some of the definitions were already unused. Others have been moved
to their appropriate location or refactored away (such as the
RegExp hack).

R=jacktfranklin@chromium.org

Bug: none
Change-Id: Ib4153916bd30a0ef7c8a58d65e7421af11a58ea0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3344906
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-12-16 11:20:28 +00:00
Paul Lewis 5fec567a80 Remove patchColorText in ConsoleViewMessage
We had a case of applying JS-based colors to console messages using the
deprecated patchColorText function. This CL removes that usage and puts
in additional CSS variables to style the console messages directly.

R=jacktfranklin@chromium.org

Bug: 1278738
Change-Id: I1a4c390740d3ddad642c911b97535e3cd22132ca
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3334543
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2021-12-14 14:52:06 +00:00
Marijn Haverbeke 0adc72340d Use the backend in isExpressionComplete again
R=tvanderlippe@chromium.org

Bug: 1277979
Change-Id: Ia3b807dfc032a438b22667d5d959d450b4cc6c7b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3323057
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2021-12-09 12:12:37 +00:00
Yang Guo 8001684053 Remove dead code from ConsolePrompts.ts
R=tvanderlippe@chromium.org

Bug:none
Change-Id: Id419ceb6d80c18f6c493027bab14de09f750395a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3317351
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2021-12-06 14:18:34 +00:00
Marijn Haverbeke f034f0b144 Reland "Port the console prompt to CodeMirror 6"
This reverts commit d635360712.

Reason for revert: tests should be fixed now

Original change's description:
> Revert "Port the console prompt to CodeMirror 6"
>
> This reverts commit 71cd14a337.
>
> Reason for revert: This CL caused the waterfall to go red
> https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Mac/6200/test-results
>
> Original change's description:
> > Port the console prompt to CodeMirror 6
> >
> > And fix some autocompletion issues that came up when testing it.
> >
> > R=​tvanderlippe@chromium.org
> >
> > Bug: 1241848
> > Change-Id: I70d7fefa5fe3c9e09429d0b9a8fc4e39f0fe3f44
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3289305
> > Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
>
> Bug: 1241848
> Change-Id: Ied3d3eb14ddf495e70445a1cb7076cdfab5f38fa
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3291584
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Nancy Li <nancyly@chromium.org>
> Auto-Submit: Nancy Li <nancyly@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

Bug: 1241848
Change-Id: If88bafb86bd1730a0b81a0f362ed781584013289
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3295531
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Victor Porof <victorporof@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-22 16:10:18 +00:00
Benedikt Meurer 07f2c331a1 [console] Fix fallback anchor display.
In the `Linkifier` we'd previously try to make the `anchor` look like
the `fallbackAnchor` in place when a target was disposed, but that
for example missed the event handlers (i.e. they were still in place
afterwards). Since we already have the `fallbackAnchor` constructed
it's straight forward to just put it in place of the `anchor` in the
DOM tree.

Also don't override the `cursor` for `.devtools-link` in console
messages, but stick to the (system wide) defaults, which ensures that
links that aren't supposed to be clickable (have the `preventClick`
option set to a trueish value) don't change to a `pointer` cursor
even inside the Console panel.

Fixed: chromium:1272413
Bug: chromium:1270248, chromium:1271078
Change-Id: Ib3ee739b1e4742667072a7c2d4ab4fd30847a1de
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3295526
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
2021-11-22 12:24:49 +00:00
Tim van der Lippe 603acd4972 Fix console.table
The legacy datagrid expects all users of its API to call `.asWidget`,
but doesn't actually enforce doing that. The `ConsoleViewMessage`
wasn't calling `.asWidget`, as it doesn't use a proper widget structure
itself.

Instead, we can manually recreate the widget with a shadowroot boundary,
so that the styles can properly be injected. Additionally, we need
to carry over the `objectValue` styles that `ConsoleView` also injects
in its root.

R=alexrudenko@chromium.org

Bug: 1271191
Change-Id: If9934ef54d51a961d8c0df7f02b96c7d9b0a5b92
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3291585
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2021-11-18 17:04:29 +00:00
Nancy Li d635360712 Revert "Port the console prompt to CodeMirror 6"
This reverts commit 71cd14a337.

Reason for revert: This CL caused the waterfall to go red
https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Mac/6200/test-results

Original change's description:
> Port the console prompt to CodeMirror 6
>
> And fix some autocompletion issues that came up when testing it.
>
> R=​tvanderlippe@chromium.org
>
> Bug: 1241848
> Change-Id: I70d7fefa5fe3c9e09429d0b9a8fc4e39f0fe3f44
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3289305
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>

Bug: 1241848
Change-Id: Ied3d3eb14ddf495e70445a1cb7076cdfab5f38fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3291584
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Nancy Li <nancyly@chromium.org>
Auto-Submit: Nancy Li <nancyly@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-18 15:40:37 +00:00
Tim van der Lippe 379c288384 Allow meta-files to import relative entrypoints
We previously disabled this rule in a lot of places to workaround the
fact that the rule wasn't adhering to importing entrypoints in meta
files. Instead, let's update the rule to make it clear that this pattern
is expected and fine.

R=alexrudenko@chromium.org

Bug: 1271490
Change-Id: Idd139b42d9bb27f1f20e573b31bcd5efff8815af
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3289221
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2021-11-18 14:53:06 +00:00
Benedikt Meurer 74c833904b [console] Properly await live expression results.
This effectively undoes the work-around for crbug/1211255 (which landed
as https://crrev.com/c/2910096), and which was made ineffective partly
by the fix for crbug/1271105, and replaces it with an easier (less
intrusive) solution: Instead of special casing promise rejection errors
from live expressions in console message grouping, we instead make sure
to properly await live expression results, which avoids the uncaught
promise rejection problem, and properly reports asynchronous errors
inside the live expression list (just like it's already the case for
synchronous errors).

Before: https://imgur.com/LjlDZtY.png
After: https://imgur.com/UBXAsYb.png
Fixed: chromium:1211255
Bug: chromium:1271105, chromium:1270248, chromium:1271078
Change-Id: Iee845047c93403bc6dc2ac7343e89fc149c8f968
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3289771
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2021-11-18 14:03:56 +00:00
Marijn Haverbeke 71cd14a337 Port the console prompt to CodeMirror 6
And fix some autocompletion issues that came up when testing it.

R=tvanderlippe@chromium.org

Bug: 1241848
Change-Id: I70d7fefa5fe3c9e09429d0b9a8fc4e39f0fe3f44
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3289305
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-18 13:04:57 +00:00
Marijn Haverbeke b0e3e7cfb2 Load CodeMirror synchronously
R=tvanderlippe@chromium.org

Bug: 1241848
Change-Id: If246cfa31ee28fe95027156a4a85d0ca31f6cb2a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3279182
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-15 14:57:47 +00:00
Tim van der Lippe c1ab112d90 Port the sources panels to CM6
R=tvanderlippe@chromium.org

Bug: 1241848
Change-Id: Idfe1658c9c2948b5c79c2845b9fd9472746a62b9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3247435
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-12 16:47:28 +00:00
Tim van der Lippe 25a6adb9c1 Reland "Fix all issues found by StyleLint 14"
This reverts commit f746fe4a57.

Reason for revert: fix the missing script_args variable.

Original change's description:
> Revert "Fix all issues found by StyleLint 14"
>
> This reverts commit fb8852321b.
>
> Reason for revert: breaks the presubmit. Since the tree is closed,
> a fix forward is not landing soon. Therefore, let's pre-emptively revert.
>
> Original change's description:
> > Fix all issues found by StyleLint 14
> >
> > These are mostly auto-fixed by Stylelint 14 with a couple of manual
> > fixes (adding quotes around urls and fixing some shorthand properties).
> >
> > A follow-up CL will update us to Stylelint 14, at which point they will
> > be enforced.
> >
> > R=​szuend@chromium.org
> >
> > Bug: none
> > Change-Id: Ia813854accd1eb86eccea64a5fbf1f8534563964
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3259540
> > Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
> > Commit-Queue: Simon Zünd <szuend@chromium.org>
> > Reviewed-by: Simon Zünd <szuend@chromium.org>
>
> Bug: none
> Change-Id: I155ef7e0633cba15b47439a37a71158b6dcb8f91
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3259702
> Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>

Bug: none
Change-Id: I81b402e4a30981cb1a0360053b3553cd1934cbe6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3259703
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-11-05 15:41:29 +00:00
Tim van der Lippe f746fe4a57 Revert "Fix all issues found by StyleLint 14"
This reverts commit fb8852321b.

Reason for revert: breaks the presubmit. Since the tree is closed,
a fix forward is not landing soon. Therefore, let's pre-emptively revert.

Original change's description:
> Fix all issues found by StyleLint 14
>
> These are mostly auto-fixed by Stylelint 14 with a couple of manual
> fixes (adding quotes around urls and fixing some shorthand properties).
>
> A follow-up CL will update us to Stylelint 14, at which point they will
> be enforced.
>
> R=​szuend@chromium.org
>
> Bug: none
> Change-Id: Ia813854accd1eb86eccea64a5fbf1f8534563964
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3259540
> Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Simon Zünd <szuend@chromium.org>

Bug: none
Change-Id: I155ef7e0633cba15b47439a37a71158b6dcb8f91
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3259702
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-11-04 16:13:19 +00:00