Support for coping link location from within the Console panel (through the context menu) can be extended and cover learn more links too.
Differential Revision: https://phabricator.services.mozilla.com/D38546
--HG--
extra : moz-landing-system : lando
The button display the same icon that will be used
in the console input when in inline-mode to toggle
the editor mode, active.
A test is added to ensure the button works as expected.
Differential Revision: https://phabricator.services.mozilla.com/D38622
--HG--
rename : browser/themes/shared/icons/sidebars.svg => devtools/client/themes/images/webconsole/editor.svg
extra : moz-landing-system : lando
A test is added to ensure this is fixed properly.
We also fix the Array previewer to properly return
undefined for unknown array properties, rather than null.
Differential Revision: https://phabricator.services.mozilla.com/D38467
--HG--
extra : moz-landing-system : lando
We add a GridElementWidthResizer to handle the editor width.
The width is then persisted in a pref.
A test is added to ensure this works as expected.
Differential Revision: https://phabricator.services.mozilla.com/D37687
--HG--
extra : moz-landing-system : lando
Since we now have a GridElementWidthResizer element, we can
get rid of the SplitBox wrapping the SideBar, and have all
major elements as child of the App element, controlled by
a CSS Grid.
This makes it easy to change the console layout when toggling
the editor mode (re-ordering element in JS, changing the CSS
grid templates, and placing the element in different areas).
This also means we can take advantage of subgrid to align
the sidebar toolbar with the filter bar for example.
As the part of the stylesheet dedicated to layout grew, it
made sense to have it all in a separate stylesheet, App.css,
that lives next to the App component.
Differential Revision: https://phabricator.services.mozilla.com/D38038
--HG--
rename : devtools/client/themes/webconsole.css => devtools/client/webconsole/components/App.css
extra : moz-landing-system : lando
My preference was to annotate most of the failing tests with `fail-if` so that
if they start passing, the `fail-if` needs to be removed and they need to keep
passing. That doesn't work for tests that timeout, or which trigger failures
from their cleanup functions, however, so those tests need skip-if. And tests
with fail in their cleanup functions likely leave the browser in an
inconsistent state for subsequent tests, anyway, so really should be skipped
regardless.
There are some remaining tests which still fail because of crashes. I chose
not to skip them here, but to fix the crashes in separate bugs instead.
Differential Revision: https://phabricator.services.mozilla.com/D38247
--HG--
extra : rebase_source : 39ba8fec2e882cfe577c5f2b58ab7e4b461f1178
ChromeUtils.import still support a second argument as it used to do
when it was Components.utils.import. But this is deprecated and we should
instead always use the returned value.
Differential Revision: https://phabricator.services.mozilla.com/D37708
--HG--
extra : moz-landing-system : lando
We use the openNetworkDetails prop which is already in use
in the netmonitor to collapse the message if the parameter
passed to the function is falsy (i.e. the panel is already
displayed)
Depends on D37388
Differential Revision: https://phabricator.services.mozilla.com/D37389
--HG--
extra : moz-landing-system : lando
Some people found that the ConfirmDialog was getting into their
way when typing into the console, as it was stealing the focus.
This patch fixes this by not focusing the ConfirmDialog when
we show it, so the user can still type.
This means that we now handle the dialog confirm and dismiss from
JSTerm, when the former is displayed.
Since it wasn't clear how you could close the popup, we add a close
button that makes it very obvious.
This means we can drop the key handler in the dialog as the jsterm
is always focused.
We also simply remove the feature to open the MDN link on `?` key
stroke as it's not discoverable and was the only part of the
panel where you could do such thing.
Existing tests are adapted and extended to cover the new behaviour.
Differential Revision: https://phabricator.services.mozilla.com/D36174
--HG--
extra : moz-landing-system : lando
The console fails to connect to the server because
the getCachedMessages function throws on GMail.
This is because we try to access a property on a
cross-origin object, window.windowUtils, in
getInnerWindowId.
Wrapping the access to the property fixes the issue.
A test is added to make sure we don't regress.
// TODO: The test isn't failing without the fix,
so it should be re-written.
Differential Revision: https://phabricator.services.mozilla.com/D37069
--HG--
extra : moz-landing-system : lando
Ensure source links for selectors in the Rules view and warning links in Web Console for minified CSS go to the right location in the Style Editor after applying automatic prettification.
This only works for linked stylesheets. [Bug 1169770](https://bugzilla.mozilla.org/show_bug.cgi?id=1169770) needs to be fixed first before this can work correctly on inline minified stylesheets.
This patch augments the `prettifyCSS()` method to generate the mappings necessary to generate a sourcemap from the original to the prettified source. It uses these mappings to translate the cursor position when invoking the Style Editor to be opened at a specific location.
The mappings from the minified to the prettified source are used only until the stylesheet is changed in the Style Editor. Upon editing the source in the Style Editor, the associated mappings are cleared because it's likely they have been rendered invalid.
The updated stylesheet will already be prettified so it bypasses the `prettifyCSS()` method, thus avoiding the need to re-generate mappings. New CSS warnings will be listed in the Web Console which point to the right location in the edited stylesheet (the old warnings no longer point to the right place, but that's an acceptable side-effect). The Rules view in the Inspector also lists selectors with the new positions within the edited stylesheet.
Differential Revision: https://phabricator.services.mozilla.com/D36585
--HG--
extra : moz-landing-system : lando
We use Cmd/Ctrl + B to switch between inline and editor mode. This
should be familiar for VSCode users as it toggles the file sidebar.
When changing the layout, we persist the choice into the editor pref
so the user keeps the same layout the next time they open the console.
Differential Revision: https://phabricator.services.mozilla.com/D34718
--HG--
extra : moz-landing-system : lando
When the editor preference is true, a CSS class is added to
the panel that allow us to shift the layout to a CSS Grid, where
the input panel is on the left and the output on the right.
A toolbar is added to be able to execute an expression when in
editor mode.
Differential Revision: https://phabricator.services.mozilla.com/D17096
--HG--
extra : moz-landing-system : lando
Add a context menu entry to export the console output to a file.
We group the 2 export entries into a submenu.
Differential Revision: https://phabricator.services.mozilla.com/D22158
--HG--
extra : moz-landing-system : lando
The failure was happening on window7, which I guess is
pretty slow. Looking at the failure screenshot I was able
to see that the console output was empty.
The test is initially waiting for a 100 messages to be displayed
in the console output.
We are using the waitFor helper function for that. waitFor by default
call the function argument 500 times, at a 10ms interval, and then
fail.
Here, we bump the interval to 100ms, and set the max number of
tries to 500, in order to give extra time for the 100 messages
to be rendered in the output.
Pushed a TV job a re-ran it a few times without seeing the failure,
so the fix should be good.
Differential Revision: https://phabricator.services.mozilla.com/D36039
--HG--
extra : moz-landing-system : lando
Ctrl + A moves the cursor to the beginning of the line,
so we need to dismiss autocomplete.
A test case is added to make sure this behaves as
expected.
Differential Revision: https://phabricator.services.mozilla.com/D35573
--HG--
extra : moz-landing-system : lando
This was making browser_webconsole_scroll.js fail.
After some investigation, I found that the `isInWarningGroup`
prop, a function defined in `mapStateToProp` was causing a
re-rendering (because we were creating a new function each
time), impacting the shouldScrollToBottom behaviour.
To fix this, we no longer create a `isInWarningGroup` prop,
but directly use the `isMessageInWarningGroup` selector, which
was modified to take an array of visible messages instead of
the whole state.
Differential Revision: https://phabricator.services.mozilla.com/D35016
--HG--
extra : moz-landing-system : lando
If 2 messages are emitted during the same microsecond,
their timestamps are similar, and the sorting we do when
filtering for warning groups might be erroneous.
In such case, we now check the message id, to see which
one we handled first, which should be enough.
A test is added to ensure this works as expected. Basically,
we now render 2 logs one after the another, to increase the
chance they'll get the same timestamp.
The updated test was failing without the fix, and seems to
pass with it.
Differential Revision: https://phabricator.services.mozilla.com/D35015
--HG--
extra : moz-landing-system : lando
Due to how highlighters work, it requires the inspector to be initialized.
It can happen than the user will mouseenter/mouseout on an element that
calls highlight/unhighlight very quickly.
Since the hightlight can take some time, it might happen that the unhighlight
call is handled first, before the highlight call, meaning that we now have an
highlighter displayed, even though the user isn't hovering anything that
should cause this anymore.
This patch introduces a new toolbox function called `getHighlighter` that
returns an object with a `highlight and a `unhighlight` function.
We keep a reference to any possible pending `highlight` call so we can wait
for it to be done in `unhighlight`, before destroying it.
The console makes use of the new helper function, and a test is added to ensure
we don't have zombie highlighters anymore.
Differential Revision: https://phabricator.services.mozilla.com/D34562
--HG--
extra : moz-landing-system : lando
The failures indicated that some warning messages
were placed before the navigation marker, when they
should be placed after.
We now listen to the `load` event instead of `DOMContentLoaded`
to ensure the page is fully loaded and the warning gets
reported into the right page session.
Differential Revision: https://phabricator.services.mozilla.com/D35014
--HG--
extra : moz-landing-system : lando
For content HTML/XHTML copy/paste should always be enabled, but for chrome
docs we can support enabling/disabling copy/paste.
Also, restores tests to how they were before copy/paste was always enabled.
Differential Revision: https://phabricator.services.mozilla.com/D34805
--HG--
extra : moz-landing-system : lando