Commit Graph

15483 Commits

Author SHA1 Message Date
Tiaan Louw
24d6a794dc Bug 1892188 - Remove FromParsedColor trait r=layout-reviewers,emilio
Also removed unused component conversion functions.

Differential Revision: https://phabricator.services.mozilla.com/D207837
2024-04-19 09:32:48 +00:00
Tiaan Louw
2781702e17 Bug 1892188 - Refactor ColorParser r=layout-reviewers,emilio
- Rename ColorParser to ComponentParser.
- Move origin color parsing to parse_color_function.
- Inline the parse_components function.

Differential Revision: https://phabricator.services.mozilla.com/D207836
2024-04-19 09:32:48 +00:00
Tiaan Louw
e0903ef7b0 Bug 1892188 - Move parser_(modern|legacy)_alpha to ColorParser r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D207835
2024-04-19 09:32:47 +00:00
Narcis Beleuzu
1ff43046db Backed out 3 changesets (bug 1892188) for wpt failure on color-computed-relative-color.html . CLOSED TREE
Backed out changeset 712905edaaef (bug 1892188)
Backed out changeset 032a5034f221 (bug 1892188)
Backed out changeset 2f28639aaae1 (bug 1892188)
2024-04-19 02:01:55 +03:00
Tiaan Louw
eb018d2abc Bug 1892188 - Remove FromParsedColor trait r=layout-reviewers,emilio
Also removed unused component conversion functions.

Differential Revision: https://phabricator.services.mozilla.com/D207837
2024-04-18 20:14:38 +00:00
Tiaan Louw
53eae41677 Bug 1892188 - Refactor ColorParser r=layout-reviewers,emilio
- Rename ColorParser to ComponentParser.
- Move origin color parsing to parse_color_function.
- Inline the parse_components function.

Differential Revision: https://phabricator.services.mozilla.com/D207836
2024-04-18 20:14:38 +00:00
Tiaan Louw
36820fa924 Bug 1892188 - Move parser_(modern|legacy)_alpha to ColorParser r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D207835
2024-04-18 20:14:37 +00:00
Emily McDonough
3ca301e949 Bug 1833466 - Implement CSSMarginRule and the corresponding DOM API. r=webidl,firefox-style-system-reviewers,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206804
2024-04-16 19:52:39 +00:00
Tiaan Louw
87e3ad4451 Bug 1890724 - Interpret color channel keywords in relative color syntax r=layout-reviewers,emilio
When an origin color is specified in RCS, using the channel keywords
from the original color should be replaced by the values from the origin
color.

Differential Revision: https://phabricator.services.mozilla.com/D207117
2024-04-16 12:16:32 +00:00
Sandor Molnar
a29925a21c Backed out changeset ce926ee22c80 (bug 1833466) for causing build bustages @ layout/style/ServoStyleSet.cpp CLOSED TREE 2024-04-16 04:04:55 +03:00
Emily McDonough
986c112d1b Bug 1833466 - Implement CSSMarginRule and the corresponding DOM API. r=webidl,firefox-style-system-reviewers,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206804
2024-04-15 23:55:12 +00:00
Sandor Molnar
ce68385462 Backed out changeset f2ae18495e1e (bug 1833466) for causing build bustages @ CSSMarginRule.cpp 2024-04-16 00:09:00 +03:00
Emily McDonough
f4b1a18436 Bug 1833466 - Implement CSSMarginRule and the corresponding DOM API. r=webidl,firefox-style-system-reviewers,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206804
2024-04-15 18:14:42 +00:00
Nicolas Chevobbe
46f2af8bba Bug 1887638 - [devtools] Expose CSS token value in InspectorCSSToken. r=emilio.
In some cases, it can be more useful to only get the token value than the whole
token text (e.g. for 'Function`, where the value is the function name, while
the text includes the opening parenthesis)
Refactor `test_lexer` to better test the tokens we get, including their value property.

Differential Revision: https://phabricator.services.mozilla.com/D207400
2024-04-15 17:14:43 +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
Aron Cseh
c7c307ad6e Backed out changeset eb313b2b8b12 (bug 1890724) for causing wpt failures on color-computed-relative-color.html. CLOSED TREE 2024-04-15 19:41:48 +03:00
Tiaan Louw
cfd0aa1271 Bug 1890724 - Interpret color channel keywords in relative color syntax r=layout-reviewers,emilio
When an origin color is specified in RCS, using the channel keywords
from the original color should be replaced by the values from the origin
color.

Differential Revision: https://phabricator.services.mozilla.com/D207117
2024-04-15 10:51:34 +00:00
Ashley Hale
42b7816b23 Bug 1885716 - Fix HSL/HWB/LCH/OKLCH gradient longer hue interpolation 1-stop case r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206976
2024-04-12 04:14:16 +00:00
Nicolas Chevobbe
6a315df242 Bug 1890775 - [devtools] Fix get_byte_index_from_line_and_column line index computation. r=layout-reviewers,devtools-reviewers,emilio.
We were getting a line byte index for the
actual char matching the line we want, but
we actually need the index _after_ that
new line char.
A test case is added to cover this fix.

Differential Revision: https://phabricator.services.mozilla.com/D207156
2024-04-11 12:57:38 +00:00
Emilio Cobos Álvarez
d74cc97870 Bug 1878919 - Add a forced-colors: requested chrome-only media feature value. r=morgan,dao
This is to be able to let the browser chrome observe the in-content
forced-color values too.

Differential Revision: https://phabricator.services.mozilla.com/D200856
2024-04-10 14:34:44 +00:00
Tiaan Louw
b140ad4eee Bug 1886170 - Change Color Parser trait into a concrete type r=layout-reviewers,emilio
The ColorParser trait only has one implementation so we can make it a
concrete type now.  It will be extended in the future.

Differential Revision: https://phabricator.services.mozilla.com/D207009
2024-04-09 14:00:02 +00:00
Tiaan Louw
a01df865fc Bug 1886170 - Remove ColorParser::Output abstraction r=layout-reviewers,emilio
This abstraction was in place when the color parsing still lived in
the cssparser crate, but now it is not needed any more and by removing
it we make the parsing more flexible.

Note: the ColorParser trait itself is still in tact and will be
addressed in another patch.

Differential Revision: https://phabricator.services.mozilla.com/D207008
2024-04-09 14:00:01 +00:00
Tiaan Louw
5d8ce46493 Bug 1886170 - Add ColorFunction enum r=layout-reviewers,emilio
Add a ColorFunction enum that can hold the results of a parsed color
with all the required information still intact.

Differential Revision: https://phabricator.services.mozilla.com/D207007
2024-04-09 14:00:01 +00:00
Tiaan Louw
788b2180ba Bug 1890502 - Unify the color component parsing functions r=layout-reviewers,emilio
No behaviour is changed and the functions are only merged to a single
more generic version.  Avoid code duplication and will make future
changes much easier and less error prone.

Differential Revision: https://phabricator.services.mozilla.com/D206993
2024-04-09 14:00:00 +00:00
Tiaan Louw
bb0c02e004 Bug 1889133 - Parse the from <color> part of the relative color syntax. r=layout-reviewers,emilio
All color functions support a from keyword as part of the relative color
syntax.

https://drafts.csswg.org/css-color-5/#relative-colors

This patch adds a pref layout.css.relative-color-syntax.enabled that is
off by default.

We start passing tests that only check for the validity of the `from`
keyword in different color functions.

Differential Revision: https://phabricator.services.mozilla.com/D206374
2024-04-08 15:26:25 +00:00
Emilio Cobos Álvarez
ef3e61b4f6 Bug 1864418 - Append implicit parent selector during parsing. r=dshin,devtools-reviewers,nchevobbe
This matches recent spec changes.

Differential Revision: https://phabricator.services.mozilla.com/D206766
2024-04-08 08:44:42 +00:00
Nicolas Chevobbe
3f151d357e Bug 1882964 - [devtools] Turn getRuleBodyTextOffsets into getRuleBodyText for easier unicode chars handling. r=layout-reviewers,devtools-reviewers,emilio,ochameau.
`InspectorUtils.getRuleBodyTextOffset` was returning bytes position, and we
were using them directly in Javascript `substring`, which causes problem
with non-ascii chars.
Instead of returning offsets to compute the rule string, we directly return
the string from InspectorUtils which is easier to work with.

Differential Revision: https://phabricator.services.mozilla.com/D204523
2024-04-08 08:37:14 +00:00
Nicolas Chevobbe
2644f82de7 Bug 1882964 - [devtools] Add InspectorUtils.replaceBlockRuleBodyTextInStylesheet. r=layout-reviewers,devtools-reviewers,emilio,ochameau.
The next patch modifies `getRuleText` so it only returns the text, and no
longer the offset at which the rule starts.
The only consumer of the returned offset was in `StyleRuleActor#setRuleText`,
so we migrate this directly to a InspectorUtils method to avoid mixing JS string
indexes with Rust bytes position.

Differential Revision: https://phabricator.services.mozilla.com/D204522
2024-04-08 08:37:13 +00:00
Boris Chiou
0a0aa568db Bug 1889496 - Part 2: Implement CSSStartingStyleRule interface. r=webidl,firefox-style-system-reviewers,layout-reviewers,emilio
Introduce CSSStartingStyleRule and add one extra parsing test for
@starting-style rule.

Differential Revision: https://phabricator.services.mozilla.com/D206564
2024-04-05 21:03:07 +00:00
Boris Chiou
36f2970bd8 Bug 1889496 - Part 1: Parse @starting-style rule. r=layout-reviewers,firefox-style-system-reviewers,emilio
We introduce this rule and parse it in this patch. Also, fix some wpt
expectations for ERROR.

We will introduce CSSStartingStyleRule in the following patch, and test
it there.

Differential Revision: https://phabricator.services.mozilla.com/D206428
2024-04-05 21:03:06 +00:00
Emilio Cobos Álvarez
a89ab645c1 Bug 1889670 - Add code to track accurate allocation size in servo-arc. r=firefox-style-system-reviewers,zrhoffman
See comments.

Differential Revision: https://phabricator.services.mozilla.com/D206659
2024-04-05 19:23:42 +00:00
Cristian Tuns
e28581a958 Backed out 2 changesets (bug 1889496) for causing build bustages in RefPtr.h CLOSED TREE
Backed out changeset 7689f9c266fc (bug 1889496)
Backed out changeset abbbf327c4f1 (bug 1889496)
2024-04-04 19:15:49 -04:00
Boris Chiou
90f93535fd Bug 1889496 - Part 2: Implement CSSStartingStyleRule interface. r=webidl,firefox-style-system-reviewers,layout-reviewers,emilio
Introduce CSSStartingStyleRule and add one extra parsing test for
@starting-style rule.

Differential Revision: https://phabricator.services.mozilla.com/D206564
2024-04-04 19:39:29 +00:00
Boris Chiou
d098db3d45 Bug 1889496 - Part 1: Parse @starting-style rule. r=layout-reviewers,firefox-style-system-reviewers,emilio
We introduce this rule and parse it in this patch. Also, fix some wpt
expectations for ERROR.

We will introduce CSSStartingStyleRule in the following patch, and test
it there.

Differential Revision: https://phabricator.services.mozilla.com/D206428
2024-04-04 19:39:28 +00:00
Jan-Niklas Jaeschke
dbaf47b1f4 Bug 1867939, part 4: Implemented the ::target-text CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-04 14:39:32 +00:00
Emily McDonough
3695814b25 Bug 1868215 - Change css::PageRule to inherit from css::GroupRule rather than css::Rule r=webidl,firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206073
2024-04-04 01:04:41 +00:00
Stanca Serban
ce5dc60809 Backed out 6 changesets (bug 1867939) for causing wpt failures in target-text-010.html. CLOSED TREE
Backed out changeset 44101c258e52 (bug 1867939)
Backed out changeset c53267e1b460 (bug 1867939)
Backed out changeset 0748839408e5 (bug 1867939)
Backed out changeset 38631fbd2f2f (bug 1867939)
Backed out changeset d77b9257c842 (bug 1867939)
Backed out changeset 0d269b891421 (bug 1867939)
2024-04-04 00:50:50 +03:00
Jan-Niklas Jaeschke
3f695f17a9 Bug 1867939, part 4: Implemented the ::target-text CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-03 15:23:02 +00:00
Sandor Molnar
000124e596 Merge mozilla-central to autoland. a=merge 2024-04-03 17:47:38 +03:00
Sandor Molnar
7a867184d3 Backed out 6 changesets (bug 1867939) for causing a top crash in nightly Bug 1889393 CLOSED TREE
Backed out changeset 2110f57e928c (bug 1867939)
Backed out changeset 51890598ecb4 (bug 1867939)
Backed out changeset 839bc1b11a2c (bug 1867939)
Backed out changeset bb88c4d09e82 (bug 1867939)
Backed out changeset 27c76e65cf58 (bug 1867939)
Backed out changeset c3e3c81f9ceb (bug 1867939)
2024-04-03 17:31:56 +03:00
Mike Hommey
d39bf8e14a Bug 1889030 - Remove unused CascadeDataCacheEntry::cascade_data. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206323
2024-04-03 06:35:27 +00:00
Mike Hommey
38a24916d1 Bug 1889030 - Remove redundant imports from style. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206322
2024-04-03 06:35:27 +00:00
Mike Hommey
0e2ab0d4b3 Bug 1889030 - Remove redundant imports from style_traits. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206321
2024-04-03 06:35:26 +00:00
Mike Hommey
7f6a249788 Bug 1889030 - Remove redundant imports from selectors. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206320
2024-04-03 06:35:26 +00:00
Mike Hommey
24d9454ee8 Bug 1889030 - Remove redundant imports from servo_arc. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D206305
2024-04-03 06:35:26 +00:00
David Shin
06ec16dc27 Bug 1874042: Add support for unknown match result for invalidation by comparing now/then. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205257
2024-04-02 20:29:05 +00:00
David Shin
c18fe85ec6 Bug 1874042: Refactor KleeneValue for use in selector invalidation. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205256
2024-04-02 20:29:05 +00:00
Jan-Niklas Jaeschke
f46900e678 Bug 1867939, part 4: Implemented the ::target-text CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-02 13:44:25 +00:00
Cristian Tuns
9a4d6d56af Backed out 6 changesets (bug 1867939) for causing build bustages in Document.h CLOSED TREE
Backed out changeset 0853f9a7a06c (bug 1867939)
Backed out changeset 2279e6577c13 (bug 1867939)
Backed out changeset 1b3af4b6a27b (bug 1867939)
Backed out changeset 2fbe643ca483 (bug 1867939)
Backed out changeset 575873406614 (bug 1867939)
Backed out changeset 82f99c0210b0 (bug 1867939)
2024-04-02 09:15:46 -04:00
Jan-Niklas Jaeschke
9ce335fcb7 Bug 1867939, part 4: Implemented the ::target-text CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe
This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
2024-04-02 11:43:21 +00:00