Commit graph

47442 commits

Author SHA1 Message Date
Tiaan Louw
241e6e256f style: Refactor mul_by fn into map fn
Refactor the mul_by function on leafs into a more generic map function
that can be used for more operations like abs, signum and mul.

Differential Revision: https://phabricator.services.mozilla.com/D172936
2023-11-21 15:36:35 +01:00
Boris Chiou
a5f696b90d style: Use auto as the initial value for view-timeline-inset
Per the proposal in https://github.com/w3c/csswg-drafts/issues/7747,
we change view-timeline-inset to have an initial value of auto.

Differential Revision: https://phabricator.services.mozilla.com/D173487
2023-11-21 15:36:35 +01:00
Cathie Chen
6db3b1158c style: Update UA stylesheet for popover
Differential Revision: https://phabricator.services.mozilla.com/D172700
2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
4d62fec376 style: Reuse declaration block with SVG presentation attributes
Ideally we'd only update the attributes that actually changed. That's a
bit more work I can try to look into, but this and bug 1823686 should
improve things here.

Differential Revision: https://phabricator.services.mozilla.com/D173162
2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
7d12331626 style: Optimize [id=foo] as #foo in querySelector/All
This page seems to rely on this optimization being present. Optimizing
it is straight-forward. Why do they do that instead of using the #foo
syntax? Who knows.

Differential Revision: https://phabricator.services.mozilla.com/D173148
2023-11-21 15:36:35 +01:00
Zach Hoffman
536b3d603b style: Check that the lowercase attribute is different before trying to track it
Differential Revision: https://phabricator.services.mozilla.com/D173112
2023-11-21 15:36:35 +01:00
Oriol Brufau
4804e8dd94 Further changes required by Servo 2023-11-21 15:36:35 +01:00
Tiaan Louw
f3402e6144 style: Color interpolation takes none keyword into account
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-11-21 15:36:35 +01:00
Oriol Brufau
11414d0c94 Further changes required by Servo 2023-11-21 15:36:35 +01:00
Tiaan Louw
fb4501c5b4 style: Allow 'none' keyword in color components
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-11-21 15:36:35 +01:00
David Shin
3756e3b027 style: :has relative selector matching, with no caching/filtering
Differential Revision: https://phabricator.services.mozilla.com/D172019
2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
a68766197f style: Add (unused for now) parsing for support conditions in @import
You can use this as:

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

Or so.

Differential Revision: https://phabricator.services.mozilla.com/D172668
2023-11-21 15:36:35 +01:00
Oriol Brufau
3914ff627e Further changes required by Servo 2023-11-21 15:36:35 +01:00
Zach Hoffman
356e886d26 style: Record attribute dependencies within the selector list of :nth-child(... of <selector list>)
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-11-21 15:36:35 +01:00
Oriol Brufau
c7f8845665 Further changes required by Servo 2023-11-21 15:36:35 +01:00
Zach Hoffman
744b21e72a style: Apply selector flags to the shadow root
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-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
11a04d9d93 style: Support rendering content: <gradient> images
We implemented support for list-style-image anyways.

Differential Revision: https://phabricator.services.mozilla.com/D172343
2023-11-21 15:36:35 +01:00
CanadaHonk
0e5eca1f00 style: Implement prefers-reduced-transparency media query
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-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
9509f84bc0 style: Simplify/remove a couple other length operations
Differential Revision: https://phabricator.services.mozilla.com/D172430
2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
52f1a680d5 style: Fix a couple minor issues with the previous patch
Having unused imports and undocumented functions trigger warnings that
don't build in automation.

Differential Revision: https://phabricator.services.mozilla.com/D172429
2023-11-21 15:36:35 +01:00
CanadaHonk
571f8a8dd5 style: Serialize NaN and infinity lengths
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-11-21 15:36:35 +01:00
CanadaHonk
2dad1f0fd7 style: Infinity angles should degenerate compute to 0
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-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
23d6ecfc57 style: Rustfmt recent changes to calc.rs
Differential Revision: https://phabricator.services.mozilla.com/D172339
2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
2c986f0005 style: Add resolution support to calc()
Differential Revision: https://phabricator.services.mozilla.com/D172338
2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
76e8eeda72 style: Make image-set without valid images render nothing
Differential Revision: https://phabricator.services.mozilla.com/D172341
2023-11-21 15:36:35 +01:00
Boris Chiou
29105eeb49 style: Re-define CoordPair struct
Redefine/Rename the fields in CoordPair to align the data members of gfx::Point.

Differential Revision: https://phabricator.services.mozilla.com/D5903
2023-11-21 15:36:35 +01:00
Ziran Sun
29a9f0da46 style: Add popover attribute and part of basic popover functionality
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-11-21 15:36:35 +01:00
CanadaHonk
3ded7ff273 style: Parse and serialize NaN and infinity times correctly
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-11-21 15:36:35 +01:00
Oriol Brufau
9a6b46aebd Further changes required by Servo 2023-11-21 15:36:35 +01:00
Boris Chiou
3390b77281 style: Create timeline objects when mutating scroll-timeline property
And so we can lookup the timeline from TimelineCollection.

Differential Revision: https://phabricator.services.mozilla.com/D169273
2023-11-21 15:36:35 +01:00
Oriol Brufau
532d769e27 Further changes required by Servo 2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
cfb7a9a108 style: Be consistent for which URIs we expose chrome rules
Differential Revision: https://phabricator.services.mozilla.com/D171640
2023-11-21 15:36:35 +01:00
Oriol Brufau
664e44385e Further changes required by Servo 2023-11-21 15:36:35 +01:00
David Shin
f7b29ac432 style: Parsing for relative selectors in :has()
Differential Revision: https://phabricator.services.mozilla.com/D171358
2023-11-21 15:36:35 +01:00
Oriol Brufau
b6db94bdf5 Further changes required by Servo 2023-11-21 15:36:35 +01:00
Tiaan Louw
8c1c4073e2 style: Convert RGBA to AbsoluteColor for computed/animated/resolved CSS colors
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-11-21 15:36:35 +01:00
Sylvestre Ledru
3763d9a6cc style: Fix clippy warnings
Depends on D96634

Differential Revision: https://phabricator.services.mozilla.com/D96636
2023-11-21 15:36:35 +01:00
Martin Robinson
35b4641bf9
Add a concurrency group to try jobs (#30756)
This should prevent multiple `parse-comment` jobs from running at the
same time for the same pull request, reducing the number of duplicate
builds when multiple labels are applied.
2023-11-21 08:40:27 +00:00
dependabot[bot]
76569daa62
build(deps): bump uuid from 1.5.0 to 1.6.1 (#30759)
Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.5.0 to 1.6.1.
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/1.5.0...1.6.1)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-21 06:47:08 +00:00
dependabot[bot]
ec4ff3b690
build(deps): bump rustix from 0.38.24 to 0.38.25 (#30761)
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.24 to 0.38.25.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.24...v0.38.25)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-20 16:51:06 +00:00
Oriol Brufau
61af8fb56d
Enable new color functions from CSS Color 4 (#30752)
I will need to do most of the work anyways during the style updates,
so by enabling this it will be easier to detect mistakes.

Also, canvas colors are now parsed as <color>, precisely to support
these new features. This is according to the HTML spec:
https://html.spec.whatwg.org/multipage/infrastructure.html#parsed-as-a-css-color-value
2023-11-20 16:15:43 +00:00
Samson
868d84d8ee
Retry smoketest on mac (#30716) 2023-11-20 15:50:34 +00:00
Oriol Brufau
3543a87592
Allow currentColor in canvas context's shadowColor (#30754)
This allows unifying the parse_color function and method, aligns Servo
with other browsers, and obeys the HTML spec:
 - https://html.spec.whatwg.org/multipage/canvas.html#shadows
 - https://html.spec.whatwg.org/multipage/infrastructure.html#parsed-as-a-css-color-value
2023-11-20 11:03:18 +00:00
Servo WPT Sync
334c67a3cc
Update web-platform-tests to revision b'7aaad11d87d7a02515081e55609d31ab6ff173fc' (#30753) 2023-11-19 09:40:18 +00:00
dependabot[bot]
7086dd8f48
build(deps): bump rustls from 0.21.8 to 0.21.9 (#30747)
Bumps [rustls](https://github.com/rustls/rustls) from 0.21.8 to 0.21.9.
- [Release notes](https://github.com/rustls/rustls/releases)
- [Commits](https://github.com/rustls/rustls/compare/v/0.21.8...v/0.21.9)

---
updated-dependencies:
- dependency-name: rustls
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-17 16:55:35 +00:00
dependabot[bot]
7c8ac54404
build(deps): bump etagere from 0.2.9 to 0.2.10 (#30746)
Bumps [etagere](https://github.com/nical/etagere) from 0.2.9 to 0.2.10.
- [Commits](https://github.com/nical/etagere/commits)

---
updated-dependencies:
- dependency-name: etagere
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-17 16:44:27 +00:00
Martin Robinson
e83e7ded6e
Remove use of proc_macro_diagnostics feature (#30745)
This is only used to emit a single error, which can be done using `syn`.
Removing the use of this feature brings us close to being to able to
compile with stable rust.
2023-11-17 10:36:09 +00:00
Martin Robinson
8de4629a3c
Remove usage of drain_filter (#30742)
This is a step on the way toward supporting stable rust.
2023-11-17 10:28:33 +00:00
Martin Robinson
50732b49c5
Remove Servo window.trap() extension (#30743)
This Servo-specific extension is unused by any code in the repository
and removing it allows us to remove use of nightly only reliance on
rust intrinsics. This is a step toward supporting stable rust.
2023-11-17 07:43:26 +00:00
dependabot[bot]
378fdbe225
build(deps): bump errno from 0.3.6 to 0.3.7 (#30744)
Bumps [errno](https://github.com/lambda-fairy/rust-errno) from 0.3.6 to 0.3.7.
- [Changelog](https://github.com/lambda-fairy/rust-errno/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lambda-fairy/rust-errno/compare/v0.3.6...v0.3.7)

---
updated-dependencies:
- dependency-name: errno
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-16 17:00:53 +00:00