Commit Graph

15702 Commits

Author SHA1 Message Date
David Shin
f76c001441 Bug 1923955: Part 3 - Add anchor-size() to math functions as CalcNode. r=firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D229038
2024-11-15 20:56:03 +00:00
David Shin
a2a193d47f Bug 1923955: Part 2 - Add AnchorSizeFunction to optional allowed function in math functions. r=firefox-style-system-reviewers,boris
Depends on D229036

Differential Revision: https://phabricator.services.mozilla.com/D229037
2024-11-15 20:56:03 +00:00
David Shin
cbc3526f69 Bug 1923955: Part 1 - Derive serde::{Serialize, Deserialize} for AnchorSizeFunction. r=firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D229036
2024-11-15 20:56:02 +00:00
Emilio Cobos Álvarez
5a9200b9f0 Bug 1930907 - Allow replacing transitions that are not running on the compositor. r=boris,birtles
This improves the behavior significantly. Transitions that are not
running on the compositor but are throttled on the main thread due to
being scrolled out of view have the same issue as compositor animations.

Differential Revision: https://phabricator.services.mozilla.com/D229026
2024-11-15 12:10:04 +00:00
Emilio Cobos Álvarez
d3e311ba9b Bug 1931285 - Simplify -moz-pre-space implementation. r=jfkthame
Make it an alias of the preserve-spaces value, and don't bother
serializing the shorthand to that value.

Update internal usages to the standard keyword.

Differential Revision: https://phabricator.services.mozilla.com/D228958
2024-11-14 11:13:21 +00:00
David Shin
2958d338de Bug 1931054: Don't crash if implicit scope cannot be found. r=firefox-style-system-reviewers,emilio
... This papers over bug 1930618, for now.

Differential Revision: https://phabricator.services.mozilla.com/D228905
2024-11-13 22:59:07 +00:00
Emily McDonough
3892dd3f3b Bug 1930789 Part 3 - Use boxed slices for ComputedKeyframes and animations rather than Vecs r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D228747
2024-11-13 22:48:39 +00:00
Emily McDonough
f1488436fa Bug 1930789 Part 2 - Avoid collecting into a Vec and then converting to boxed slice in a couple places. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D228746
2024-11-13 22:48:38 +00:00
Emily McDonough
b3269d42b3 Bug 1930789 Part 1 - Use boxed slice in PrioritizedPropertyIter rather than a Vec. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D228745
2024-11-13 22:48:38 +00:00
David Shin
f2fffde56c Bug 1915021: Part 5 - Add anchor() to calc() as a function. r=jwatt,tlouw
Differential Revision: https://phabricator.services.mozilla.com/D228242
2024-11-13 19:25:43 +00:00
David Shin
4a2e4e245b Bug 1915021: Part 4 - Plumbing work for parsing anchor() function in calc(). r=jwatt,tlouw
Differential Revision: https://phabricator.services.mozilla.com/D228241
2024-11-13 19:25:43 +00:00
David Shin
9969af8646 Bug 1915021: Part 3 - Take anchor() out of CalcUnits. r=jwatt,tlouw
We want to conditionally parse `anchor()`, but:

1. It's not really a unit.
2. When interleaving gets implemented, we'd treat it just line `<length-percentage>`,
   but still need the conditional parsing.

Differential Revision: https://phabricator.services.mozilla.com/D228551
2024-11-13 19:25:42 +00:00
David Shin
875e74700d Bug 1915021: Part 2 - Derive serde::{Serialize, Deserialize} for AnchorFunction. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D228240
2024-11-13 19:25:42 +00:00
David Shin
33b28d4e84 Bug 1915021: Part 1 - Remove direct dependency from LengthPercentage to CalcLengthPercentage. r=firefox-style-system-reviewers,emilio
32-bit build does this, and causes a circular dependency when `anchor()` is
added. Since its fallback is `<length-percentage>`, there'd be a circular
dependency.

Differential Revision: https://phabricator.services.mozilla.com/D227499
2024-11-13 19:25:41 +00:00
Zach Hoffman
f54303f308 Bug 1922870 - Add CSS error for missing @property inherits descriptor. r=dshin
The CSS error for an invalid @property inherits descriptor is also
improved.

Differential Revision: https://phabricator.services.mozilla.com/D224622
2024-11-12 05:12:52 +00:00
Zach Hoffman
7089ea0363 Bug 1922871 - Add CSS error for missing @property syntax descriptor. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D224621
2024-11-12 02:38:38 +00:00
Zach Hoffman
e5ef019f0c Bug 1926969 - Rename allows_font_relative_lengths to allows_computational_dependence r=firefox-style-system-reviewers,emilio
Bug 1926969 introduces a new example of computational dependence:
Color-scheme dependent colors like `light-dark()` and system colors. So
specific references to lengths, like `allows_font_relative_lengths`,
should be generalized.

This patch also renames `ParsingMode::DISALLOW_FONT_RELATIVE` to
`ParsingMode::DISALLOW_COMPUTATIONALLY_DEPENDENT`.

ParserContext::allows_computational_dependence is added for convenience.

Differential Revision: https://phabricator.services.mozilla.com/D226868
2024-11-12 01:04:47 +00:00
Connor Pearson
ec91dc7f26 Bug 1841456 - Part 1: Use auto instead of top in -moz-top-layer to match overlay. r=emilio,desktop-theme-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D228525
2024-11-09 15:41:25 +00:00
Emilio Cobos Álvarez
f8130d30ed Bug 1905904 - Always preserve collapsible spaces in text controls. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D228129
2024-11-07 10:23:13 +00:00
Martin Robinson
fb1e393b2c Bug 1928330 - Upstream changes to CSS property definitions from Servo r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D227465
2024-11-01 11:14:07 +00:00
Emilio Cobos Álvarez
94b8102a07 Bug 1927138 - Fix selector enabled check to be enabled in content.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2024-10-27 11:31:12 +01:00
Emilio Cobos Álvarez
0ec8679a90 Bug 1927138 - Remove popover prefs. r=webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D226956
2024-10-27 08:47:00 +00:00
Zach Hoffman
b0ad73a90d Bug 1926164 - Negate in_negation when nesting r=dshin,jwatt
`in_negation` was `true` in cases where it should be `false`, like
`:not(:not(...))`.

Differential Revision: https://phabricator.services.mozilla.com/D226582
2024-10-25 15:57:03 +00:00
Emilio Cobos Álvarez
c76b2e267d Bug 1926269 - Changes to allow publishing selectors. r=supply-chain-reviewers
to_shmem and to_shmem_derive need a description, and selectors needs a
version bump.

Tweak supply-chain audits / config to deal with now published crates.

Differential Revision: https://phabricator.services.mozilla.com/D226468
2024-10-23 19:54:49 +00:00
Emilio Cobos Álvarez
9332593cd5 Bug 1926423 - Use faster and order-aware custom property comparison. r=jwatt
When I rewrote this code in bug 1874050, the assumption was that doing
the right thing was fine because we were more likely to take the fast
path for the owned properties (the parent_ptr_eq()).

But given this shows up in profiles, let's do the order-aware comparison
(which might return false in some cases where it doesn't need to, but
seems to be a better trade-off with tons of custom properties).

Differential Revision: https://phabricator.services.mozilla.com/D226612
2024-10-23 12:56:43 +00:00
Oriol Brufau
0a2aac0f74 Bug 1925885 - Import Stylo color changes from Servo. r=emilio
No change in behavior for Gecko.

Differential Revision: https://phabricator.services.mozilla.com/D226265
2024-10-21 10:12:32 +00:00
Oriol Brufau
8c6ea88121 Bug 1925947 - Fix wrong documentation saying that MaxSize is for min-height. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D226292
2024-10-21 10:11:03 +00:00
Emilio Cobos Álvarez
9bcfcdda97 Bug 1925551 - Better validate relative color components. r=tlouw,firefox-style-system-reviewers,layout-reviewers
This is simpler and fixes the remaining parsing issues.

Differential Revision: https://phabricator.services.mozilla.com/D226160
2024-10-18 19:28:12 +00:00
Tiaan Louw
23fd208d8f Bug 1924363 - Eagerly resolve sum nodes during parsing r=layout-reviewers,emilio
Product nodes are eagerly resolved during parse time, but sum nodes are
not. This might cause floating point inprecision in sum nodes, which
leads to invalid calculations, e.g. `round(down, (7 - 1) / 3, 1)` would
end up being `round(down, (2.3333333 - 0.33333334), 1)`, then
`round(down, 1.99999996, 1)`, which equals `1`, which is incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D225936
2024-10-17 10:09:01 +00:00
Tiaan Louw
fbd6dd0fce Bug 1920496 - Make ColorFunction be stored in ComputedStyle r=emilio
We now fully support the full ColorFunction in the ComputedStyle struct
in layout.  This solves an issue where colors are copied on the C++
side.

Some structs had to be renamed to avoid name collisions in the generates
C++ code.

Some specified structs has the #[repr(C)] attribute now to include them
in the ComputedStyle struct.  This is not really correct as they are
specified values and only computed values should be there. Splitting all
the unit structs into specified and computed is a lot of changes so
there is a follow up bug here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1924483

Differential Revision: https://phabricator.services.mozilla.com/D225080
2024-10-16 13:45:19 +00:00
Tiaan Louw
96526acd5c Bug 1920496 - Store ColorFunction inside a computed color r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D223136
2024-10-16 13:45:19 +00:00
Tiaan Louw
b729238b4a Bug 1920496 - Track omitted alpha values for relative colors. r=layout-reviewers,emilio
When an alpha component is omitted, instead of defaulting to opaque,
colors with an origin color used the alpha from there.

Differential Revision: https://phabricator.services.mozilla.com/D223134
2024-10-16 13:45:18 +00:00
Tiaan Louw
b74ee1215c Bug 1885912 - rgb() origin color must be in rgb() format. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D223133
2024-10-16 13:45:18 +00:00
Tiaan Louw
51a68a20d7 Bug 1885912 - Store a ColorFunction in a specified Color. r=layout-reviewers,emilio
When we have a color that can't be resolved at parse time (or should not
be resolved) then we store the data that was parsed as is to preserve
all the data for round tripping.

Differential Revision: https://phabricator.services.mozilla.com/D220268
2024-10-16 13:45:17 +00:00
Tiaan Louw
380f90df2c Bug 1914907 - Rustify NumberOr* enums r=layout-reviewers,emilio
More ergonomic to work with and not so verbose.

Differential Revision: https://phabricator.services.mozilla.com/D220267
2024-10-16 13:45:17 +00:00
Tiaan Louw
15796784ae Bug 1914907 - Store CalcNode inside a color component. r=layout-reviewers,emilio
Color components can now preserve parsed data, including calc nodes, if
required.

Some of the computed color tests fail, because we don't have the origin
color readily available to determine which color format to use. (e.g.
color instead of rgb). Fixes are in a follow up patch: D220268

Differential Revision: https://phabricator.services.mozilla.com/D220124
2024-10-16 13:45:16 +00:00
Tiaan Louw
b8c2583ebb Bug 1924679 - Sort factors of a product node during simplication r=layout-reviewers,jfkthame
When we simplify a product node, sort the factors according to the spec.

https://drafts.csswg.org/css-values/#calc-serialize

Some tests that assume the factors stay in the declared order is fixed.

Differential Revision: https://phabricator.services.mozilla.com/D225626
2024-10-15 10:55:17 +00:00
Emilio Cobos Álvarez
e639e38d33 Bug 1764822 - Implement mica titlebar behind a (default off) pref. r=desktop-theme-reviewers,win-reviewers,dao,rkraesig
This is somewhat straight-forward now that all the dependencies are
landed.

I think we do need to find a solution to make the app titlebar buttons
taller, by hiding the caption buttons
(https://phabricator.services.mozilla.com/D207303 tried to do this, but
ran into other issues), or making the titlebar taller, which is doable
in UWP at least, but I don't see any way of doing it in win32 apps:

 * https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.appwindowtitlebar.preferredheightoption?view=windows-app-sdk-1.6

But still this is usable and would be worth getting in, since it's
needed for the translucent sidebar work too.

Differential Revision: https://phabricator.services.mozilla.com/D225364
2024-10-14 14:38:04 +00:00
keithamus
09e8867c25 Bug 1921747 - Implement :has-slotted pseudo r=emilio
https://drafts.csswg.org/css-scoping-1/#the-has-slotted-pseudo

Differential Revision: https://phabricator.services.mozilla.com/D224227
2024-10-11 23:49:01 +00:00
Emilio Cobos Álvarez
1dd2669fbd Bug 1922900 - container-type should stablish a BFC, but not layout containment. r=layout-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D224764
2024-10-08 06:49:14 +00:00
Boris Chiou
9f7a17cdd4 Bug 1922339 - Add the error handling if the effective zoom is close to zero. r=layout-reviewers,firefox-style-system-reviewers,emilio
The zoom factor is stored as a fixed point number, and the effective zoom may
be close to 0 (because we have to mulitply the zoom values of ancestors).

So we have to make sure we don't divide by zero because the effective zoom
could be zero.

Differential Revision: https://phabricator.services.mozilla.com/D224551
2024-10-07 19:43:16 +00:00
Jonathan Kew
7dd0f0c042 Bug 1884118 - Make letter-spacing accept <length-percentage>, not just <length>. r=dshin
As per https://drafts.csswg.org/css-text-4/#letter-spacing-property.

Differential Revision: https://phabricator.services.mozilla.com/D224747
2024-10-07 15:54:23 +00:00
Emilio Cobos Álvarez
15888fef5b Bug 1923089 - Deal with non-prefixed variants in derive(Parse). r=jfkthame
This makes #[derive(Parse)] work on a unit struct, which is useful for
bug 1884118.

Differential Revision: https://phabricator.services.mozilla.com/D224758
2024-10-07 12:54:14 +00:00
Nico Burns
cd708dce14 Bug 1920524: Set stylo repository links to https://github.com/servo/stylo (r=emilio)
Differential Revision: https://phabricator.services.mozilla.com/D224479
2024-10-04 20:09:44 +00:00
Emilio Cobos Álvarez
4f1b4c38f6 Bug 1922351 - Move ffi serde serialization from Servo into somewhere usable by other crates in the tree. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D224394
2024-10-04 07:51:46 +00:00
Emilio Cobos Álvarez
84f66bad1c Bug 1921505 - Allow setting selectorText to a relative selector, if nested. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D223988
2024-09-27 18:54:08 +00:00
Emilio Cobos Álvarez
a6bd05ded7 Bug 1917331 - Fix debug_assert triggered by a wpt on android.
MANUAL PUSH: trivial fix CLOSED TREE
2024-09-26 18:47:14 -07:00
Emilio Cobos Álvarez
e24d5d2784 Bug 1917331 - Keep parsed value when uncomputing for animations. r=boris,firefox-style-system-reviewers
I think this is a bit more consistent, and makes us preserve the
invariant that from_computed_value().to_computed_value() round-trips.

Differential Revision: https://phabricator.services.mozilla.com/D223878
2024-09-26 23:57:13 +00:00
Cristina Horotan
0e05920f93 Backed out 2 changesets (bug 1917602) on request by emilio. CLOSED TREE
Backed out changeset d5d237db3e73 (bug 1917602)
Backed out changeset f3cc65f111ef (bug 1917602)
2024-09-26 13:48:33 +03:00
Emilio Cobos Álvarez
fe1d67cc92 Bug 1921049 - Remove some bindgen includes. r=firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D223615
2024-09-25 17:43:28 +00:00