Commit Graph
669 Commits
Author SHA1 Message Date
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
Emilio Cobos Álvarez 0fd7e5f229 Bug 1845623 - Regenerate devtools db.
MANUAL PUSH: Trivial fix CLOSED TREE
2023-07-27 18:35:29 +02:00
Emilio Cobos Álvarez e59a831ff4 Bug 1845540 - Remove some unused win-specific system colors and appearance values. r=mstange,devtools-reviewers,mhowell
Differential Revision: https://phabricator.services.mozilla.com/D184597
2023-07-26 20:57:47 +00:00
Frederic Wang 163acd7f54 Bug 1667090 - Implement CSS font-size: math and math-depth properties. r=emilio,devtools-reviewers
The font-size math keyword is implemented. It behaves as a font-size: 1em
with the extra fixup due to math-level change (and other legacy MathML
attributes). After that change, the CSS for math-level / font-size: math
is behaving as per the specification, so the math-depth is turned in
nightly.

The adjusting function for font-size: math is modified so that it's
executed only if both font-size: math (otherwise the spec says no scale
should apply) and math-depth (otherwise the scale is 1 and function exists
early anyway) are set on the element.

Differential Revision: https://phabricator.services.mozilla.com/D91744
2023-07-26 06:15:12 +00:00
Boris Chiou 3d1ac1bb1c Bug 1786161 - Support rect() function. r=devtools-reviewers,emilio
Note that rect() computes to the equivalent inset() function as well.
i.e. Given `rect(t r b l)`, the equivalent function is
`inset(t calc(100% - r) calc(100% - b) l)`.

The implementation is straightforward, and we don't have to change
anything in cpp because it is always `inset()` when building the gfx::Path.

The tests for clip-path will be added in the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D183528
2023-07-25 02:32:43 +00:00
Nicolas Chevobbe b755a233d5 Bug 1844499 - [devtools] Handle nested rule without closing paren. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D184111
2023-07-24 08:54:16 +00:00
Emilio Cobos Álvarez f80408fefa Bug 1844242 - Remove now unused windows appearance code. r=handyman,devtools-reviewers
After bug 1843663 these aren't used on Windows.

Some values aren't used anywhere so I removed them as well.

Differential Revision: https://phabricator.services.mozilla.com/D183945
2023-07-20 19:50:11 +00:00
Emilio Cobos Álvarez 5524090db0 Bug 1844241 - Remove now-dead graphics glass code. r=tnikkel,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D183942
2023-07-19 12:44:34 +00:00
Frederic Wang fdbed17109 Bug 1821980: Align mathvariant implementation on MathML Core. r=emilio,jfkthame
In MathML Core, the recommendation is to directly use the proper
character from the Mathematical Alphanumeric Symbols instead of the
mathvariant attribute. The exception is for automatic italicization on
single-char `<mi>` element. This is implemented via a new text-transform
value "math-auto" [1] which is the default on the `<mi>` element. The
mathvariant attribute is now restricted to that element and to value
"normal" in order to force upright text instead [2]. This CL implements
this restriction together with that new text-transform value under the
mathml.legacy_mathvariant_attribute.disabled flag.

Some legacy MathML cases where math-auto alone does not work are
still handled via MathMLTextRunFactory.

[1] https://w3c.github.io/mathml-core/#new-text-transform-values
[2] https://w3c.github.io/mathml-core/#the-mathvariant-attribute

Differential Revision: https://phabricator.services.mozilla.com/D172395
2023-07-14 19:44:04 +00:00
Cristian Tuns 26d6e46ac1 Backed out changeset db50582c2b9f (bug 1821980) for causing mochitest failures in browser_mathml.js CLOSED TREE 2023-07-14 13:49:13 -04:00
Frederic Wang 3cd57ef95a Bug 1821980: Align mathvariant implementation on MathML Core. r=emilio,jfkthame
In MathML Core, the recommendation is to directly use the proper
character from the Mathematical Alphanumeric Symbols instead of the
mathvariant attribute. The exception is for automatic italicization on
single-char `<mi>` element. This is implemented via a new text-transform
value "math-auto" [1] which is the default on the `<mi>` element. The
mathvariant attribute is now restricted to that element and to value
"normal" in order to force upright text instead [2]. This CL implements
this restriction together with that new text-transform value under the
mathml.legacy_mathvariant_attribute.disabled flag.

Some legacy MathML cases where math-auto alone does not work are
still handled via MathMLTextRunFactory.

[1] https://w3c.github.io/mathml-core/#new-text-transform-values
[2] https://w3c.github.io/mathml-core/#the-mathvariant-attribute

Differential Revision: https://phabricator.services.mozilla.com/D172395
2023-07-14 15:53:34 +00:00
Iulian Moraru d048395e91 Backed out changeset 6cceaca5e653 (bug 1821980) for causing multiple failures. CLOSED TREE 2023-07-14 15:41:31 +03:00
Frederic Wang 48e18e6261 Bug 1821980: Align mathvariant implementation on MathML Core. r=emilio,jfkthame
In MathML Core, the recommendation is to directly use the proper
character from the Mathematical Alphanumeric Symbols instead of the
mathvariant attribute. The exception is for automatic italicization on
single-char `<mi>` element. This is implemented via a new text-transform
value "math-auto" [1] which is the default on the `<mi>` element. The
mathvariant attribute is now restricted to that element and to value
"normal" in order to force upright text instead [2]. This CL implements
this restriction together with that new text-transform value under the
mathml.legacy_mathvariant_attribute.disabled flag.

Some legacy MathML cases where math-auto alone does not work are
still handled via MathMLTextRunFactory.

[1] https://w3c.github.io/mathml-core/#new-text-transform-values
[2] https://w3c.github.io/mathml-core/#the-mathvariant-attribute

Differential Revision: https://phabricator.services.mozilla.com/D172395
2023-07-14 10:52:59 +00:00
Boris Chiou 43bb1fa8a2 Bug 1842277 - Compute <basic-shape-rect> to the equivalent inset() function. r=devtools-reviewers,emilio
Per spec
https://drafts.csswg.org/css-shapes-1/#basic-shape-computed-values, and
the spec issue, https://github.com/w3c/csswg-drafts/issues/9053,
all <basic-shape-rect> functions compute to the equivalent inset() function.
i.e.
`xywh(x y w h)` computes to
`inset(y calc(100% - x - w) calc(100% - y - h) x)`

The basic concept is to use `BasicShapeRect` as the specified value of
`<basic-shape-rect>`, i.e. inset()/xywh()/rect(), and its computed value is
the equivalent `InsetRect`, and so it becomes possible to interpolate among
these three functions.

Also, we can drop BuildXywhPath() and ComputeRect() because now there is
only inset() function when building gfx::Path.

Besides, tweak the test, offset-path-shape-xywh-003.html, because the original
test, `xywh(10% 10% 80% 80%)`, has to calculate `calc(100% - 10% - 80%)`.
Its result is `Percentage(0.099999964)` in Rust code, and then it makes us
compute an imprecision inset rect when building the gfx::path, which results in
a transform with the sub-pixel translation. So change it to
`xywh(10% 10% 90% 90%)` to avoid adding fuzzy tolerance.

Differential Revision: https://phabricator.services.mozilla.com/D183221
2023-07-12 20:16:47 +00:00
Rob Buis c90ca1b9f3 Bug 1835813 - support contain-intrinsic-size: auto none r=Oriol,emilio,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D182462
2023-07-11 18:23:26 +00:00
Jan-Niklas Jaeschke b67ca53946 Bug 1840818: Enable Custom Highlight API in Nightly. r=dom-core,sefeng,webidl,devtools-reviewers,nchevobbe,edgar
Differential Revision: https://phabricator.services.mozilla.com/D182721
2023-07-05 14:28:49 +00:00
Iulian Moraru f0a9deb0b1 Backed out changeset 16be47412c5c (bug 1840818) for causing multiple failures related to highlight. CLOSED TREE 2023-07-05 13:45:16 +03:00
Jan-Niklas Jaeschke bbbcedb18b Bug 1840818: Enable Custom Highlight API in Nightly. r=dom-core,sefeng,webidl,devtools-reviewers,nchevobbe,edgar
Differential Revision: https://phabricator.services.mozilla.com/D182721
2023-07-05 09:05:27 +00:00