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
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
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
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
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
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
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
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
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
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
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
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
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