Commit Graph
1585 Commits
Author SHA1 Message Date
Nicolas Chevobbe a1ed5fd5ba Bug 1490279 - Enable reverse search before running reverse search tests; r=bgrins.
This is needed for beta since, for now, we only enable
reverse search on Nightly.

Differential Revision: https://phabricator.services.mozilla.com/D5525
2018-09-11 16:16:02 +00:00
Jan Odvarko ed19be3b3c Bug 1488915 - Migrate toolbox-process-window.xul to HTML; r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D5255
2018-09-10 17:14:57 +00:00
Nicolas Chevobbe 9e51a2bab0 Bug 1024913 - Add tests for Reverse search; r=bgrins.
Depends on D3114

Differential Revision: https://phabricator.services.mozilla.com/D5153
2018-09-10 10:24:42 +00:00
Nicolas Chevobbe cd01f072ab Bug 1024913 - Enable reverse search in jsterm; r=bgrins,flod.
Differential Revision: https://phabricator.services.mozilla.com/D3114
2018-09-10 10:24:40 +00:00
Nicolas Chevobbe 2237e6a2b9 Bug 1024913 - Move jsterm auto-focus handling into App.js; r=bgrins.
The App component takes the whole document space, so we can move the
code that listen for every click in the console UI to decide if the
jsterm should be focused or not.
This feels more like the React way, and will also provide us better
access to the store and the props when we need them in this focus
handling (like this will be the case for hiding the reverse search UI).

Depends on D5150

Differential Revision: https://phabricator.services.mozilla.com/D5152
2018-09-10 10:22:47 +00:00
Nicolas Chevobbe 7b5c8dca8a Bug 1024913 - Add a preference to enable the reverse search UI; r=bgrins.
Retrieve this preference in the console to pass it as a prop to the root
App component.

Differential Revision: https://phabricator.services.mozilla.com/D5149
2018-09-10 10:21:46 +00:00
Nicolas Chevobbe c9859e81c2 Bug 1489554 - Do not open the autocomplete popup if there's a letter right after the cursor; r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D5396
2018-09-10 10:17:12 +00:00
Margareta Eliza Balazs 932d871487 Backed out 5 changesets (bug 1024913) for causing perma damp failures. CLOSED TREE
Backed out changeset 1c18e0422ffa (bug 1024913)
Backed out changeset c4e5a7ff8e53 (bug 1024913)
Backed out changeset 7f269add6e54 (bug 1024913)
Backed out changeset ccd6afc2a739 (bug 1024913)
Backed out changeset 1613377c1b43 (bug 1024913)
2018-09-10 10:25:32 +03:00
Nicolas Chevobbe bb9db788f5 Bug 1024913 - Add tests for Reverse search; r=bgrins.
Depends on D3114

Differential Revision: https://phabricator.services.mozilla.com/D5153
2018-09-10 05:16:25 +00:00
Nicolas Chevobbe f03d9b555b Bug 1024913 - Enable reverse search in jsterm; r=bgrins,flod.
Differential Revision: https://phabricator.services.mozilla.com/D3114
2018-09-10 05:16:00 +00:00
Nicolas Chevobbe b1d3e3d467 Bug 1024913 - Move jsterm auto-focus handling into App.js; r=bgrins.
The App component takes the whole document space, so we can move the
code that listen for every click in the console UI to decide if the
jsterm should be focused or not.
This feels more like the React way, and will also provide us better
access to the store and the props when we need them in this focus
handling (like this will be the case for hiding the reverse search UI).

Depends on D5150

Differential Revision: https://phabricator.services.mozilla.com/D5152
2018-09-10 05:15:58 +00:00
Nicolas Chevobbe 2a19b980da Bug 1024913 - Add a preference to enable the reverse search UI; r=bgrins.
Retrieve this preference in the console to pass it as a prop to the root
App component.

Differential Revision: https://phabricator.services.mozilla.com/D5149
2018-09-10 05:14:14 +00:00
Dorel Luca 36b1e23baf Merge mozilla-inbound to mozilla-central. a=merge 2018-09-07 19:35:34 +03:00
Jan Odvarko a76c4ed5ff Bug 1487274 - Use nsIHttpChannel.isThirdPartyTrackingResource to identify trackers; r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D5018
2018-09-07 06:55:19 +00:00
Nicolas Chevobbe c65f7497e7 Bug 1487457 - Make console reflows faster; r=bgrins.
This patch remove some unused dom elements and CSS rules
that might negatively influence reflow times.
Also, we set an hidden overflow to all the element we know
for sure won't ever have a scrollbar, which seems to speed
up the reflow significantly.

Differential Revision: https://phabricator.services.mozilla.com/D4695
2018-08-31 12:51:36 +00:00
Nicolas Chevobbe f3f45446b5 Bug 1479373 - Refactor autocomplete popup for performance; r=jdescottes.
This patch introduces some options that can be passed to
setItems and openPopup to prevent doing unecessary work.
The main ideas here are to create all the popup items and
put them in a document fragment which then will be appended
to the popup, so we don't add them one by one which can be costly.
When creatingthe items, we also create one directly with the
selected class if autoSelect is set to true. This way, we don't have
to toggle the class later (which led to another reflow).

We take this work as an opportinuity to clean up the component.
Unused function (like appendItem and removeItem) are removed,
selectedIndex does not use a getter/setter anymore.

Some of the consumers calls are updated and so is the component test.

Differential Revision: https://phabricator.services.mozilla.com/D4848
2018-09-06 05:48:02 +00:00
Dorel Luca f1adf73529 Backed out changeset ff6b5bae0da4 (bug 1479373) for devtools failures on devtools/client/inspector/rules/test/browser_rules_completion-new-property_04.js. CLOSED TREE 2018-09-05 15:10:37 +03:00
Nicolas Chevobbe 29bddc29c5 Bug 1479373 - Refactor autocomplete popup for performance; r=jdescottes.
This patch introduces some options that can be passed to
setItems and openPopup to prevent doing unecessary work.
The main ideas here are to create all the popup items and
put them in a document fragment which then will be appended
to the popup, so we don't add them one by one which can be costly.
When creatingthe items, we also create one directly with the
selected class if autoSelect is set to true. This way, we don't have
to toggle the class later (which led to another reflow).

We take this work as an opportinuity to clean up the component.
Unused function (like appendItem and removeItem) are removed,
selectedIndex does not use a getter/setter anymore.

Some of the consumers calls are updated and so is the component test.

Differential Revision: https://phabricator.services.mozilla.com/D4848
2018-09-05 08:34:47 +00:00
Nicolas Chevobbe decb40b746 Bug 1488336 - Group clear mark and markText for completion text; r=bgrins.
This way, codeMirror does not trigger so many reflows and
makes setAutocompletionText faster.
An unwanted side-effect was that it made closing the console
a lot slower. Looking at the closing code of the JsTerm, we
do call setAutocompletionText("") in the end, which we don't
really need since we destroy the editor shortly after. Removing
this call keeps closing time the same as before.

Differential Revision: https://phabricator.services.mozilla.com/D4905
2018-09-04 16:19:23 +00:00
Zibi Braniecki 8f44bb0e97 Bug 1455649 - DocumentL10n, part 4 - Switch Preferences to use DocumentL10n API. r=smaug 2018-09-06 18:30:37 -07:00
yulia 2e08902f9f Bug 1462399 - remove GCLI commands; r=ochameau
This patch removes remaining files and traces of GCLI panel commands.

Differential Revision: https://phabricator.services.mozilla.com/D3615
2018-09-03 17:24:32 +00:00
Nicolas Chevobbe d3d6e2d9f3 Bug 1486768 - Fix mocha tests;r=Honza.
Some tests were failing because of change in the code:
- arrow icon don't have an expanded class anymore but use aria-expanded
- executionPoint property wasn't set on the ConsoleMessageType
- networkUpdateRequest action expects a second argument
- requestHeadersFromUploadStream is retrieved from requestPostData.uploadHeaders

Differential Revision: https://phabricator.services.mozilla.com/D4444
2018-08-30 10:42:43 +00:00
Nicolas Chevobbe a7431b9434 Bug 1484979 - Fix old-jsterm UI glitches; r=bgrins.
The completion node was wrongly positioned as soon as the input overflowed.
We fix this by setting the completionNode height in resizeInput,
like we do for the inputNode.

The inputNode takes the whole remaining vertical space
when starting the console. But when typing, the height
is computed and set according to what's in the input.
Which means the input wasn't taking the remaining space
anymore, which could be weird (e.g. if the user wants
to select some text by starting dragging below the actual
input, although the UI would indicate it is possible).

The autocompletionPopup was a bit off due to 2 things:
- in the function that was returning the chevronWidth, we
were subtracting the autocomplete popup padding. But the
autocomplete popup already handles that itself.
- in the function that was computing the character width,
we were using offsetWidth which returned a rounded value.
This means that the further the autocompletion was displayed
at, the more the popup would be off. We use getBoundingClientRect().width
instead which gives us a decimal value.

And we also make sure to not alter the scrolling position in the inputNode
when accepting an autocompletion result (a test is added).

Differential Revision: https://phabricator.services.mozilla.com/D4207
2018-08-29 05:41:52 +00:00
Preeti Mukherjee bf8236b2bc Bug 696385 - change dom.a to dom.span in mozilla-central/devtools/client/webconsole/components/message-types/NetworkEventMessage.js#109; r=nchevobbe
MozReview-Commit-ID: 2PBUG8yQIXY

Differential Revision: https://phabricator.services.mozilla.com/D4136
2018-08-28 05:16:26 +00:00
Nicolas Chevobbe 42abb83b75 Bug 1486446 - Remove Console Launchpad support; r=bgrins.
It's broken and unmaintained for a long time now,
the Console Team does not use it and has no plan doing so.

Differential Revision: https://phabricator.services.mozilla.com/D4348
2018-08-27 16:31:58 +00:00
Nicolas Chevobbe 8912f7cfae Bug 1485990 - Display 1-item-only autocomplete popup if autocompletion text can't be displayed; r=bgrins.
If the autocomplete only returns 1 item, we usually close the
popup and show the autocompletion text.
But in some cases the autocompletion text can't be shown (e.g.
there's some text after the cursor). So we end up showing
nothing for the user, which is not ideal.
In such case, this patch ensures we do show the popup so the
user can autocomplete and save some keystrokes.

Depends on D4061

Differential Revision: https://phabricator.services.mozilla.com/D4335
2018-08-27 16:25:57 +00:00
Nicolas Chevobbe 8d0154a21f Bug 672733 - Make autocomplete search case insensitive; r=Honza.
This patch adds a smarter heuristic for autocompletion results:
if the input first letter is lowercased, then we'll filter
matching properties case insensitively. But if the user starts
with an uppercase, we assume they know the property they want
and thus respect the casing.
For example: `win` will return both `window` and `Window`, but
`Win` will return `Window` only.
Due to this behavior, we change the order of the autocomplete
results so lowercased property are displayed before the uppercased
one.
If we take are example again, it's likely that if a user type `win`,
they want `window`, but the alphabetical order would return `Window`
first which would annoy user.

Now, since we return results that does not match exactly the user
input, we need to modify the frontend.

Usually, we only show the autocompletion popup if there are
at least 2 matching items, since 1 matching item will still
be displayed using the autocompletion text. But now, since the
input might not match, we want to still display the popup if
there is one matching item, but starts differentely than what
the user entered.
For example, the user typed `window.addeve`, which matches
`addEventListener`. The completion text will make it looks like
it will be completed to `window.addeventListener`, which would
be undefined. So showing the popup with the actual matching
property might avoid some confusion for the user.

A test was added to make sure the frontend works as expected.
Some test cases were added in the server test to make sure
the actor returns expected results. Other tests needed some
adjustement because of the insensitive case matches and the
new order of results.

Differential Revision: https://phabricator.services.mozilla.com/D4061
2018-08-27 16:08:56 +00:00
yulia 3074f9dd2e Bug 1483173 - introduce screenshot actor; r=ochameau
This patch introduces a screenshot actor, which allows the screenshot functionality to be
shared across tools, and also implements it for the toolbox itself

Differential Revision: https://phabricator.services.mozilla.com/D3341
2018-08-27 15:14:10 +00:00
Nicolas Chevobbe f40b1669b0 Bug 1486364 - Revert changes in Tree component and test; r=jdescottes.
In https://github.com/devtools-html/debugger.html/pull/6809 a check
was removed in the Tree component because seens as unnecessary, and
a test was modified to accomodate the change. Turns out the test was
needed in its original form, and was surfacing a bug.
This patch rolls back both the change in the Tree component _and_ in
the test.
The Tree modification will be backported to the Github repository.

Differential Revision: https://phabricator.services.mozilla.com/D4307
2018-08-27 07:30:02 +00:00
Nicolas Chevobbe 0b55e4a09a Bug 1485510 - Fix mochitests that don't work with CM jsterm enabled; r=bgrins.
Differential Revision: https://phabricator.services.mozilla.com/D4209
2018-08-27 07:56:03 +00:00
Nicolas Chevobbe 178e3ac6a8 Bug 1484682 - Ensure the sidebar can overflow; r=Honza.
The sidebar regressed at some point and wasn't showing
a scrollbar when it was needed. This patch fixes that
by making the sidebar overflow and adds a test to make
sure we don't regress.

Differential Revision: https://phabricator.services.mozilla.com/D3976
2018-08-23 09:46:02 +00:00
fvsch 177dd3c565 Bug 1479750 - Part 2: Improve console alignment, visual consistency and icons; r=nchevobbe
Depends on D3482

Differential Revision: https://phabricator.services.mozilla.com/D3483
2018-08-23 08:00:24 +00:00
Jan Odvarko 063630ce07 Bug 1333994 - The network tab should flag resources on the tracking protection list; r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D3862
2018-08-23 07:36:08 +00:00
Brian Grinstead becddf3c2f Bug 1463669 - Enable syntax highlighting of input in the console output when possible;r=nchevobbe
When you enter JS into the console, we can now syntax highlight it in
the output when CodeMirror is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D3842
2018-08-23 00:09:24 +00:00
Noemi Erli e9d8fc0c63 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-08-22 19:31:52 +03:00
Noemi Erli ac6935bf69 Merge inbound to mozilla-central. a=merge 2018-08-22 19:28:33 +03:00
Nicolas Chevobbe 9248f9f013 Bug 1483880 - Always hide the autocompletion popup in acceptProposedCompletion; r=Honza.
When hitting enter, if there was no autocompletionText shown (because
the input was matching a proposed value), then the autocompletion
popup wasn't closed.
We now close it every time, and only check the completionText to
insert a possible string after the cursor.
A test case is added to make sure we don't regress this.

Differential Revision: https://phabricator.services.mozilla.com/D3763
2018-08-22 11:40:09 +00:00
Jan Odvarko 7267450673 Bug 1470815 - Make sure the Security panel is visible for HTTP requests in the Console panel; r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D3904
2018-08-22 11:14:45 +00:00
Nicolas Chevobbe edf76fe7da Bug 1479758 - Enable history navigation with Cmd/Ctrl ArrowUp/Down; r=bgrins.
Matches old-JsTerm behavior.

Depends on D2824

Differential Revision: https://phabricator.services.mozilla.com/D3196
2018-08-21 16:05:45 +00:00
Ciure Andrei 24922ea123 Backed out changeset 4f7d58a640b8 (bug 1483173) for browser_jsterm_screenshot_command_clipboard.js failures CLOSED TREE 2018-08-21 22:03:10 +03:00
yulia 4c4b78c21a Bug 1483173 - introduce screenshot actor; r=ochameau
This patch introduces a screenshot actor, which allows the screenshot functionality to be
shared across tools, and also implements it for the toolbox itself

Differential Revision: https://phabricator.services.mozilla.com/D3341
2018-08-21 13:10:52 +00:00
Nicolas Chevobbe 3985378acc Bug 1484672 - Use node.click instead of synthesizeMouseAtCenter in browser_webconsole_object_inspector_scroll.js; r=davidwalsh
Differential Revision: https://phabricator.services.mozilla.com/D3774
2018-08-20 14:59:13 +00:00
Michael Ratcliffe 6f01e84f30 Bug 1480638 - Inspect Element is not reported into panel enter/exit events r=nchevobbe
Send `inspect_dom` properties from appropriate places.

Differential Revision: https://phabricator.services.mozilla.com/D3511
2018-08-20 06:11:31 +00:00
Valentin Gosu 30d5eb211c Bug 1483445 - Change string from tracking protection to content blocking r=dragana!
Differential Revision: https://phabricator.services.mozilla.com/D3440
2018-08-20 08:43:08 +00:00
Noemi Erli 297e2d8ef6 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-08-22 12:54:34 +03:00
Mantaroh Yoshinaga a17a5b0450 Bug 1465644 - Part 2. Introduce the emphasized splitter style. r=nchevobbe 2018-08-22 16:07:53 +09:00
Nicolas Chevobbe 88c6294083 Bug 1479521 - Only run browser_jsterm_accessibility.js with old jsterm; r=Honza.
Depends on D2826

Differential Revision: https://phabricator.services.mozilla.com/D2827
2018-08-13 10:07:00 +00:00
Nicolas Chevobbe c3788fa499 Bug 1479521 - Update tests to match the new jsterm behavior; r=Honza.
Some test were relying on the existence of the complete function
and were using it in order to do integration test.
We modify those and instead trigger real user interaction for
making those assertions.
Additional test cases are added to the test files they fit in
so we have a broader coverage of user interaction in regard
to autocompletion.

Depends on D2825

Differential Revision: https://phabricator.services.mozilla.com/D2826
2018-08-13 08:37:09 +00:00
Nicolas Chevobbe 3e488d6584 Bug 1479521 - Remove browser_jsterm_no_autocompletion_on_defined_variables.js; r=Honza.
The test wasn't doing what it was supposed to do (there was definitely
an autocomplete text displayed, we were not waiting properly for it.).
Also, the original issue with this was that that an unwanted token was
entered instead of the one the user wanted (user generated). Maybe at
that time the autocomplete did not contained user defined variables,
but now we do, and we are testing that in other tests.

Depends on D2824

Differential Revision: https://phabricator.services.mozilla.com/D2825
2018-08-13 08:39:16 +00:00
Nicolas Chevobbe 0377bffd06 Bug 1479521 - Refactor JsTerm autocompletion behavior; r=Honza.
We used to rely on different things to both display
the autocompletion text and accept an autocompletion.
This patches introduces new helper functions in order
to make the code more easy to reason about.
We also rollback our decision to show the popup when
there is only 1 item in the autocompletion list in
order to be more consistent with what Chrome does.

Differential Revision: https://phabricator.services.mozilla.com/D2824
2018-08-13 10:07:15 +00:00