Commit Graph

10494 Commits

Author SHA1 Message Date
Tiaan Louw
35fb9f4e20 Bug 1822041 - Color interpolation takes none keyword into account r=emilio,layout-reviewers
Now that the none keyword is available, we can take it into account when
interpolating colors following the rules from the spec here:

https://drafts.csswg.org/css-color-4/#interpolation-missing

Differential Revision: https://phabricator.services.mozilla.com/D172666
2023-03-19 10:09:53 +00:00
Marian-Vasile Laza
febb3304da Backed out changeset 6dc913a054e9 (bug 1822521) for bc failures on browser_parsable_css.js. CLOSED TREE 2023-03-18 16:06:04 +02:00
Cathie Chen
769b123100 Bug 1822521 - Update UA stylesheet for popover. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172700
2023-03-18 12:56:18 +00:00
Tiaan Louw
33b1bb1d7a Bug 1813481 - Allow 'none' keyword in color components r=emilio,supply-chain-reviewers,devtools-reviewers
Make use of the new changes in the cssparser that allows 'none' keywords
in color components where allowed.  We store the none values as 0.0 (as
per the spec) and mark the components with the flags. This way we don't
have to check anything on the components before doing calculations.

As this is the last part intended to be released for the new [color-4]
changes, I've also enabled the changes on nightly.

Differential Revision: https://phabricator.services.mozilla.com/D170208
2023-03-16 11:50:55 +00:00
Marian-Vasile Laza
1336fae15a Backed out changeset 160ac6b5f726 (bug 1813481) for assertion failure on nsCSSRenderingGradients.cpp. 2023-03-16 01:50:39 +02:00
Tiaan Louw
6333a5b9c0 Bug 1813481 - Allow 'none' keyword in color components r=emilio,supply-chain-reviewers,devtools-reviewers
Make use of the new changes in the cssparser that allows 'none' keywords
in color components where allowed.  We store the none values as 0.0 (as
per the spec) and mark the components with the flags. This way we don't
have to check anything on the components before doing calculations.

As this is the last part intended to be released for the new [color-4]
changes, I've also enabled the changes on nightly.

Differential Revision: https://phabricator.services.mozilla.com/D170208
2023-03-15 21:10:43 +00:00
Butkovits Atila
517158f944 Backed out changeset deabee2364d4 (bug 1813481) for causing assertion failures at gfxUtils.cpp. CLOSED TREE 2023-03-15 19:21:19 +02:00
David Shin
6f1642c4ef Bug 1820835: :has relative selector matching, with no caching/filtering. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172019
2023-03-15 16:39:33 +00:00
Tiaan Louw
16c8ab3ca9 Bug 1813481 - Allow 'none' keyword in color components r=emilio,supply-chain-reviewers,devtools-reviewers
Make use of the new changes in the cssparser that allows 'none' keywords
in color components where allowed.  We store the none values as 0.0 (as
per the spec) and mark the components with the flags. This way we don't
have to check anything on the components before doing calculations.

As this is the last part intended to be released for the new [color-4]
changes, I've also enabled the changes on nightly.

Differential Revision: https://phabricator.services.mozilla.com/D170208
2023-03-15 16:25:00 +00:00
Emilio Cobos Álvarez
de81fe765b Bug 1427715 - Add (unused for now) parsing for support conditions in @import. r=CanadaHonk
You can use this as:

  input.try_parse(SupportsCondition::parse_for_import).ok()

Or so.

Differential Revision: https://phabricator.services.mozilla.com/D172668
2023-03-15 12:41:26 +00:00
Cristina Horotan
de2e447722 Backed out changeset 00e23971f01b (bug 1813481) for causing xpcshell failures at test_css-properties-db.js CLOSED TREE 2023-03-15 11:19:59 +02:00
Tiaan Louw
362d632d19 Bug 1813481 - Allow 'none' keyword in color components r=emilio,supply-chain-reviewers
Make use of the new changes in the cssparser that allows 'none' keywords
in color components where allowed.  We store the none values as 0.0 (as
per the spec) and mark the components with the flags. This way we don't
have to check anything on the components before doing calculations.

As this is the last part intended to be released for the new [color-4]
changes, I've also enabled the changes on nightly.

Differential Revision: https://phabricator.services.mozilla.com/D170208
2023-03-15 08:15:54 +00:00
Zach Hoffman
aa003f1048 Bug 1818151 - Record attribute dependencies within the selector list of :nth-child(... of <selector list>) r=emilio
There are separate filters for IDs, classes, attribute local names, and
element state.

Also, we invalidate siblings of elements matched against the selector
list of :nth-child(... of <selector list>) by marking matched elements
with NODE_HAS_SLOW_SELECTOR_NTH_OF.

The only remaining invalidation case invalidation case is
`:nth-child(An+B of :has())` (bug 1818155), which should not block
shipping `layout.css.nth-child-of.enabled`, because :has(...) is still
being implemented (bug 418039).

Depends on D172352

Differential Revision: https://phabricator.services.mozilla.com/D171936
2023-03-15 06:56:21 +00:00
Zach Hoffman
7b1266f0fe Bug 1480746 - Apply selector flags to the shadow root r=emilio
Because restyle events cannot be posted for non-element nodes like the
shadow root, a child's siblings are restyled directly if its parent has
NODE_HAS_SLOW_SELECTOR or NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS but that
parent is the shadow root.

Drive-by, but braces were also added to some single-line "if" statements
in RestyleManager.

Differential Revision: https://phabricator.services.mozilla.com/D172352
2023-03-14 21:23:05 +00:00
Emilio Cobos Álvarez
3bbeaf0241 Bug 1684958 - Support rendering content: <gradient> images. r=dholbert,devtools-reviewers
We implemented support for list-style-image anyways.

Differential Revision: https://phabricator.services.mozilla.com/D172343
2023-03-14 12:11:34 +00:00
CanadaHonk
78363430df Bug 1736914 - Implement prefers-reduced-transparency media query r=geckoview-reviewers,emilio,jonalmeida,ohall
Implemented the prefers-reduced-transparency media query for all
platforms.

Windows and Mac have specific settings which are used, others (Android
and Linux/GTK) have it enabled if prefers-reduced-motion is also enabled
as there is no dedicated setting to check.

Locked behind new pref `layout.css.prefers-reduced-transparency.enabled`,
off by default always for now.

Also added new WPT tests (none previously).

Demo video: https://goose.icu/firefox_prt.mp4
Test page: https://goose.icu/prefers-reduced-transparency

Differential Revision: https://phabricator.services.mozilla.com/D172424
2023-03-13 21:30:17 +00:00
Emilio Cobos Álvarez
335d983188 Bug 1821514 - Simplify/remove a couple other length operations. r=CanadaHonk
Differential Revision: https://phabricator.services.mozilla.com/D172430
2023-03-13 17:49:58 +00:00
Emilio Cobos Álvarez
54346d9dd8 Bug 1821514 - Fix a couple minor issues with the previous patch. r=CanadaHonk
Having unused imports and undocumented functions trigger warnings that
don't build in automation.

Differential Revision: https://phabricator.services.mozilla.com/D172429
2023-03-13 17:49:57 +00:00
CanadaHonk
c481195d60 Bug 1821514 - Serialize NaN and infinity lengths r=emilio
Lengths using NaN and infinity are now serialized properly with some
improvements to computed values as well.

Also added a few minor new relevant WPT tests.
35 WPT tests newly pass 🎉

Differential Revision: https://phabricator.services.mozilla.com/D172183
2023-03-13 17:49:57 +00:00
CanadaHonk
f54c323397 Bug 1821532 - Infinity angles should degenerate compute to 0 r=layout-reviewers,emilio
Also adjusted WPT tests to always expect deg like similar past changes.

WPT tests: https://github.com/web-platform-tests/wpt/blob/master/css/css-values/calc-infinity-nan-computed.html#L57-L71

Differential Revision: https://phabricator.services.mozilla.com/D172401
2023-03-13 11:38:45 +00:00
Emilio Cobos Álvarez
e63d3f08f0 Bug 1821782 - Rustfmt recent changes to calc.rs. r=CanadaHonk
Differential Revision: https://phabricator.services.mozilla.com/D172339
2023-03-13 11:33:23 +00:00
Emilio Cobos Álvarez
cb5b7ab5ea Bug 1821782 - Add resolution support to calc(). r=CanadaHonk
Differential Revision: https://phabricator.services.mozilla.com/D172338
2023-03-13 11:33:22 +00:00
Emilio Cobos Álvarez
5317a7a5c1 Bug 1820661 - Make image-set without valid images render nothing. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D172341
2023-03-13 11:22:06 +00:00
Boris Chiou
de7d9b2274 Bug 1489392 - Part 1: Re-define CoordPair struct. r=emilio
Redefine/Rename the fields in CoordPair to align the data members of gfx::Point.

Differential Revision: https://phabricator.services.mozilla.com/D5903
2023-03-10 19:19:28 +00:00
Ziran Sun
caa78efc0f Bug 1820544 - Add popover attribute and part of basic popover functionality. r=emilio
Starts to add part of the basic functionality for popover. Including
[1] :open & :closed CSS pseudo class
[2] showPopover(), hidePopover() and togglePopover() interfaces. Much of the
functionality is still to-do.
[3] PopoverData interface

Differential Revision: https://phabricator.services.mozilla.com/D171719
2023-03-10 10:52:20 +00:00
CanadaHonk
869fa0e0f7 Bug 1820875 - Parse and serialize NaN and infinity times correctly r=emilio
Times like NaN and infinity are now parsed and serialized correctly.

Rewrote time to use `calc_clamping_mode` instead of `was_calc` to
stop some parse-time clamping which broke these values.

Adjusted WPT test expectations, 19 newly pass 🎉

Also added a new WPT test to cover a missing edge case:
`calc(1<unit> * NaN)` -> `calc(NaN * 1<canonical_unit>)`

The very similar angle tests do this already for angle's units.

Differential Revision: https://phabricator.services.mozilla.com/D171911
2023-03-08 15:04:13 +00:00
Boris Chiou
991c63b78c Bug 1814786 - Part 6: Create timeline objects when mutating scroll-timeline property. r=emilio
And so we can lookup the timeline from TimelineCollection.

Differential Revision: https://phabricator.services.mozilla.com/D169273
2023-03-07 23:57:55 +00:00
Emilio Cobos Álvarez
daefa22bbe Bug 1820280 - Be consistent for which URIs we expose chrome rules. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D171640
2023-03-07 20:22:23 +00:00
David Shin
cb015ecc18 Bug 1774588 - Parsing for relative selectors in :has(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171358
2023-03-07 18:04:27 +00:00
Tiaan Louw
aff0f1c4d5 Bug 1817641 - Convert RGBA to AbsoluteColor for computed/animated/resolved CSS colors r=emilio
Computed color values will not be in the correct format, closer to the
one specified by the author.  This also means that colors accross the
code are stored now as AbsoluteColor or StyleAbsoluteColor.  This allows
color space/gamut information to be available for use.

Some animation related test failures had to be changed, because colors
now has greater precision.  Animated a color now causes a lot more
animation updates, which was not initially expected.  See the bug for
discussion.

Differential Revision: https://phabricator.services.mozilla.com/D171021
2023-03-07 11:28:15 +00:00
CanadaHonk
8e0478485b Bug 1820407 - Serialize NaN and infinity angles as per spec r=emilio
`NaN`, `infinity`, and `-infinity` angles should be specially serialized.

Also fixed a few relevant WPT tests which did not follow spec.
(see https://github.com/web-platform-tests/wpt/pull/38825)

Adjusted WPT test expectations, 40 newly pass 🎉

Differential Revision: https://phabricator.services.mozilla.com/D171658
2023-03-07 00:02:55 +00:00
Boris Chiou
52cc7a2f77 Bug 1820071 - Make <ray-size> optional and default to 'closest-side'. r=emilio
Per the spec update, the new syntax is:
  `ray() = ray( <angle> && <ray-size>? && contain? )`
And for `<ray-size>`:
  "If no <ray-size> is specified it defaults to closest-side."

So `<ray-size>` is optional and we omit it if it's default value, for
serialization.

By the way, offset=* properties are supported only in Gecko, so we don't
need a servo function to check the preference.

Differential Revision: https://phabricator.services.mozilla.com/D171625
2023-03-07 00:02:52 +00:00
Emilio Cobos Álvarez
b80794e327 Bug 1819936 - Move legacy -moz-box collapse to its own CSS property. r=jwatt
Make display: -moz-box's visibility: collapse handling switchable by its
own CSS property.

Longer term maybe we should switch the front-end away from visibility:
collapse altogether (there are some alternatives), but for now this will
allow to move the front-end to switch to modern `display: flex` while
keeping `visibility: collapse` work as in -moz-box.

Differential Revision: https://phabricator.services.mozilla.com/D171472
2023-03-06 11:14:40 +00:00
Em Zhan
b7ef115e86 Bug 1814469 - Implement CSS exponential functions. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D170842
2023-03-05 10:42:36 +00:00
Boris Chiou
da64504f11 Bug 1818666 - Support offset-position in the style system. r=emilio
Also, we make it animatable but don't apply it to the motion transform and
don't run it on the compositor for now (so it works for getComputedStyle but
doesn't have rendering result).

Per spec: https://w3c.github.io/csswg-drafts/css-values/#calc-serialize,
we tweak the WPT to let calc() serialize the percentage first, and maintain
zero-valued terms, i.e. 0%. (We are doing the same thing as
offset-anchor, so it should be fine with other browsers.)

Besides, I tweak the serialization of shorthand a little bit so we match
the implementation of WebKit.

Differential Revision: https://phabricator.services.mozilla.com/D170972
2023-03-03 23:10:34 +00:00
Emilio Cobos Álvarez
21dd8714cd Bug 1695565 - Fix appearance-cssom-001.html. r=boris
* Remove some legacy appearance aliases that other engines don't
   implement.

 * Allow to pass with unimplemented <compat-auto> values, since per the
   spec the idea of these is to get them removed, see
   https://github.com/w3c/csswg-drafts/issues/8506 for the ones we don't
   implement.

 * Also allow the `-moz-` prefix to be implemented, because we can't
   quite get rid of it (people use it to remove the <input type=number>
   buttons with -moz-appearance: textfield and so on), and the
   alternative is to implement a bunch of non-standard ::-webkit-
   pseudo-elements.

Differential Revision: https://phabricator.services.mozilla.com/D171243
2023-03-01 14:43:57 +00:00
Norisz Fay
9bdd808399 Backed out changeset 2f565aff38fd (bug 1695565) for causing reftest failures on setsize.xhtml CLOSED TREE 2023-03-01 15:41:35 +02:00
Emilio Cobos Álvarez
7483930684 Bug 1695565 - Fix appearance-cssom-001.html. r=boris
* Remove some legacy appearance aliases that other engines don't
   implement.

 * Allow to pass with unimplemented <compat-auto> values, since per the
   spec the idea of these is to get them removed, see
   https://github.com/w3c/csswg-drafts/issues/8506 for the ones we don't
   implement.

 * Also allow the `-moz-` prefix to be implemented, because we can't
   quite get rid of it (people use it to remove the <input type=number>
   buttons with -moz-appearance: textfield and so on), and the
   alternative is to implement a bunch of non-standard ::-webkit-
   pseudo-elements.

Differential Revision: https://phabricator.services.mozilla.com/D171243
2023-03-01 12:16:01 +00:00
Marian-Vasile Laza
97b68f76d8 Backed out changeset fa7252da2862 (bug 1695565) for xpcshell failures on test_css-properties-db.js. CLOSED TREE 2023-03-01 02:55:50 +02:00
Emilio Cobos Álvarez
f5eb9d67be Bug 1695565 - Fix appearance-cssom-001.html. r=boris
* Remove some legacy appearance aliases that other engines don't
   implement.

 * Allow to pass with unimplemented <compat-auto> values, since per the
   spec the idea of these is to get them removed, see
   https://github.com/w3c/csswg-drafts/issues/8506 for the ones we don't
   implement.

 * Also allow the `-moz-` prefix to be implemented, because we can't
   quite get rid of it (people use it to remove the <input type=number>
   buttons with -moz-appearance: textfield and so on), and the
   alternative is to implement a bunch of non-standard ::-webkit-
   pseudo-elements.

Differential Revision: https://phabricator.services.mozilla.com/D171243
2023-02-28 23:47:45 +00:00
Emilio Cobos Álvarez
9874d53288 Bug 1818811 - Make -moz-box-layout: flex default, and clean-up CSS. r=Gijs,extension-reviewers,settings-reviewers,desktop-theme-reviewers,dao
Now it's on by default everywhere, so all this is not needed. No behavior
change effectively since the xul.css bits being removed effectively achieve the
same.

Differential Revision: https://phabricator.services.mozilla.com/D170944
2023-02-27 12:41:13 +00:00
Tiaan Louw
fc4e8e8161 Bug 1813481 - Use abstract color parser r=emilio,supply-chain-reviewers
In stead of having the css parser construct a color in it's own format
and then converting it to what Gecko needs to perform operations, we now
construct a Gecko friendly color type directly.

Differential Revision: https://phabricator.services.mozilla.com/D170187
2023-02-26 11:11:21 +00:00
Emilio Cobos Álvarez
8cd04b7407 Bug 1818329 - Don't reject negative resolutions either. r=layout-reviewers,jfkthame
This unveils an issue with image-set() tests, which expect 0x to not
parse (inconsistently with media queries).

Fix the test, since the spec doesn't restrict the range of <resolution>
values (and more importantly, it shouldn't allow open ranges).

Differential Revision: https://phabricator.services.mozilla.com/D170762
2023-02-26 00:15:25 +00:00
Emilio Cobos Álvarez
bfb3b312ba Bug 1818329 - Don't reject negative values at parse time in media features. r=dshin
Clean-up some other test expectations while at it.

Differential Revision: https://phabricator.services.mozilla.com/D170677
2023-02-26 00:15:24 +00:00
CanadaHonk
c1b358a79b Bug 1818598 - Fix parsing nested image-set funcs as valid r=layout-reviewers,emilio
Nested image-set CSS functions should fail to parse as per spec.

WPT tests (2 newly pass):
a2154e3f97/css/css-images/image-set/image-set-parsing.html (L223-L239)

Differential Revision: https://phabricator.services.mozilla.com/D170829
2023-02-25 23:53:02 +00:00
Stanca Serban
3516584dcc Backed out 2 changesets (bug 1818329) for causing wpt failures in image-set-parsing.html. CLOSED TREE
Backed out changeset 01c1a2d4f4fd (bug 1818329)
Backed out changeset 6c3a6a328d47 (bug 1818329)
2023-02-26 01:34:12 +02:00
Cosmin Sabou
6f5278eeda Backed out changeset a154633506f0 (bug 1818598) for causing mochitest plain failures. CLOSED TREE 2023-02-25 23:27:46 +02:00
CanadaHonk
5431f96fcf Bug 1818598 - Fix parsing nested image-set funcs as valid r=layout-reviewers,emilio
Nested image-set CSS functions should fail to parse as per spec.

WPT tests (2 newly pass):
a2154e3f97/css/css-images/image-set/image-set-parsing.html (L223-L239)

Differential Revision: https://phabricator.services.mozilla.com/D170829
2023-02-25 20:13:58 +00:00
Emilio Cobos Álvarez
413944db19 Bug 1818329 - Don't reject negative resolutions either. r=layout-reviewers,jfkthame
This unveils an issue with image-set() tests, which expect 0x to not
parse (inconsistently with media queries).

Fix the test, since the spec doesn't restrict the range of <resolution>
values (and more importantly, it shouldn't allow open ranges).

Differential Revision: https://phabricator.services.mozilla.com/D170762
2023-02-25 17:59:18 +00:00
Emilio Cobos Álvarez
b637eeba9f Bug 1818329 - Don't reject negative values at parse time in media features. r=dshin
Clean-up some other test expectations while at it.

Differential Revision: https://phabricator.services.mozilla.com/D170677
2023-02-25 17:59:18 +00:00