Commit Graph
47 Commits
Author SHA1 Message Date
Tim van der Lippe d1a00aacb9 [globals] self.UI.context
R=jacktfranklin@chromium.org

Bug: 1058320
Change-Id: Icc1d806782e7624fff02e719670a2cca59070ddd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2364594
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-08-19 16:24:38 +00:00
Jan Scheffler c5bc69f8bf Migrate front_end/console to devtools_entrypoint
R=aerotwist@chromium.org, jacktfranklin@chromium.org

Bug: 1101738
Change-Id: I5c1030afe46de06dd92c0ce1678975ad25cf6634
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2328846
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-30 12:25:40 +00:00
Tim van der Lippe f49e23286b Replace single class invocations of createElementWithClass
This applies the following replacement to the codebase:

(\S+) = createElementWithClass\('(\w+)', '([^'\s]+)'\);

to

$1 = document.createElement('$2');\n$1.classList.add('$3');

R=aerotwist@chromium.org

No-Presubmit: true
Bug: 1011811, 1077215
Change-Id: I0d76b39f1ed8cd4a44f18f94e398db934ba4b09c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2176112
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-01 16:54:52 +00:00
Mathias Bynens 88e8f15748 Enable no-case-declarations lint rule
Lexical declarations in `case` and `default` clauses are a footgun,
since they are visible in the entire switch block, but they only
get initialized upon assignment, which only happens if the relevant
`case` is actually reached.

To ensure that such lexical declarations only apply to the current
`case` (which is usually the intention), `case` clauses containing
them should be wrapped in curly braces to create an explicit block.

More information:
https://eslint.org/docs/rules/no-case-declarations

Change-Id: I63d9341fcd76d4b9ce8281bd0e6573b886577f08
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2119685
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-03-25 15:26:13 +00:00
Paul Lewis 4a896b29ab [global] Remaps self.SDK.consoleModel
Moves self.SDK.consoleModel to an instance() method.

Bug: 1058320
Change-Id: I52e403c85e6d478e43f7f82d48a34cba0c4fe47d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107626
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-20 12:32:37 +00:00
Simon Zünd adb6d2e041 [cleanup] Remove awaitPromise argument from evaluateCommandInConsole
{awaitPromise} is set to false by all call-sites so we can remove
the argument all together.

R=petermarshall@chromium.org

Bug: chromium:1021921
Change-Id: I2b632c71f130576b2bfaee5a44dd520778b4a0dd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107526
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-03-18 09:39:59 +00:00
Paul Lewis 2d7d65c5e8 [global] Remaps self.Common.settings
This CL changes references to self.Common.settings (the global
instance of SDK.Common.Settings) over to
Common.Settings.Settings.instance(). To keep both TypeScript and
Closure happy we must make a method on the Settings class itself,
since it only allows private constructors to be accessed by static
methods on the class.

Bug: 1058320
Change-Id: I04afc8caf64acf29cdda13ef03ad05cfff4786a1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2091450
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-16 22:04:07 +00:00
Tim van der Lippe 9b2f871384 Migrate console/ to import cross-module
Bug: 1006759
Change-Id: I685b1c819e17acab6db5f440cdf8e4b173712649
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2051961
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-13 13:37:48 +00:00
Paul Lewis d990734442 [Global] Update refs to UI.context
Bug: 1006759
Change-Id: I4a405fb1d80f6a384a311a3482c37f943238b73f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019137
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-24 14:25:48 +00:00
Paul Lewis e504fd6a5f [Global] Updates refs to SDK.consoleModel
Bug: 1006759
Change-Id: Ifa6d7f177a22a38eaa4f3a16a26c797659ddee98
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2017145
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 17:10:50 +00:00
Paul Lewis 6bcdb18044 [Global] Update refs to Common.settings
Bug: 1006759
Change-Id: Ie1943b50ba8ba23fae4f52f958ae6f8c7b6a7d3f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016744
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 11:29:11 +00:00
Tim van der Lippe eaacb72383 Migrate console/ to ESM internally
Bug: 1006759
Change-Id: If15f5741c87ff711976a317910cbf01489db1d3e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1991515
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-10 14:03:57 +00:00
Yang Guo b2ab7ff465 Reland "Reland "Remove top-level await pre-processing""
This reverts commit 149d99e7f5.

Reason for revert: https://ci.chromium.org/p/chromium/builders/try/linux-rel/259684

Original change's description:
> Revert "Reland "Remove top-level await pre-processing""
> 
> This reverts commit 1e3659a463.
> 
> Reason for revert: Preparatory revert in case the corresponding
> V8 CL gets reverted as well.
> 
> Original change's description:
> > Reland "Remove top-level await pre-processing"
> > 
> > This is a reland of d4092e36af
> > 
> > The CL was speculatively reverted due to a deterministic bot failure
> > (https://ci.chromium.org/p/chromium/builders/ci/Deterministic%20Linux/25924)
> > 
> > The bot has since turned green without the revert beeing rolled into chromium.
> > Relanding this CL, to potentially fix the current red tree.
> > 
> > Original change's description:
> > > Remove top-level await pre-processing
> > >
> > > This CL removes the wrapping of code in async arrow functions, should
> > > the code contain 'await'. Support for top-level is implemented as part
> > > of V8's native REPL mode.
> > >
> > > R=petermarshall@chromium.org
> > >
> > > Bug: chromium:1021921
> > > Change-Id: I0a601dd9a469a108f39d2ea3abcf8700726a1d8e
> > > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1928927
> > > Commit-Queue: Simon Zünd <szuend@chromium.org>
> > > Reviewed-by: Peter Marshall <petermarshall@chromium.org>
> > > Reviewed-by: Mathias Bynens <mathias@chromium.org>
> > 
> > TBR: petermarshall@chromium.org
> > Bug: chromium:1021921
> > Change-Id: If7be71cabc6a41c5433636132d9c9f222162747f
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1947524
> > Reviewed-by: Simon Zünd <szuend@chromium.org>
> > Commit-Queue: Simon Zünd <szuend@chromium.org>
> 
> TBR=petermarshall@chromium.org,mathias@chromium.org,szuend@chromium.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: chromium:1021921
> Change-Id: I6643c1ed8336a96362be06b4c60d57cb12f760f9
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1950304
> Reviewed-by: Simon Zünd <szuend@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>

TBR=petermarshall@chromium.org,mathias@chromium.org,szuend@chromium.org

Change-Id: I994aa44882fb27bc7e36b0baf70f7f1bb9d90184
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1021921
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1953609
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2019-12-05 21:37:03 +00:00
Simon Zünd 149d99e7f5 Revert "Reland "Remove top-level await pre-processing""
This reverts commit 1e3659a463.

Reason for revert: Preparatory revert in case the corresponding
V8 CL gets reverted as well.

Original change's description:
> Reland "Remove top-level await pre-processing"
> 
> This is a reland of d4092e36af
> 
> The CL was speculatively reverted due to a deterministic bot failure
> (https://ci.chromium.org/p/chromium/builders/ci/Deterministic%20Linux/25924)
> 
> The bot has since turned green without the revert beeing rolled into chromium.
> Relanding this CL, to potentially fix the current red tree.
> 
> Original change's description:
> > Remove top-level await pre-processing
> >
> > This CL removes the wrapping of code in async arrow functions, should
> > the code contain 'await'. Support for top-level is implemented as part
> > of V8's native REPL mode.
> >
> > R=petermarshall@chromium.org
> >
> > Bug: chromium:1021921
> > Change-Id: I0a601dd9a469a108f39d2ea3abcf8700726a1d8e
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1928927
> > Commit-Queue: Simon Zünd <szuend@chromium.org>
> > Reviewed-by: Peter Marshall <petermarshall@chromium.org>
> > Reviewed-by: Mathias Bynens <mathias@chromium.org>
> 
> TBR: petermarshall@chromium.org
> Bug: chromium:1021921
> Change-Id: If7be71cabc6a41c5433636132d9c9f222162747f
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1947524
> Reviewed-by: Simon Zünd <szuend@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>

TBR=petermarshall@chromium.org,mathias@chromium.org,szuend@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:1021921
Change-Id: I6643c1ed8336a96362be06b4c60d57cb12f760f9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1950304
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2019-12-05 07:33:40 +00:00
Simon Zünd 1e3659a463 Reland "Remove top-level await pre-processing"
This is a reland of d4092e36af

The CL was speculatively reverted due to a deterministic bot failure
(https://ci.chromium.org/p/chromium/builders/ci/Deterministic%20Linux/25924)

The bot has since turned green without the revert beeing rolled into chromium.
Relanding this CL, to potentially fix the current red tree.

Original change's description:
> Remove top-level await pre-processing
>
> This CL removes the wrapping of code in async arrow functions, should
> the code contain 'await'. Support for top-level is implemented as part
> of V8's native REPL mode.
>
> R=petermarshall@chromium.org
>
> Bug: chromium:1021921
> Change-Id: I0a601dd9a469a108f39d2ea3abcf8700726a1d8e
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1928927
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Peter Marshall <petermarshall@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>

TBR: petermarshall@chromium.org
Bug: chromium:1021921
Change-Id: If7be71cabc6a41c5433636132d9c9f222162747f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1947524
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2019-12-03 07:51:56 +00:00
Etienne Pierre-Doray ad4b05908e Revert "Remove top-level await pre-processing"
This reverts commit d4092e36af.

Reason for revert: Causing failure on compare_build_artifacts

Original change's description:
> Remove top-level await pre-processing
> 
> This CL removes the wrapping of code in async arrow functions, should
> the code contain 'await'. Support for top-level is implemented as part
> of V8's native REPL mode.
> 
> R=​petermarshall@chromium.org
> 
> Bug: chromium:1021921
> Change-Id: I0a601dd9a469a108f39d2ea3abcf8700726a1d8e
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1928927
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Peter Marshall <petermarshall@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>

TBR=petermarshall@chromium.org,mathias@chromium.org,szuend@chromium.org

Change-Id: I10ca48bd419e1517c0b1ebadf02cf484d54d914f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1021921,1029863
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1945281
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
2019-12-02 21:17:50 +00:00
Simon Zünd d4092e36af Remove top-level await pre-processing
This CL removes the wrapping of code in async arrow functions, should
the code contain 'await'. Support for top-level is implemented as part
of V8's native REPL mode.

R=petermarshall@chromium.org

Bug: chromium:1021921
Change-Id: I0a601dd9a469a108f39d2ea3abcf8700726a1d8e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1928927
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2019-12-02 10:52:14 +00:00
Paul Lewis bf7aa3c19e Migrates console/ to esm
Change-Id: I98fbb09aca094d5493923dd595c940f9f4bc9e85
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1924206
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2019-11-20 17:15:48 +00:00
Tim van der Lippe 1d6e57a0e3 Always add braces to single-line if-statements
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.

This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.

Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
2019-09-30 11:55:34 +00:00
John Emau 3ee574a0a0 DevTools: Change console prompt's accessible name to 'Console prompt'
Previously the console prompt accessible name was the default for any
code mirror instance: 'Code editor'.

This fails to meet success criteria for WCAG 2.4.6 Headings and Labels.
See: https://www.w3.org/WAI/WCAG21/quickref/#headings-and-labels

With this change the console prompt is easily identified as
'Console prompt' by screen readers, meeting WCAG 2.4.6 success criteria.

Screenshot: https://i.imgur.com/5LMZtu9.png
Bug: 963183
Change-Id: I938f67c7ca5dd868adc8ee6ef1b35983cdcbf13d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1645983
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: John Emau <johnemau@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#674281}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 30cddee600d2d5675583dddfe476af27905fcc66
2019-07-02 23:35:08 +00:00
Erik Luo 2288e9c2b8 DevTools: visually indicate when prompt text is incomplete
- Prompt's '>' icon is dimmed when pressing 'Enter' would
  not evaluate (instead insert newline)
- Icon moves from ConsoleView to ConsolePrompt
- Drive-by: removes obsolete styles related to pins

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

Bug: none
Change-Id: Ia22c905154b78495138a0eaf954a2bc88de9a9c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1548578
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#650508}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9aeaec54a33cc368987b9b0a3004c3ad46f3edb1
2019-04-12 23:18:42 +00:00
James Lissiak d2f1a2ff9f DevTools: Adding new performance histograms for launch of top 4 tools
This change adds 4 new performance histograms for the DevTools using the
prefix 'DevTools.Launch':
- DevTools.Launch.Console
- DevTools.Launch.Elements
- DevTools.Launch.Network
- DevTools.Launch.Sources

These histograms measure the time between the DevTools window being
shown during 'DevToolsWindow::ToggleDevToolsWindow' and a point in each
tool that corresponds to the 'ready' state as seen by a user. These end
points are unique to each tool but are as follows:
- Console: At the end of the ConsolePrompt constructor
- Elements: At the end of _updateMetrics when the styles panel has
  been populated for the initially selected node
- Network: After the panel is shown
- Sources: After the NetworkNavigatorView has been loaded

These tools were chosen as they represent the most popular in terms of
usage and will allow us to identify any significant performance impact
in the time taken to launch the DevTools when these panels open by
default.

To see time captured by the histograms in terms of a perf trace for
each tool please take a look at the following screenshots:
https://imgur.com/a/rcAgQ8h

In the traces you can see that the end marker for each load is at the
end of the trace near first meaningful paint, and just as the user
will see the content of the tool render fully.

To accomplish the histograms, a new native function has been added to
the DevTools ui bindings/embedder classes called
'recordPerformanceHistogram'. Along with the plumbing and a new helper
function in the frontend javascript Host.UserMetrics file called
'panelLoaded'

When the frontend javascript loads, it will store the initial panel to
be loaded from the preferences. Once that panel has been created and
the appropriate loaded marker has been hit, the duration of the launch
will be calculated using performance.now(). That duration is then sent
to the native code which will fire the appropriate histogram via the
'UMA_HISTOGRAM_TIMES' macros.

The mechanism is similar to the existing one used for enumerated
histograms and can be expanded to fire additional performance histograms
in the future.

Also added a new test for user-metrics to ensure that the panelLoaded
function will correctly record the histograms.

Change-Id: Ib9f0bf80c651231d6d2e308bee36c1a1223f04db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1506388
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Commit-Queue: James Lissiak <jalissia@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#644407}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 296f6b12650bd5e38eaf1fe0987c46910fe2d6eb
2019-03-26 17:36:51 +00:00
Pavel Feldman db31091348 DevTools: graduate the experiments enabled by default, they are real code now.
Change-Id: Id95cb9f5e843223b9c7dd761e4b98bd1c902c66f
Reviewed-on: https://chromium-review.googlesource.com/c/1444139
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#627247}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a384d97e21177dc3849eafa97b3757e249350019
2019-01-30 00:31:20 +00:00
Erik Luo 85c1d22222 DevTools: fix Console stick-to-bottom on load, enter
Fixes 2 stick to bottom cases
- Prompt has text, but is scrolled out of view. User presses 'Enter'.
  Browsers usually scroll an field into view on input events, but
  Console preventsDefault to avoid adding a newline. Now, we will
  emulate the scroll.
- Page logs a ton of messages, Console opened for the first time.
  CodeMirror asynchronously resized prompt height on load, which
  broke stick to bottom. This CL changes layout so that prompt
  height does not grow on editor load.

Bug: 863664
Change-Id: Ia25a71100d9a895d4c8c710b36ba1d8b76d76990
Reviewed-on: https://chromium-review.googlesource.com/c/1321575
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#605936}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 60802eced856d89133f211ef29df6124f29401bd
2018-11-07 02:43:25 +00:00
Erik Luo 9f24d20e9b DevTools: release objects generated for REPL preview
Bug: none
Change-Id: Ic24e0f08fa6d55461d7bdd50d6164b00e47ab950
Reviewed-on: https://chromium-review.googlesource.com/1200402
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#589860}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6a4cfb8d406346ccf28fc262ce930c691795ec74
2018-09-10 08:51:51 +00:00
Joel Einbinder 6a6b67f437 DevTools: Highlight nodes if they are the result of eager eval
Change-Id: If7d05b2d5b33761d4872184a3860dba5dc1368a2
Reviewed-on: https://chromium-review.googlesource.com/1188875
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#586626}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d23141f79f139a042e5be53f499be649b6babbd1
2018-08-28 09:21:20 +00:00
Erik Luo d3aea5da02 DevTools: replace pin icon with watch icon in toolbar
- Group Similar moved into 'gear' menu
- 'Pinned expressions' on by default
- Pin icon gone, Watch icon added to toolbar

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

Bug: 849875
Change-Id: I73caf6a0cda0be99e87676aded66b09f10d1bc21
Reviewed-on: https://chromium-review.googlesource.com/1192414
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#586561}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 63f5a183d81a25ea99881d6e4532c0a42c22f15a
2018-08-28 02:55:39 +00:00
Erik Luo 66bcf105f5 DevTools: iterate on console pin interaction UX
- Console prompt is cleared when text is pinned
- Pins persist across refresh
- Newly created pin runs with side effects until text differs
  or new expression is committed (on blur)
- Ctrl-Enter moves focus from Pin to Console prompt
- Added command menu option to create new pin
- Pressing Tab indents, moves focus iff pin is empty
  (same logic as Console prompt)
- Pins producing errors show error message on red background
- Pin text is trimmed upon blur/commit

Bug: 849875
Change-Id: I641abb6b5e19a84c17b1a6cd3e50ca7b459f2015
Reviewed-on: https://chromium-review.googlesource.com/1141096
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#586108}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 811a4303b8b973d61567d61372ec8e1d692037c0
2018-08-25 02:15:37 +00:00
Erik Luo fa544813dc DevTools: split out consolePrompt.css, fix matching bracket style
- Splits out prompt styles into consolePrompt.css
- Do not show background/border on matching brackets if the
  CodeMirror container is not focused

Bug: none
Change-Id: I1955e07ca3289a6781097d0c99467c51336403b9
Reviewed-on: https://chromium-review.googlesource.com/1153468
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#579136}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 60fc08c17da4f858739220886c4899ef846cc4bc
2018-07-30 20:03:54 +00:00
Erik Luo d8eee2bbe9 DevTools: continuously update Console pins on interval
Part 2: live updating pins
- same JSAutocomplete, `await` processing, previews as
  ConsolePrompt
- 250ms interval to update pins
- prevent side-effects while editing text (editor has focus)

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

Bug: 849875
Change-Id: I0cd18101e58a6ff4e71e674633409ca0e015e1e7
Reviewed-on: https://chromium-review.googlesource.com/1096417
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#577397}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b0290b0756fefbc1ae6dce3fa986f5de4fbdc021
2018-07-24 01:36:18 +00:00
Joel Einbinder 9be181d450 DevTools: Use CodeMirror for the conditional breakpoint editor
This adds syntax highlighting, autocomplete, argument hints, and
smart enter to the breakpoint editor

Change-Id: I973be5e44ff94f36fbefdeb1eb472122ee2789a9
Reviewed-on: https://chromium-review.googlesource.com/1144195
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#577394}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f5874da31db94985ad43b1d50b6689e07794c5a6
2018-07-24 01:28:17 +00:00
Erik Luo 157299825a DevTools: generalize preview without side effect builder
Introduces JavaScriptREPL, a utility that includes
- Logic used by EagerEval for building side-effect-free previews
- Console prompt's preprocessing logic
  (object literal wrapping and top level await)

Bug: 849875
Change-Id: Ie8146435fced9ebf440b43c225d25ef145416247
Reviewed-on: https://chromium-review.googlesource.com/1145911
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#577341}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f8ffab5d79243cb7de978d17669e8decdb9141df
2018-07-23 23:48:44 +00:00
Erik Luo 6294d3b496 DevTools: pinned expressions in console
Part 1: introduce pins behind an experiment.
- Prompt has 'pin' button to add current expression to pins
- Pin pane sticks to the top of the Console, with max height
- Pins have multiline editors and a value preview that shows
  "not available" when there is an error

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

Bug: 849875
Change-Id: Ib0b8bafd97551f823ff8b64d13c5259f42328994
Reviewed-on: https://chromium-review.googlesource.com/1087509
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#574740}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 589cdcb33ef96770a2c3e4a9c76ee439d1e2e56e
2018-07-12 21:54:16 +00:00
Joel Einbinder 2ef9e0655f DevTools: Move autocomplete logic ConsolePrompt->JavaScriptAutocomplete
This makes the code reusable for other CodeMirrorTextEditors that
might want the same autocomplete experience we have in the Console.

Change-Id: I8660249c08d920d86d2b82524b7bd50d9b5deb05
Reviewed-on: https://chromium-review.googlesource.com/1092080
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#572381}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c965d521e045567c17783c5afe1d41c5b1c04d8b
2018-07-03 22:53:57 +00:00
Erik Luo 7393d363b9 DevTools: do not show autocomplete suggestions that already exist
Completions in the middle of the text will not show SuggestBox
if one of the suggestions already exists in the editor.

Diff GIF: https://imgur.com/a/1Ry9Ser

Bug: none
Change-Id: I3bd27fa58b6a36c963e08f10f90e4747882f77e3
Reviewed-on: https://chromium-review.googlesource.com/1050503
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#559306}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7360ae32fc3cb568851eb51230abb0b7cafee4ca
2018-05-16 22:16:17 +00:00
Joel Einbinder 3f23eb2bdd DevTools: Argument hints for native functions
Change-Id: Ia0e9f3c98735d64a1188b4373c90b7ef2684ea48
Reviewed-on: https://chromium-review.googlesource.com/1054582
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#558527}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a5be1a79f122d4496aa4a09ddfad0b475d878248
2018-05-14 23:27:51 +00:00
Joel Einbinder 13157addd1 DevTools: Have the console SuggestBox prefer top when eager eval is on
This should make the suggest box obscure eager eval less often.

Change-Id: I60573ed142947daa005f648c13d1c3a32f8d492b
Reviewed-on: https://chromium-review.googlesource.com/1048025
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#558097}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a5f5f164294fd4d330f9b6f758d8b73056684838
2018-05-12 02:16:37 +00:00
Joel Einbinder 2fc0fb7ea3 DevTools: Give argument hints in the console prompt
https://i.imgur.com/Y3OlPM2.png

Change-Id: Ic1d9ef1d47ff93ce77bfc3ae7173689bccf0cb2c
Reviewed-on: https://chromium-review.googlesource.com/1031096
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#557030}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 66bdf19b13c9a1dffbd47121101e0b8aedde3495
2018-05-09 00:43:10 +00:00
Erik Luo 6f5c111941 DevTools: convert below prompt experiment into setting
The new setting is in the toolbar behind the gear.
Screenshot: https://imgur.com/a/09myIJH

Bug: 810176
Change-Id: Ifbd2a2bfc6712e2f2415e384c040f5520b1e2347
Reviewed-on: https://chromium-review.googlesource.com/1045180
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#556734}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 93eb26e6cbda0437be38d2d4f00f0ab2b9b411c1
2018-05-08 08:59:22 +00:00
Joel Einbinder b6b043b39d DevTools: Use current suggestion for eager eval
Change-Id: I4079e769b46f16d3635c25276beb832ced10107b
Reviewed-on: https://chromium-review.googlesource.com/1041076
Reviewed-by: Erik Luo <luoe@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#556594}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ef612396f8ca20e7070b770cb39293bf0882f462
2018-05-07 22:58:13 +00:00
Erik Luo 241ee49a00 DevTools: unhide console prompt experiment and fix focus
Turns the console below-prompt UI experiment from hidden to
visible.

Clicking on the preview element will now focus the prompt
editor, unless it has a selection.

Bug: 810176
Change-Id: I28cb5fa9c375ab4ae5cbfdf5043d03c7d8c71057
Reviewed-on: https://chromium-review.googlesource.com/1043464
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#556316}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 65f577c90e5521bc91afd2aa25c2fa84d630a49b
2018-05-05 06:00:35 +00:00
Joel Einbinder cb4688dbaa DevTools: Select console suggestions with enter
* Enter accepts the current suggestion in the console.

* History suggestions are not auto-selected. The user must use the
  arrow keys or manually click to select them now.

Previously we worried about that the user would accidentally select a
suggestion in the console when they actually wanted to run the command
as is. Due to recent improvements in autocomplete, this is less of a
problem. Autocomplete showing up on an already complete expression
should be extremely rare. The only exception is history completions,
which are no longer autoselected.

Change-Id: Id9d567ae69f4c29c63e875a1f3285448adbd7ce3
Reviewed-on: https://chromium-review.googlesource.com/1026838
Reviewed-by: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#555609}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ca3ac226e566791986bb6451bdfcb02d661c6eb8
2018-05-02 23:29:16 +00:00
Erik Luo ca67a057a0 Revert "DevTools: use autocomplete's possibleSideEffect to bypass throwOnSideEffect"
This reverts commit fcaafdd756b1aef4f8244474e37be9ee12c75284.

Reason for revert: we'd like to be more strict about side effects

Original change's description:
> DevTools: use autocomplete's possibleSideEffect to bypass throwOnSideEffect
> 
> Allow Console to evaluate without throwOnSideEffect when the entire
> expression meets the same strict conditions used by JSAutocomplete.
> 
> Bug: 810176
> Change-Id: If5c80250cd75d81eec1e495d0414903213fac930
> Reviewed-on: https://chromium-review.googlesource.com/1028934
> Commit-Queue: Erik Luo <luoe@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Reviewed-by: Joel Einbinder <einbinder@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#555142}

TBR=dgozman@chromium.org,einbinder@chromium.org,luoe@chromium.org

Change-Id: Iec31996445e98945a0a9a9b67e572d17bafdcbeb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 810176
Reviewed-on: https://chromium-review.googlesource.com/1039063
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#555269}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 67c4b089fbb62cc5986b98129dadfab5f69fcc97
2018-05-02 01:16:09 +00:00
Erik Luo 2c8ab81db7 DevTools: use autocomplete's possibleSideEffect to bypass throwOnSideEffect
Allow Console to evaluate without throwOnSideEffect when the entire
expression meets the same strict conditions used by JSAutocomplete.

Bug: 810176
Change-Id: If5c80250cd75d81eec1e495d0414903213fac930
Reviewed-on: https://chromium-review.googlesource.com/1028934
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#555142}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: fcaafdd756b1aef4f8244474e37be9ee12c75284
2018-05-01 19:26:52 +00:00
Erik Luo 89efea3187 DevTools: add runtime experiment for prompt
Bug: 810176
Change-Id: Ic78c5e6ef5557067679f3f4ed2dcf6b76f1ee8e2
Reviewed-on: https://chromium-review.googlesource.com/1014348
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#553228}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: cc91acb0e25cada9b9506da8c405c06cb7526074
2018-04-24 19:19:58 +00:00
Erik Luo 0f7f85b790 DevTools: add space-below-prompt experiment
- Adds an empty 15px space directly below the Console
  prompt's editor.
- Updates "isScrolledToBottom" logic in Console to account
  for the new space. Without this update, typing on the
  prompt's last line will not "jump + stick to bottom"
  as expected.

With this CL, overlay scrollbars (e.g. on Mac), should
never cover the prompt's editor.

Bug: 725249
Change-Id: Ib0167f6919d5b9942e7f2dc4d8cf0c15fc9368df
Reviewed-on: https://chromium-review.googlesource.com/965020
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#551222}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 06e046ba940fb6dffe3bbed45b85fb840b4a9194
2018-04-17 03:06:58 +00:00
Blink Reformat 4c46d0969f The Great Blink mv for source files, part 2.
Move and rename files.

NOAUTOREVERT=true
NOPRESUBMIT=true
NOTREECHECKS=true
Bug: 768828
TBR=darin@chromium.org
NOTRY=true

Change-Id: I66d3b155808bc5bdbf237b80208e1e552bcf7f28
Reviewed-on: https://chromium-review.googlesource.com/1001153
Reviewed-by: Blink Reformat <blink-reformat@chromium.org>
Commit-Queue: Blink Reformat <blink-reformat@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#549061}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0aee4434a4dba42a42abaea9bfbc0cd196a63bc1
2018-04-07 15:32:37 +00:00