686 Commits
Author SHA1 Message Date
Nicolas Chevobbe 01f7f5bd3d Bug 2035143 - [devtools] Move handling of var() in OutputParser to onCloseParenthesis. r=devtools-reviewers,jdescottes.
This is moving the last special cases for Function tokens to onCloseParenthesis,
which means we can also remove `#parseVariable`, `#parseMatchingParens` and the
`stopAtComma` parameter for `#doParse`.

This has the nice side effects of adding color swatches for some declarations
where we didn't use to be able to compute those (results of `color-mix()`,
`contrast-color()`, relative color syntax `from` color, `var()` with fallback),
which are reflected in the changes in the tests.

With this final change, we also needed to change how we're handling font family
names so they can fit nicely in this new design. So instead of keeping track
of the different font family parts, and then appending them to `parts`, we
now keep a single index when we detect a font family name, and when we find
a delimiter or a closing parenthesis, we wrap the meaningful part of the
font family in a dedicated element.

As we needed something similar to what we have for stack entry for fonts, in order
to map a "part" to multiple tokens, we update the `CLOSED_STACK_ENTRY` "token",
renaming it to better convey what it does, and renaming the `stackEntry` into
a more generic `data` property.

Differential Revision: https://phabricator.services.mozilla.com/D296786
2026-05-04 19:45:03 +00:00
Sylvestre Ledru 074b376055 Bug 2023419 - Remove Emacs/Vim modelines from devtools/ r=emilio,devtools-backward-compat-reviewers,devtools-reviewers,nchevobbe
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287841
2026-03-28 10:21:10 +00:00
Sebastian Zartner 0ca894e0e8 Bug 2017985 - [devtools] Moved :visited to element-specific pseudo-class locks. r=nchevobbe,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D287505
2026-03-20 12:23:13 +00:00
Alexandru Marc 630e6cf0e8 Revert "Bug 2023419 - Remove Emacs/Vim modelines from devtools/ r=emilio,devtools-backward-compat-reviewers,devtools-reviewers,nchevobbe" for causing devtools failures
This reverts commit ed535dace9.
2026-03-17 12:46:01 +00:00
Sylvestre Ledru ed535dace9 Bug 2023419 - Remove Emacs/Vim modelines from devtools/ r=emilio,devtools-backward-compat-reviewers,devtools-reviewers,nchevobbe
replaced by .editorconfig

Differential Revision: https://phabricator.services.mozilla.com/D287841
2026-03-17 12:03:34 +00:00
Nicolas Chevobbe da2772f00a Bug 2020911 - [devtools] Use InspectorUtils.getCSSWideKeywords when we need CSS wide keywords. r=devtools-reviewers,layout-reviewers,emilio,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D286946
2026-03-12 08:38:36 +00:00
Cosmin Sabou 11162cf763 Revert "Bug 2020911 - [devtools] Use InspectorUtils.getCSSWideKeywords when we need CSS wide keywords. r=devtools-reviewers,layout-reviewers,emilio,ochameau." for causing font related dt failures.
This reverts commit f204119c98.

Revert "Bug 2020911 - [devtools] Add InspectorUtils.getCSSWideKeywords. r=emilio,devtools-reviewers,firefox-style-system-reviewers,layout-reviewers,ochameau."

This reverts commit 8bdbca9607.
2026-03-11 19:06:26 +00:00
Nicolas Chevobbe f204119c98 Bug 2020911 - [devtools] Use InspectorUtils.getCSSWideKeywords when we need CSS wide keywords. r=devtools-reviewers,layout-reviewers,emilio,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D286946
2026-03-11 17:42:21 +00:00
Sebastian Zartner 411dca3abd Bug 2014442 - [devtools] Added element-specific :open to pseudo-class locks. r=flod,nchevobbe,devtools-reviewers,fluent-reviewers
Not only does the `:open` pseudo-class get added, it is also located in a new 'Element-specific pseudo-classes` section.
That section shows pseudo-classes that only apply to specific elements.

Differential Revision: https://phabricator.services.mozilla.com/D283992
2026-03-11 13:41:17 +00:00
Mark Banner b38cd3110b Bug 1999554 - Automatically fix ESLint rule jsdoc/check-types for devtools/. r=devtools-reviewers,devtools-backward-compat-reviewers,profiler-reviewers,canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D272173
2025-11-21 16:16:08 +00:00
Mark Banner 2542790f53 Bug 1998787 - Automatic fixes for enabling ESLint jsdoc/tag-line rule everywhere. r=frontend-codestyle-reviewers,mtigley,perftest-reviewers,nchevobbe,home-newtab-reviewers,Gijs,mconley,sparky
Differential Revision: https://phabricator.services.mozilla.com/D271745
2025-11-10 21:27:12 +00:00
Nicolas Chevobbe 73ea9a3bfa Bug 1993974 - [devtools] Add proper JsDoc in devtools/shared/css/parsing-utils.js. r=devtools-reviewers,frontend-codestyle-reviewers,jdescottes.
We add a ParsedDeclaration JSDoc @typedef for all the `parse*Declarations` function.
And while we're at it, we enable the jsdoc eslint rules for parsing-utils.js, and
fix the issues that were raised by eslint.

Differential Revision: https://phabricator.services.mozilla.com/D268390
2025-10-30 09:05:56 +00:00
Kagami Sascha Rosylight 6b44d03af7 Bug 1982076 - Part 3: Reuse RelativeLuminanceUtils r=emilio,devtools-reviewers,layout-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D261785
2025-08-29 11:01:04 +00:00
Kagami Sascha Rosylight 35d4fce19c Bug 1982076 - Part 2: Port nearest color computation to glue.rs r=emilio,devtools-reviewers,firefox-style-system-reviewers,layout-reviewers,ochameau,dshin
Differential Revision: https://phabricator.services.mozilla.com/D260504
2025-08-29 11:01:00 +00:00
Nicolas Chevobbe c434d2bde4 Bug 1979604 - [devtools] Speedup StyleRule#form computation on declarations. r=devtools-reviewers,ochameau.
Detect CSS variables in parseDeclarationsInternal instead of using SharedCssLogic.isCssVariable.
Consider CSS variables name always valid so we avoid expensive calls to InspectorUtils.supports().

Differential Revision: https://phabricator.services.mozilla.com/D258853
2025-07-29 10:36:42 +00:00
Nicolas Chevobbe 4fbf520b88 Bug 1979601 - [devtools] Migrate CssColor specialValue from a getter to a property. r=devtools-reviewers,ochameau.
The getter was relying on private properties that are only set in the constructor,
so there's no need to have a getter.

Differential Revision: https://phabricator.services.mozilla.com/D258851
2025-07-29 10:36:39 +00:00
Nicolas Chevobbe ebcde07a80 Bug 1946445 - [devtools] Fix parseDeclarationsInternal for nested declarations. r=devtools-reviewers,jdescottes.
Stop collecting declarations as soon as we detect a nested rule.
Any declaration that come after the nested rules are now put in a
separate CSSNestedDeclaration rule.
We still need to handle the nesting logic for commented declarations,
as highlighted by a test case in test_parseDeclarations.js.
Other test cases there for nested rules are updated, and we add
a CSSNestedDeclaration in a Rules view mochitest to make sure we
don't get the declaration in the "top level" rule anymore.

Differential Revision: https://phabricator.services.mozilla.com/D237520
2025-02-11 14:44:52 +00:00
Nicolas Chevobbe 65d0aa02d0 Bug 1904752 - [devtools] Fix handling of single-char quote in InspectorCSSParserWrapper#performEOFFixup. r=devtools-reviewers,jdescottes.
When tracking tokens, we weren't handling the case of unterminated,
single-char quote.
Test cases are added to cover the fix.

Differential Revision: https://phabricator.services.mozilla.com/D214917
2024-06-26 17:30:37 +00:00
Nicolas Chevobbe 8384623980 Bug 1892901 - [devtools] Remove performEOFFixup preserveBackslash parameter. r=devtools-reviewers,bomsy.
The parameter was always passed with true,
except in a unit test.

Differential Revision: https://phabricator.services.mozilla.com/D208320
2024-04-30 05:12:54 +00:00
Nicolas Chevobbe 141dde3782 Bug 1892897 - [devtools] Re-enable camelcase eslint rule in devtools/shared/css/lexer.js. r=devtools-reviewers,bomsy.
Depends on D208318

Differential Revision: https://phabricator.services.mozilla.com/D208319
2024-04-30 05:12:54 +00:00
Nicolas Chevobbe 5532aef13b Bug 1892895 - [devtools] Remove JS CSS Lexer. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D208318
2024-04-26 09:18:12 +00:00
Nicolas Chevobbe de4ffa55e6 Bug 1888607 - [devtools] Use InspectorCSSParser in parseDeclarationsInternal. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D206092
2024-04-23 08:43:03 +00:00
Nicolas Chevobbe 0abfb7c1f9 Bug 1889363 - [devtools] Implement performEOFFixup for InspectorCSSParser. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D206748
2024-04-23 08:43:03 +00:00
Nicolas Chevobbe ca57e329c5 Bug 1888441 - [devtools] Use InspectorCSSParser in CSSCompleter. r=devtools-reviewers,bomsy.
This requires some changes as the token type and text from the cssparser
differs from the JS-based CSS lexer.

Differential Revision: https://phabricator.services.mozilla.com/D206023
2024-04-17 05:57:13 +00:00
Nicolas Chevobbe c7b54bcdaa Bug 1888609 - [devtools] Use InspectorCSSParser in prettifyCSS. r=devtools-reviewers,bomsy.
We're exposing the parser current lineNumber and columnNumber in InspectorCSSParserWrapper

Differential Revision: https://phabricator.services.mozilla.com/D206093
2024-04-16 12:11:59 +00:00
Nicolas Chevobbe 495bf67752 Bug 1888353 - [devtools] Use InspectorCSSParser in parsePseudoClassesAndAttributes. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D205981
2024-04-16 12:11:58 +00:00
Aron Cseh 12dda8a2c9 Backed out 5 changesets (bug 1888615, bug 1889871, bug 1888609, bug 1888353, bug 1888363) for causing dt failures on browser_webconsole_location_styleeditor_link.js CLOSED TREE
Backed out changeset ef8e96126716 (bug 1889871)
Backed out changeset a68f24368621 (bug 1888615)
Backed out changeset 1783cd63d2c4 (bug 1888609)
Backed out changeset 62333a10235e (bug 1888363)
Backed out changeset 03888776c90d (bug 1888353)
2024-04-16 13:18:32 +03:00
Nicolas Chevobbe ecd62534da Bug 1888353 - [devtools] Use InspectorCSSParser in parsePseudoClassesAndAttributes. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D205981
2024-04-16 07:39:35 +00:00
Nicolas Chevobbe 8609258f9f Bug 1887638 - [devtools] Add InspectorCSSParser. r=emilio,devtools-reviewers,frontend-codestyle-reviewers,bomsy.
This new InspectorCSSParser makes use of the cssparser crate so DevTools end
up using the same code as the CSS engine.
At the moment, we can't get the token start and end offsets, so we create
a JS wrapper class to compute them in JS. This might be removed if we get
a way to retrieve utf16 position from the cssparser.
The existing lexer xpcshell test is modified so it can run against both js-based
and rust-based lexers.

Differential Revision: https://phabricator.services.mozilla.com/D202909
2024-04-15 17:14:42 +00:00
Dave Townsend 2af4d349f3 Bug 1864896: Autofix unused function arguments (devtools). r=profiler-reviewers,devtools-reviewers,nchevobbe,julienw
Differential Revision: https://phabricator.services.mozilla.com/D202959
2024-03-05 14:21:15 +00:00
Calum Smith c805f8c777 Bug 1859079 - display new CSS level 4 colours correctly in Rules inspector. r=devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D191008
2023-10-17 17:02:56 +00:00
Nicolas Chevobbe 942af988e3 Bug 1851978 - [devtools] Turn CssColor's authored and lowerCased property private. r=ochameau,devtools-reviewers.
These are only used within the class, so we don't need to expose them.

Depends on D188005

Differential Revision: https://phabricator.services.mozilla.com/D188255
2023-09-14 15:06:22 +00:00
Nicolas Chevobbe b46d770952 Bug 1851978 - [devtools] Pass colorUnit to CssColor.toString. r=ochameau,devtools-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D188005
2023-09-14 15:06:22 +00:00
Nicolas Chevobbe 6dc349d666 Bug 1851978 - [devtools] Inline CssColor.newColor into CssColor constructor. r=ochameau,devtools-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D188002
2023-09-14 15:06:22 +00:00
Nicolas Chevobbe 24756144c6 Bug 1851978 - [devtools] Remove unused setAlpha function and associated tests. r=ochameau,devtools-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D188001
2023-09-14 15:06:21 +00:00
Nicolas Chevobbe 4236590988 Bug 1851978 - [devtools] Remove unused CssColor._getHSLATuple. r=ochameau,devtools-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D187998
2023-09-14 15:06:21 +00:00
Nicolas Chevobbe b94f0cc69a Bug 1851978 - [devtools] Use proper private properties and methods in CssColor. r=ochameau,devtools-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D187997
2023-09-14 15:06:21 +00:00
Nicolas Chevobbe 9266d32924 Bug 1851978 - [devtools] Turn CssColor into ES6 class. r=ochameau,devtools-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D187996
2023-09-14 15:06:21 +00:00
Alexandre Poirot 27f68e6323 Bug 1320607 - [devtools] Remove the generated CSS Properties database. r=devtools-reviewers,nchevobbe
This wasn't really used anymore.
We are fetching the database from the server runtime in order to support
remote debugging correctly, where frontend CSS may be different from debuggee CSS.

Differential Revision: https://phabricator.services.mozilla.com/D187492
2023-09-07 20:59:34 +00:00
Butkovits Atila 76e7dfa668 Backed out changeset fb19de542f01 (bug 1320607) for causing python failures complaining about test_devtools_database_parsing . CLOSED TREE 2023-09-07 18:58:05 +03:00
Alexandre Poirot 7198ba3de1 Bug 1320607 - [devtools] Remove the generated CSS Properties database. r=devtools-reviewers,nchevobbe
This wasn't really used anymore.
We are fetching the database from the server runtime in order to support
remote debugging correctly, where frontend CSS may be different from debuggee CSS.

Differential Revision: https://phabricator.services.mozilla.com/D187492
2023-09-07 13:08:37 +00:00
Emilio Cobos Álvarez 88a32df381 Bug 1850827 - Simplify how we draw window decorations. r=stransky,rmader,desktop-theme-reviewers,dao
This makes the rounded bottom corners work on X11, and makes the top
corner drawing less insane.

Differential Revision: https://phabricator.services.mozilla.com/D187345
2023-09-06 11:07:58 +00:00
Boris Chiou c691d750aa Bug 1819464 - Part 2: Add content-box and stroke-box into transform-box in style. r=emilio
Also, add a prefernce for content-box and stroke-box. So we have to
define a new type, TransformBox, and let content-box and stroke-box
behind the preference.

Differential Revision: https://phabricator.services.mozilla.com/D185363
2023-08-22 19:49:03 +00:00
Jonathan Kew 5bd60a7d9f Bug 1849010 - Implement the font-synthesis-position property. r=devtools-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D186448
2023-08-17 17:29:30 +00:00
Cosmin Sabou 4f2a066515 Backed out changeset 66c374acc3fb (bug 1849010) for causing font-synthesis failures. 2023-08-17 18:55:57 +03:00
Jonathan Kew ac58af2fed Bug 1849010 - Implement the font-synthesis-position property. r=devtools-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D186448
2023-08-17 14:54:01 +00:00
Alexandre Poirot 017f627911 Bug 1847753 - [devtools] Stop storing pseudo elements in properties-db. r=devtools-reviewers,nchevobbe
This appears to be unused and only page-actor is reading the list of all pseudo elements
by querying InspectorUtils directly.

Differential Revision: https://phabricator.services.mozilla.com/D185664
2023-08-09 13:30:40 +00:00
Boris Chiou 24398b1861 Bug 1598158 - Support offset-path:url() in style. r=devtools-reviewers,emilio
In layout, we build a default `path("m 0 0")` for now. We will implement
it later.

Besides, we don't support compositor animations for `url()`, so we don't
have to serialize it for IPC.

Note:
`<url>` includes `url()` and `src()`. For now we only support `url()`.
We should revisit `src()` in Bug 1845390.

Differential Revision: https://phabricator.services.mozilla.com/D184429
2023-08-07 22:04:01 +00:00
Emilio Cobos Álvarez 13c5e7ce8f Bug 1846859 - Remove appearance: {checkbox,radio}-{label,container}. r=desktop-theme-reviewers,dao
I didn't find a single GTK theme that drew something useful for this:

 * The container appearance isn't needed. It is a hack needed to get the
   right styles for the native checkbox, but that's it, we don't need to
   expose it to CSS.

 * The label appearance was meant to draw the focus outline but since it
   didn't work reliably we've been doing it manually since seven years
   ago (see bug 582951 and bug 1312169).

Other platforms also don't use these so this simplifies the code a bit.

Depends on D185279

Differential Revision: https://phabricator.services.mozilla.com/D185286
2023-08-03 16:36:39 +00:00
Jonathan Kew 63dfa6055c Bug 1708240 - Implement the from-font keyword for CSS font-size-adjust. r=emilio,devtools-reviewers
Depends on D182450

Differential Revision: https://phabricator.services.mozilla.com/D182451
2023-08-01 12:40:31 +00:00