Commit Graph

15684 Commits

Author SHA1 Message Date
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
tannal
273c630f69 Bug 1917602 - Make CSS zoom property discrete animatable. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D223078
2024-09-25 15:58:26 +00:00
Stephen Thompson
363725f837 Bug 1920510 - Enable CSS display: contents in XUL r=emilio
XUL was opted out of support for the CSS display: contents rule due to lack of use, but there may be a valid use case for display: contents in the tab bar with the introduction of tab groups.

See Bug 1918686 for the tab groups use case.

Differential Revision: https://phabricator.services.mozilla.com/D223205
2024-09-24 15:38:56 +00:00
Emilio Cobos Álvarez
c787aab229 Bug 1920118 - Unship -moz-user-modify. r=dholbert
-moz-user-modify is a prefixed CSS property which does _almost_ nothing.

It has some effect on caret painting (as in, you could make a
contenteditable element not paint the caret), but there are better ways
of doing that (caret-color: transparent or so).

It is also documented to do nothing in MDN.

Given that, I plan to try to remove it. Only real risk is that someone
uses for feature detection or so, so I expect the risk to be pretty
minimal.

Differential Revision: https://phabricator.services.mozilla.com/D222984
2024-09-23 21:43:33 +00:00
David Shin
774f344edb Bug 1900232: Part 5 - Add anchor-size() to sizing properties. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D222534
2024-09-23 13:58:38 +00:00
David Shin
9619207abf Bug 1900232: Part 4 - Add anchor-size() to margin properties. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D222533
2024-09-23 13:58:38 +00:00
David Shin
8ab036bfd0 Bug 1900232: Part 3 - Add anchor-size() to inset properties. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D222532
2024-09-23 13:58:37 +00:00
David Shin
009b0ea079 Bug 1900232: Part 2 - Create one place to shim inset getters. r=firefox-style-system-reviewers,emilio
... Instead of handling `anchor()` function at each site manually.

Differential Revision: https://phabricator.services.mozilla.com/D222531
2024-09-23 13:58:37 +00:00
David Shin
068a8616c8 Bug 1900232: Part 1 - Add GenericAnchorSize() for anchor-size(). r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D222530
2024-09-23 13:58:37 +00:00
Emilio Cobos Álvarez
25185bca12 Bug 1920033 - Move inherited-ui properties out of mako. r=firefox-style-system-reviewers,zrhoffman
Having them in rust makes them easier to tweak (like change values, make
them conditional, or what not).

Differential Revision: https://phabricator.services.mozilla.com/D222931
2024-09-21 03:51:54 +00:00
Oriol Brufau
304187442e Bug 1918875 - Let LengthPercentage::maybe_to_used_value() accept Option<Au>. r=emilio
Given that `LengthPercentage::to_used_value()` accepts an `Au`, and
`NonNegativeLengthPercentage::maybe_to_used_value()` an `Option<Au>`,
it didn't make much sense for `LengthPercentage::maybe_to_used_value()`
to accept an `Option<Length>`.

All callers from Servo and Stylo have an `Option<Au>` that they needed
to convert into `Option<Length>` in order to call this function. Gecko
doesn't call it.

Differential Revision: https://phabricator.services.mozilla.com/D222210
2024-09-20 23:32:44 +00:00
Jonathan Kew
106268f97e Bug 1919658 - Add support for text-emphasis-position:auto. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D222855
2024-09-20 20:15:19 +00:00
Emilio Cobos Álvarez
4a5f0fcca1 Bug 1919853 - Make InspectorUtils able to return CSSNestedDeclarations too. r=devtools-reviewers,nchevobbe,dshin
Rename getCSSStyleRules now that it can return something else, and
change getCSSStyleRules_starting_style.html to cover this again.

Unfortunately the asserts in ServoStyleRuleMap.cpp no longer hold,
because the style attribute and other declarations are expected not to
show up there.

Differential Revision: https://phabricator.services.mozilla.com/D222856
2024-09-20 15:59:53 +00:00
Emilio Cobos Álvarez
ba4e92b748 Bug 1918408 - Implement the nested declarations rule. r=dshin,webidl,smaug
I didn't put this behind a pref because it was a bit annoying to do with
the parser changes while keeping it fast, and because, at least nesting
wise, this is unlikely to cause compat issues.

There are some complexities for @scope, which I think I got right.

Fixed the tests not to depend on @scope necessarily per the discussion
in https://github.com/web-platform-tests/interop/issues/697.

Differential Revision: https://phabricator.services.mozilla.com/D222817
2024-09-19 20:23:22 +00:00
Martin Robinson
5afc0ecf5b Bug 1919219 - Enable object-fit and object-position for Servo r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D222421
2024-09-19 15:22:32 +00:00
Emilio Cobos Álvarez
515b9a9fe8 Bug 1918093 - Fix build bustage.
MANUAL PUSH: Bustage fix CLOSED TREE
2024-09-19 15:55:51 +02:00
Nico Burns
eb0d17d956 Bug 1918093: Convert selectors to edition 2021 (r=emilio)
Signed-off-by: Nico Burns <nico@nicoburns.com>

Differential Revision: https://phabricator.services.mozilla.com/D221822
2024-09-19 13:06:59 +00:00
Nico Burns
7069645fda Bug 1918093: Add versions to selectors and to_shmem dependencies (r=emilio)
Signed-off-by: Nico Burns <nico@nicoburns.com>

Differential Revision: https://phabricator.services.mozilla.com/D221820
2024-09-19 13:06:58 +00:00
Nico Burns
1bedf9a3c5 Bug 1918093: Bump version numbers for servo_arc, to_shmem, selectors (r=emilio)
Signed-off-by: Nico Burns <nico@nicoburns.com>

Differential Revision: https://phabricator.services.mozilla.com/D221819
2024-09-19 13:06:57 +00:00