Commit Graph
4059 Commits
Author SHA1 Message Date
Nicolas Chevobbe 9af9aa5f85 Bug 1915804 - [devtools] Add AbortController in SourceEditor to control event listeners. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D220684
2024-09-04 06:14:17 +00:00
Nicolas Chevobbe 3a3ae50758 Bug 1915872 - [devtools] Make getColor rely on CSS variables computed values. r=devtools-reviewers,ochameau.
The function used to parse the variables.css file and do some regex matching
on the light/dark theme rules to extract the declaration value of a variable.

This patch makes the function simpler by getting the computed value of the
CSS variable, which automatically adapt to the current theme since we do set
`color-scheme` value properly when setting a theme.

In order for this to work properly, the variables that might be used in this
function need to be registered so the engine know they are colors.

We take this as an opportunity to rename the function to `getCssVariableColor`,
which is more explicit, and also make it take the actual CSS variable name,
and not only the suffix part that comes after `--theme-` for better grep-ability.

The test in browser_theme.js is adapted to reflect those changes.

Differential Revision: https://phabricator.services.mozilla.com/D220718
2024-09-03 15:00:54 +00:00
Nicolas Chevobbe 582f536939 Bug 1916258 - [devtools] Add colorSwatchReadOnly option for OutputParser. r=devtools-reviewers,ochameau.
The computed panel was already read only, but this was done
by checking the swatch class name directly in the output parser,
which is not ideal.
Here we have a proper setting, that we can use in the computed panel,
as well as in the variable tooltip, where we can't interact with
the swatches.
The pointer cursor is only added onto swatches that are a button
or have a button role.
Tests are updated accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D220819
2024-09-03 13:22:14 +00:00
Nicolas Chevobbe 2c6ba76a91 Bug 1915435 - [devtools] Show checker under transluscent colors in color swatch. r=devtools-reviewers,ochameau.
We used to show the checker but this regressed at some point.
A stacking context is needed to put the pseudo element which
contains the checker below the swatch, so we create it on
the swatch container.
We take this as an opportunity to cleanup the swatch rules,
using CSS variables to control swatch and background sizes.
This allows us to share the same classes for the computed panel
swatches, which only need a different size.

Differential Revision: https://phabricator.services.mozilla.com/D220525
2024-09-02 21:04:45 +00:00
Nicolas Chevobbe e6864821e1 Bug 1915382 - [devtools] Replace ruleview prefix with inspector in inspector shared CSS files. r=devtools-reviewers,jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D220392
2024-09-02 21:04:44 +00:00
Julian Descottes c6e7ad0994 Bug 1913529 - [devtools] Fix propTypes warnings when using the debugger r=devtools-reviewers,bomsy
Differential Revision: https://phabricator.services.mozilla.com/D219367
2024-09-02 10:05:45 +00:00
Hubert Boma Manilla 323b231b0c Bug 1915636 - [devtools] Fix regression of tab key working with selected content in the js terminal r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D220678
2024-08-30 21:32:23 +00:00
Nicolas Chevobbe 5053f14005 Bug 1915353 - [devtools] Fix error in OutputParser when parsing ParenthesisBlock. r=devtools-reviewers,jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D220374
2024-08-29 04:56:13 +00:00
Hubert Boma Manilla a5b64ee88c Bug 1913693 - [devtools] Cleanup legacy code added to handle escaping out of the editor r=devtools-reviewers,jdescottes
After a bit of investigation it seems like the code in the `onKeyDown` event was added to work around
the source editor hijacking all the Tab and Shift + Tab key events. The source editor code responsible can be found here
https://searchfox.org/mozilla-central/rev/ea91f336d0004ca28c909da948cb363f3e560877/devtools/client/shared/sourceeditor/editor.js#311-346.
The debugger does not seem to use most of the config settings related to the tab.

Differential Revision: https://phabricator.services.mozilla.com/D219425
2024-08-28 21:44:53 +00:00
Nicolas Chevobbe 9041e9be68 Bug 1915108 - [devtools] Localize variable tooltip computed value string. r=devtools-reviewers,jdescottes.
Depends on D219145

Differential Revision: https://phabricator.services.mozilla.com/D220228
2024-08-27 12:08:59 +00:00
Nicolas Chevobbe 11fbac6a5c Bug 1912006 - [devtools] Use OutputParser to display values in variable tooltip. r=devtools-reviewers,jdescottes.
Re-use the OutputParser options from the declaration so we can have similar
results than in the Rules view.

Differential Revision: https://phabricator.services.mozilla.com/D219145
2024-08-27 12:08:59 +00:00
Nicolas Chevobbe 2fde544ddf Bug 1912267 - [devtools] Display <empty> for empty values in variable tooltip. r=devtools-reviewers,jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D219143
2024-08-27 06:07:50 +00:00
Nicolas Chevobbe 34abe4c770 Bug 1912995 - [devtools] Don't repeat variable name in CSS variable tooltip. r=devtools-reviewers,jdescottes.
This changes the `--x = red` tooltip content into just `red`.
We still keep the `--x is not set` as I'm unsure what the alternative could be
(and given it would probably still need localized string, as we can use `unset`,
which is an actual valid value)

Tests are updated to include the new tooltip content.
devtools/client/inspector/rules/test/browser_rules_preview-tooltips-sizes.js is
further tweaked to cover a frequent intermittent.

Differential Revision: https://phabricator.services.mozilla.com/D219138
2024-08-26 08:15:27 +00:00
Nicolas Chevobbe c2124ecf93 Bug 1913343 - [devtools] Set cursor blink rate from ui.caretBlinkTime in CodeMirror 6. r=devtools-reviewers,jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D219257
2024-08-26 06:48:52 +00:00
Nicolas Chevobbe 5ac2ff58d1 Bug 1890205 - [devtools] Use CodeMirror 6 to highlight syntax of breakpoint line in Breakpoints panel when cm6 is enabled. r=devtools-reviewers,bomsy.
A method is added to the source editor to handle syntax highlighting so we can
handle both cm5 and cm6.

As the rules for syntax highlighting in CodeMirror 6 were all defined in the `cm-editor`
class, we have to add a specific class that we can target for the previews,
and handle it in the light and dark CSS files.

Differential Revision: https://phabricator.services.mozilla.com/D219175
2024-08-26 05:16:38 +00:00
Gijs Kruitbosch 3b619083de Bug 1822975 - clean up places that manually enable broader async stacks which is now the default in tests, r=devtools-reviewers,firefox-desktop-core-reviewers ,geckoview-reviewers,mconley,ohall
Differential Revision: https://phabricator.services.mozilla.com/D215204
2024-08-22 14:48:07 +00:00
Gregory Pappas f3eccebb74 Bug 1914101 - Remove unused window parameter from KeyShortcuts.parseElectronKey r=devtools-reviewers,ochameau
It became unused in bug 1290227

Differential Revision: https://phabricator.services.mozilla.com/D219717
2024-08-21 11:39:20 +00:00
Gregory Pappas 871c70efef Bug 1914107 - Use AppConstants to get the platform in ADBAddon._getXpiLink instead of using the hidden window's navigator.platform r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D219719
2024-08-21 08:30:25 +00:00
Iulian Moraru 72dd47149b Backed out changeset 7f90a3644c28 (bug 1898204) for causing dt failures on browser_dbg-search-file.js. CLOSED TREE 2024-08-20 11:54:51 +03:00
Hubert Boma Manilla 0f2f04e940 Bug 1898204 - [devtools] Show cursor location as document selection changes r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D215787
2024-08-20 07:32:53 +00:00
Nicolas Chevobbe 5bdffd9644 Bug 1630950 - [devtools] Use CSS variable computed values to display color swatches. r=devtools-reviewers,bomsy.
Using the computed value makes it possible to easily
show the color swatch where we previously couldn't,
mostly when a variable was based of other variables.
Test cases are added to assert the new behavior.

Differential Revision: https://phabricator.services.mozilla.com/D218728
2024-08-13 14:42:03 +00:00
Nicolas Chevobbe ccd4780374 Bug 1630950 - [devtools] Parse colors for CSS variable declaration if computed value is a valid color. r=devtools-reviewers,jdescottes.
For the computation of options.supportsColor, we were checking
if the variable declaration value was a valid color. This is
working well for simple case, but not when the declaration is
using other variables.
Switching to the computed value fixes this case.
The output parser test for variables is modified so we can
check all the test cases for a css variable declaration (we only
use to test for a color declaration).
A couple test cases are skipped because they're not supported yet.
Bugs have been filed and reference added in comments.

Depends on D218519

Differential Revision: https://phabricator.services.mozilla.com/D218727
2024-08-13 14:42:03 +00:00
Nicolas Chevobbe c18b0bc3e5 Bug 1912285 - [devtools] Display empty computed value in var tooltip. r=devtools-reviewers,jdescottes.
The #createNode function wasn't adding attribute if they
were empty, meaning that the data-variable-computed attribute
wouldn't be set for empty computed value (which are stil valid).

Note that this doesn't look great in the tooltip at the moment,
we may display empty values differently in Bug 1912267.

Differential Revision: https://phabricator.services.mozilla.com/D218849
2024-08-09 15:33:07 +00:00
Julian Descottes 0b91f03a8c Bug 1801545 - [devtools] Use mouse scroll to update values in inplace-editor r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D218733
2024-08-08 17:27:40 +00:00
Nicolas Chevobbe 3ad92970fd Bug 1911525 - [devtools] Fix output parser for CSS variable using light-dark(). r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D218530
2024-08-07 14:55:24 +00:00
Nicolas Chevobbe b3a64b958a Bug 1626234 - [devtools] Display the computed value of custom property in var() tooltip. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D218403
2024-08-07 14:55:24 +00:00
Nicolas Chevobbe 6789f29413 Bug 1911510 - [devtools] Lazy load cssProperties in InplaceEditor. r=devtools-reviewers,bomsy.
Change the `cssVariables` option, a Map, into `getCssVariables`, a function,
so it can be called only when it's needed.

Differential Revision: https://phabricator.services.mozilla.com/D218518
2024-08-07 14:55:23 +00:00
Norisz Fay 4f9b612d31 Backed out 4 changesets (bug 1911525, bug 1911510, bug 1626234, bug 1911524) for causing dt failures on browser_rules_variables_autocomplete.js CLOSED TREE
Backed out changeset 1d693bec567a (bug 1911525)
Backed out changeset 44eade30f582 (bug 1911524)
Backed out changeset 12f9b7ee50d2 (bug 1626234)
Backed out changeset f8794323217a (bug 1911510)
2024-08-07 15:11:58 +03:00
Nicolas Chevobbe eb79909114 Bug 1911525 - [devtools] Fix output parser for CSS variable using light-dark(). r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D218530
2024-08-07 10:36:12 +00:00
Nicolas Chevobbe 83a3bc4b57 Bug 1626234 - [devtools] Display the computed value of custom property in var() tooltip. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D218403
2024-08-07 10:36:11 +00:00
Nicolas Chevobbe 966b92b446 Bug 1911510 - [devtools] Lazy load cssProperties in InplaceEditor. r=devtools-reviewers,bomsy.
Change the `cssVariables` option, a Map, into `getCssVariables`, a function,
so it can be called only when it's needed.

Differential Revision: https://phabricator.services.mozilla.com/D218518
2024-08-07 10:36:11 +00:00
Nicolas Chevobbe a7c0f6fb77 Bug 1501959 - [devtools] Add inline start margin on new attribute input. r=devtools-reviewers,ochameau.
To be able to target the specific inplace editor input,
we add a new inputClass option to InplaceEditor that can
be used to add an additional class to the input.

Differential Revision: https://phabricator.services.mozilla.com/D216783
2024-08-06 07:43:38 +00:00
Nicolas Chevobbe f333040b11 Bug 1907803 - [devtools] Make inplace editor editing in markup view less confusing. r=devtools-reviewers,ochameau.
Update inplace editor "target" (tagname, attribute, …) focus style so it stands
out much more from the other items in the selected node line.
Since this wouldn't be easy/possible to do with the line "parts" colors set in
the themes stylesheet via theme-fg-color* classes, we remove those, add specific
classes when needed, and set the colors in markup.css.

When an inplace editor input is displayed, remove the "selected" style (blue background, white color)
from the line, so it's easier to understand we're in a different state.

Differential Revision: https://phabricator.services.mozilla.com/D216521
2024-08-06 07:43:37 +00:00
Nicolas Chevobbe 7aa4356e73 Bug 1857006 - [devtools] Parse light-dark() function in output-parser. r=devtools-reviewers,ochameau.
This patch adds a new `isDarkColorScheme` option to the OutputParser.
When passed, this will parse `light-dark` function to add an "unmatched" CSS
class to the param that isn't used: the first one when `isDarkColorsScheme` is
false, the second one when `isDarkColorScheme` is true.
Test cases are added in browser_outputparser.js to cover this.

Differential Revision: https://phabricator.services.mozilla.com/D217833
2024-08-05 15:40:48 +00:00
Nicolas Chevobbe debe4a9956 Bug 1857006 - [devtools] Refactor OutputParser for parsing (color) functions. r=devtools-reviewers,bomsy.
This patch introduce a new #stack property on the parser, which hold the parenthesis
stack so we can handle nested functions.
We switch the existing `colorFunctions` array to this new stack as it's doing
something similar, but a bit more generic.

When there's at least an entry in the stack, we want to put the parsed parts,
text or nodes, into the `parts` stack entry property so it can be used later
when we handle the function being closed.

This parts get put into the "parent" stack entry, or into the main #parsed array
when the stack becomes empty.

We could go further, migrating `parseMatchingParens`/`parseVariable` to use the
stack and the `onCloseParenthesis` method. This might be done as part of Bug 1630950,
where we want to handle nested css variables.

Differential Revision: https://phabricator.services.mozilla.com/D218218
2024-08-05 15:40:47 +00:00
Hubert Boma Manilla fa9944434b Bug 1905840 - [devtools] Maintain scroll positon when switching through documents r=devtools-reviewers,nchevobbe
This implements caching of scroll snapshots of each source openend in the editor

Differential Revision: https://phabricator.services.mozilla.com/D216922
2024-07-31 12:56:09 +00:00
Alexandre Poirot a441733f0e Bug 1866818 - [devtools] Enable the JS tracer on remote debugging. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
Display a warning message in the tracer sidebar when there could be a backward compat issue.

Differential Revision: https://phabricator.services.mozilla.com/D217745
2024-07-31 12:48:21 +00:00
Nicolas Chevobbe 76a1df7a92 Bug 1910569 - [devtools] Rename OutputParser unmatchedVariableClass option into unmatchedClass so it can be used for light-dark(). r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D217832
2024-07-31 05:35:08 +00:00
Nicolas Chevobbe fd5f9e41b8 Bug 1910037 - [devtools] Remove unused parameter in _buildDecorationsForMarker and _buildDecorationsForPositionMarkers. r=bomsy,devtools-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D217785
2024-07-26 11:42:37 +00:00
Nicolas Chevobbe c3c5eafb12 Bug 1910034 - [devtools] Fix issue in _buildDecorationsForMarker for marker.shouldMarkAllLines. r=bomsy,devtools-reviewers.
With Bug 1909594, decorationLines items are expected to be an object.
We missed one callsite when marker.shouldMarkAllLines is true.

Differential Revision: https://phabricator.services.mozilla.com/D217784
2024-07-26 11:42:37 +00:00
Hubert Boma Manilla 1722dad3c8 Bug 1909594 - [devtools] Use the preview value to check the equality of the line content widget r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D217564
2024-07-25 18:11:31 +00:00
Alexandre Poirot 4c946b19bd Bug 1885054 - [devtools] Display tracer data in a debugger sidebar. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D204446
2024-07-22 18:49:43 +00:00
Sandor Molnar 0e45f1b380 Backed out changeset b6571a4222fb (bug 1885054) for causing bug 1909068 CLOSED TREE 2024-07-22 18:24:44 +03:00
Nicolas Chevobbe 8d5f16e496 Bug 1908600 - [devtools] Fix focus reset in HTMLTooltip#hide. r=devtools-reviewers,ochameau.
The item to focus after hiding the popup was picked from the tooltip document,
but picking it in the anchor document sounds more appropriate.
Also avoid to re-set the focus if the tooltip document doesn't have the focus
anymore before hiding the console (e.g. the user clicked on something outside
of DevTools)

This allows to properly focus the event badge back when hiding the event listener
tooltip with the keyboard. We tweak the event badge focus style a bit to make
this more obvious.

Differential Revision: https://phabricator.services.mozilla.com/D216909
2024-07-22 09:29:44 +00:00
Masayuki Nakano f27ebf7d6c Bug 1907490 - Make Draggable listen to pointerdown to capture the pointer r=nchevobbe,devtools-reviewers
`MouseEvent.pointerId` is `undefined` so that `setPointerCapture(undefined)`
means `setPointerCapture(0)` and it captures both click of mouse and first
touch of touch input devices.  It needs to listen to `pointerdown` event to
get the correct `pointerId` value.  Then, it can use only `pointerdown` and
`pointerup` because they are fired before `mousedown` and `mouseup`.
Additionally, it handles a drag while a mouse button is pressed.  Therefore,
it can ignore pointer events which are caused by other devices.

Although it's not required explicitly to release the capture when the pointer
is up, it needs to release capturing the pointer if `Escape` is pressed.
Therefore, this patch keeps the explicit release call.

Depends on D217216

Differential Revision: https://phabricator.services.mozilla.com/D217217
2024-07-22 08:05:35 +00:00
Masayuki Nakano b59559d6cd Bug 1907494 - Make LinearEasingFunctionWidget listen to pointerdown to capture the pointer r=nchevobbe,devtools-reviewers
`MouseEvent.pointerId` is `undefined` so that `setPointerCapture(undefined)`
means `setPointerCapture(0)` and it captures both click of mouse and first
touch of touch input devices.  Therefore, for getting correct `pointerId`,
it needs to listen to `pointerdown`.  Then, we make it listen to `pointerdown`
and `pointerup` events because `mousedown` and `mouseup` are always fired after
`pointerdown` and `pointerup` (`mousemove` and `pointermove` are really
different, therefore, it needs to keep listening to `mousemove`).  Finally,
they are handling a drag during a button press.  Therefore, they are designed
only for mouse devices.  Therefore, this patch makes the `pointerdown` listener
start to handle a drag only when the device type is "mouse".

Note that the pointer capture will be released when all pointers of the device
are inactivated.  Therefore, it does not need explicitly to release the capture.

Depends on D217215

Differential Revision: https://phabricator.services.mozilla.com/D217216
2024-07-22 08:05:35 +00:00
Hubert Boma Manilla 9aeb218d1c Bug 1897755 - [devtools] Update DAMP tests to support Codemirror 6 r=perftest-reviewers,devtools-reviewers,nchevobbe,sparky
This patch adds support for running debugger DAMP tests with CM6.
Currently switch off by default. Set the `devtools.debugger.features.codemirror-next` pref in
the custom.js to `true` to run.

Differential Revision: https://phabricator.services.mozilla.com/D210909
2024-07-19 18:42:02 +00:00
Hubert Boma Manilla 927bdb2ccd Bug 1907260 - [devtools] Fix lineWrapping on reload r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D216548
2024-07-19 13:14:19 +00:00
Hubert Boma Manilla 0cf1a4e6d4 Bug 1903700 - [devtools] Fix position visiblity check to handle scrolling correctly r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D216719
2024-07-18 12:47:03 +00:00
Alexandre Poirot c2af106622 Bug 1885054 - [devtools] Display tracer data in a debugger sidebar. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D204446
2024-07-18 09:02:06 +00:00