Commit Graph
321 Commits
Author SHA1 Message Date
Brian Hackett 46d73b286c Bug 1602489 - Basic eager evaluation support, r=nchevobbe.
Differential Revision: https://phabricator.services.mozilla.com/D56393
2019-12-12 21:48:03 +00:00
Edward Billington 26588c3216 Bug 1579663 - Allow data url background-image in styled console logs r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D55376
2019-12-04 09:31:54 +00:00
Nicolas Chevobbe d38e3fae98 Bug 1579090 - Support ObjectFronts in WebConsole. r=Honza.
Since we may now have ObjectFronts in console messages as
well as in evaluation results, we need to make the webconsole
consume those fronts.

And because we have ObjectFronts, we can now avoid using the
DebuggerClient to release the actors, and simply call front.release.
This simplifies how we track created object, since we only need
to release "root" objects, which will also cause all the sub-fronts
to be released as well. Sadly, this was causing some test failures
in mochitests because some objects were released while the connection
was closed, so we now emit an event when all the actors are released,
which we track in tests to wait until everything is over.

As a side effect, we need to change how we handle stubs for
our tests, since fronts have cycical references and can't
be serialized directly. In order to handle that, we serialize
all front as a plain object with a `_grip` property, containing
the object grip. In the stub file, we don't expose the grips
directly, but Maps that contain those stubs "rehydrated": when
a _grip object is encountered, it's turned back into a front.

Differential Revision: https://phabricator.services.mozilla.com/D54509
2019-12-04 09:03:53 +00:00
Nicolas Chevobbe 7228ed20c6 Bug 1599805 - Fix React props in JSTerm. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D55240
2019-11-29 09:59:41 +00:00
Nicolas Chevobbe 4d14f5d829 Bug 1375752 - Render empty strings as <empty string> in console. r=yzen.
This only affects console api calls where one of the
argument is an empty string. Since we don't quote
string arguments for those, it was difficult to spot
an empty string there.
Jest test are added, as well as a mochitest for the
console to make sure that we don't have unwanted
side effects (for evaluation results, object with
empty string properties, ...)

Differential Revision: https://phabricator.services.mozilla.com/D54687
2019-11-26 15:09:00 +00:00
Nicolas Chevobbe bf96766783 Bug 1067710 - Bump console.table columns limit to 21 to match Chrome. r=Honza.
Increasing the number of columnns highlighted some issues:
- Some element could be off-screen, the grid-template-columns
  needed to be adjusted
- headers could be cut-off, we add a title on the element to
  have the full content in a tooltip
- properties that are not defined were displayed as "undefined",
  which is not really true, and take a lot of space. We render
  them as an empty cell in such case now.

A test is added to check the max-column limit.

Differential Revision: https://phabricator.services.mozilla.com/D54260
2019-11-26 13:21:12 +00:00
Nicolas Chevobbe 1175e2f5b3 Bug 1326182 - Send all the console.table items in the console message. r=Honza.
This allows us to not have to reach for the server
again from the client to get all the data we need
to render the table.

We still need to keep the old function to handle
connections to older servers. We'll use Bug 1597955
in Firefox 74 to clean the bits we don't need anymore.

A test is added to ensure the bug is fixed and we don't
regress; stubs are updated.

Differential Revision: https://phabricator.services.mozilla.com/D53962
2019-11-22 09:48:58 +00:00
jaril 334eff9b62 Bug 1594096 - Display exceptions in the Replay timeline r=jlast
Differential Revision: https://phabricator.services.mozilla.com/D51949
2019-11-22 19:24:43 +00:00
Nicolas Chevobbe dbd07ba72f Bug 1597197 - Add a feature-callout badge on the open editor icon. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D53394
2019-11-22 13:11:28 +00:00
Nicolas Chevobbe 1094485c43 Bug 1597295 - Allow to pass a pathPrefix property to the WebConsole ObjectInspector util. r=jlast.
This will allow us to not have 2 object inspectors
with the same name, which was causing an issue
when putting an object in the sidebar (the object
in the sidebar and the one in the output would share
the same key in the objectInspector key, meaning that
expanding/collapsing nodes on one of them would also
do it on the other one).
A test needed to be modified where we were relying on
this behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D53666
2019-11-20 18:05:42 +00:00
Nicolas Chevobbe 30153880c1 Bug 1595594 - Add support for typed arrays to console.table. r=Honza.
In order to render a table, we first check that console.table is
called with data that can be displayed in a table. Until now, we
were missing all the typed arrays.
This revealed some smaller issues:
- BigInt64Array were not marked as typed arrays on the server.
- Generating the repeatId for a message containing BigInts would
  throw because BigInts can't be serialized.

We add test cases for all the typed array, and we take this opportunity
to add a test case to ensure object insides table cells can be expanded.

Differential Revision: https://phabricator.services.mozilla.com/D53155
2019-11-19 13:37:07 +00:00
Dorel Luca 4c4d3df450 Backed out changeset d5baee70482a (bug 1597197) for DevTools failures in test/browser/browser_jsterm_no_input_and_tab_key_pressed.js. CLOSED TREE 2019-11-19 14:59:36 +02:00
Nicolas Chevobbe a1b618312d Bug 1597197 - Add a feature-callout badge on the open editor icon. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D53394
2019-11-19 09:27:58 +00:00
Nicolas Chevobbe 810016905d Bug 1595068 - Fix issue with debounced autocompletion in JsTerm. r=Honza,julienw.
The issue was that if a user typed a legitimate letter,
then, quickly after (i.e. before the autocompletion results
are here) hit Enter or Tab, the resulting input value would
be erroneous.
This is because we retrieve the value to insert from the
autocomplete popup, which at that time, is out-of-date, for
this brief moment.
The fix consists in updating the preLabel property of the
autocomplete popup items in order to get the proper
completion if the user ever hit enter, tab or arrow right.
We also take this as an opportunity to have a mechanism
to be able to cancel a registered update.

Differential Revision: https://phabricator.services.mozilla.com/D52376
2019-11-13 16:19:18 +00:00
Julian Descottes 03cdcd7b0a Bug 1593921 - Use eslint-disable-next-line to disable complexity checks in DevTools r=pbro
Using next-line is less error prone for refactorings than wrapping methods with enable/disable blocks.

Differential Revision: https://phabricator.services.mozilla.com/D51782
2019-11-05 14:29:04 +00:00
Nicolas Chevobbe 26e426cf26 Bug 1592550 - Allow saveAs util function to be passed an array of filters. r=Honza.
A new parameter is added, and it expect an array
of filter objects (which contain a pattern and
a label properties), which are going to be used
by the save file dialog.

Depends on D51070

Differential Revision: https://phabricator.services.mozilla.com/D51078
2019-11-01 09:26:18 +00:00
jaril c2edc49474 Bug 1592751 - Maintain purple line above paused console message in Replay r=jlast
Differential Revision: https://phabricator.services.mozilla.com/D51167
2019-10-31 01:39:19 +00:00
Nicolas Chevobbe 9d78560f27 Bug 1592308 - Add keyboard shortcut for loading / saving from console input. r=Honza.
Ctrl+O (Cmd+O on OSX) will load file content into the console input.
Ctrl+S (Cmd+S on OSX) will show the file dialog for the user
to save the console input content into a file.

A test is added to ensure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D51070
2019-10-30 10:26:49 +00:00
Itiel f6e0472863 Bug 1590212 - More RTL fixes to the console editor r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D49986
2019-10-29 12:40:13 +00:00
Nicolas Chevobbe 4bd90386e4 Bug 1590093 - Lazy load console components. r=Honza.
We try to lazy load all the things we know we might
not need directly when opening the console.

Differential Revision: https://phabricator.services.mozilla.com/D50800
2019-10-29 10:46:51 +00:00
Narcis Beleuzu d77346d4db Backed out changeset 3534c1bfbd8e (bug 1590212) as per Itiel`s request. CLOSED TREE 2019-10-29 14:11:43 +02:00
Itiel f7f1e63e87 Bug 1590212 - More RTL fixes to the console editor r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D49986
2019-10-29 07:59:04 +00:00
Ciure Andrei e1f7e6e59b Backed out changeset 0a516296693b (bug 1590093) for causing browser_jsterm_selfxss.js to permafail CLOSED TREE 2019-10-28 17:15:50 +02:00
Nicolas Chevobbe 7d2ac33079 Bug 1590093 - Lazy load console components. r=Honza.
We try to lazy load all the things we know we might
not need directly when opening the console.

Differential Revision: https://phabricator.services.mozilla.com/D50800
2019-10-28 13:23:15 +00:00
Nicolas Chevobbe ce25c3f455 Bug 1519103 - Remove Scratchpad panel. r=bgrins.
Differential Revision: https://phabricator.services.mozilla.com/D50583
2019-10-27 09:05:58 +00:00
Nicolas Chevobbe 9fea06c0fa Bug 1589376 - Remove compact mode related proptypes. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D50566
2019-10-25 10:34:54 +00:00
Nicolas Chevobbe a56fb5fef6 Bug 1585923 - Rename MenuButton doc prop to toolboxDoc. r=jdescottes.
This should make it more obvious what kind of document
the component is expecting.

Differential Revision: https://phabricator.services.mozilla.com/D50240
2019-10-24 05:56:10 +00:00
Florens Verschelde 80e4b9a839 Bug 1589233 - Align CodeMirror line-height with Debugger in Inspector, Style Editor and Console editor; r=gl,nchevobbe
We have a few CodeMirror instances where we're using the default line height (`line-height: normal`), resulting in a line-height in the 13-14.5px range (depending on the font, OS, resolution). By contrast, the Debugger uses 15px explictly, and that's a style we're trying to generalize.

This patch sets a 15px line-height for:
- Inspector: the CodeMirror instance used in the markup view for "Edit as HTML" and in event tooltips
- Style Editor: the main editor instance
- Console: the jsterm but only in editor mode (since the output uses a 14px line-height on purpose, the jsterm in standard mode keeps this 14px line-height to minimize visual jumps when sending a command)

Differential Revision: https://phabricator.services.mozilla.com/D49593
2019-10-21 14:18:07 +00:00
Nicolas Chevobbe 8c9f69ba14 Bug 1576568 - Enable editor mode everywhere. r=Honza.
The focus previous element function needed to be modified
in order to not find non-visible elements.

Differential Revision: https://phabricator.services.mozilla.com/D49729
2019-10-21 08:39:42 +00:00
Nicolas Chevobbe a8f2e6f266 Bug 1589867 - Fix browser_parsable_css.js failure on beta. r=Honza.
The rotate property is only enabled on Nightly.
For beta, we need to use transform: rotate instead.

Differential Revision: https://phabricator.services.mozilla.com/D49847
2019-10-21 08:31:52 +00:00
Nicolas Chevobbe 753b08a5f7 Bug 1589592 - Fix console editor Run button icon in RTL. r=Honza.
Since we want the button to be placed on the right side
in RTL languages and we don't have logical properties
on background-position yet, we display the icon in
a :before pseudo element which will adapt for both LTR
and RTL languages. The icon is then mirrored in RTL.

Differential Revision: https://phabricator.services.mozilla.com/D49718
2019-10-18 12:46:46 +00:00
Nicolas Chevobbe 34038617bf Bug 1589592 - Fix Console Editor styling in RTL languages. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D49717
2019-10-18 12:46:58 +00:00
Nicolas Chevobbe 7a54cdfae8 Bug 1577896 - Fix GridElementResizer on overflowing container. r=fvsch.
We remove the pseudo elements we were using to draw the borders and
put them on the grid elements instead.
We make the GridElementResizer 6px and translate it so there's
handle on "both sides" of the splitter.

Differential Revision: https://phabricator.services.mozilla.com/D45302
2019-10-18 10:17:48 +00:00
jaril 5aa3ce2b85 Bug 1504025 - Fixed replay line indicator to display properly r=jlast
Differential Revision: https://phabricator.services.mozilla.com/D49327
2019-10-16 19:06:11 +00:00
Armando Ferreira ab0447079c Bug 1523868 - Add a doorhanger options menu in console toolbar - Part 1.
Differential Revision: https://phabricator.services.mozilla.com/D47979
2019-10-15 17:04:30 +00:00
Dorel Luca b9570dcb8c Backed out changeset 03643a08fe82 (bug 1523868) for Node failure in Unexpected token y in JSON at position 0. CLOSED TREE 2019-10-15 18:42:20 +03:00
Armando Ferreira 736a79a179 Bug 1523868 - Add a doorhanger options menu in console toolbar - Part 1.
Differential Revision: https://phabricator.services.mozilla.com/D47979
2019-10-15 15:31:32 +00:00
Brian Hackett 5efaf938e7 Bug 1585860 - Fix console warping console menu item, r=nchevobbe.
Differential Revision: https://phabricator.services.mozilla.com/D48064
2019-10-03 14:33:06 +00:00
Jason Laster 3934a4c8a5 Bug 1582870 - Reduxify console actions. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D46674
2019-10-02 22:50:25 +00:00
Nicolas Chevobbe 31bb7f3d0a Bug 1584973 - Always lazy load Reps bundle. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D47729
2019-10-02 08:05:57 +00:00
Oana Pop Rus ce530ebdd0 Backed out 2 changesets (bug 1584973) for devtools node failure on a CLOSED TREE
Backed out changeset c06273b25769 (bug 1584973)
Backed out changeset e63ea229519d (bug 1584973)
2019-10-02 02:30:42 +03:00
Nicolas Chevobbe 70ece40caf Bug 1584973 - Always lazy load Reps bundle. r=Honza.
Depends on D47728

Differential Revision: https://phabricator.services.mozilla.com/D47729
2019-10-01 09:36:51 +00:00
Armando Ferreira 2df3915410 Bug 1567372 - Add a reverse search button to the Editor Toolbar. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D45095
2019-09-17 21:58:17 +00:00
Nicolas Chevobbe 89dc8f15eb Bug 1579422 - Disconnect FilterBar resize observer when observed node is disconnected. r=jdescottes.
Since we don't properly unmount the Console React app,
FilterBar's componentWillUnmount is never called.
This was where we planned to disconnect the resize observer,
but it was in fact never called.
So what we do in this patch instead is in the resize observer
callback, check if the observed node is connected, and if
it's not, we disconnect the resize observer.

This prevent the console from dispatching an action, that
may slow down closing the console.

Differential Revision: https://phabricator.services.mozilla.com/D45006
2019-09-09 09:05:08 +00:00
Nicolas Chevobbe 7fa8100b9c Bug 1578675 - Make the Browser Toolbox console UI similar to Browser Console's one. r=Honza.
We are now showing the "Show content messages" checkbox, as well
as removing the "Persist logs" one.

Differential Revision: https://phabricator.services.mozilla.com/D44637
2019-09-06 13:38:37 +00:00
Nicolas Chevobbe 772c8014f3 Bug 1579366 - Update completion text when autocomplete is disabled and popup isn't opened. r=Honza.
If the user triggered a force autocomplete (with Ctrl + Space)
that would result in having only the completion text, writing another
letter wouldn't update the completion text, that could then lead
into having an erroneous expression in the input.
This patch fixes this issue and add a test case to make sure we
don't regress this.

Differential Revision: https://phabricator.services.mozilla.com/D44976
2019-09-06 13:35:55 +00:00
Nicolas Chevobbe 113edbb455 Bug 1578676 - Add missing separator left to the show content messages checkbox. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D44636
2019-09-05 09:24:25 +00:00
Nicolas Chevobbe 951c55ef7d Bug 1578660 - Add missing key on EditorToolbar in App.js .r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D44630
2019-09-04 09:09:24 +00:00
Nicolas Chevobbe bdbccc5e0c Bug 1578283 - Don't scroll jsterm viewport when inserting a tab character. r=Honza.
When we wanted to insert a string in the webconsole input,
we were setting the input value, and setting the cursor
manually. But since the editor setCursor function is calling
alignLine, there could be cases where the editor scroll position
would jump, feeling awkward for the user.
It turns out we can simplify this code a lot since codeMirror
provides a replaceRange function, which is a perfect replacement
for what we were using, without having to manage the cursor position.

The only downside to that is that inserting characters this
way *does* fire a `changes` event, that we are listening to
in the JsTerm to request autocompletion (which we don't need
as we only insert characters when accepting a completion or
adding a tab).
To mitigate that, we pass a specific jsterm origin string to
replaceRange, which let's us discriminate in the changes event
listener if those changes originate from jsterm only actions.

A test is added to ensure this works as expected (the test was
failing without the fix).

Differential Revision: https://phabricator.services.mozilla.com/D44466
2019-09-04 09:02:09 +00:00
Nicolas Chevobbe 908127976b Bug 1578389 - Fix propTypes error in console. r=Honza.
Fix 2 proptype errors: one in App.js, and the
other one in the renderStacktrace function,
that is called by Error rep.

Differential Revision: https://phabricator.services.mozilla.com/D44467
2019-09-03 13:55:45 +00:00