Commit Graph

15483 Commits

Author SHA1 Message Date
Nicolas Chevobbe
b74d0003ff Bug 1899107 - [devtools] Display light-dark function in autocomplete. r=layout-reviewers,emilio.
Differential Revision: https://phabricator.services.mozilla.com/D211716
2024-06-05 13:53:08 +00:00
Jan-Niklas Jaeschke
c25a8c4b54 Bug 1867940 - Text Fragments: Implement sensible default colors. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D212378
2024-06-05 10:46:53 +00:00
Ting-Yu Lin
14863de599 Bug 1900522 Part 3 - Update autogen_warning in servo/ports/geckolib/cbindgen.toml. r=layout-reviewers,emilio
We don't need to manually generate `ServoStyleConsts.h`. Update the warning to
avoid confusion.

Differential Revision: https://phabricator.services.mozilla.com/D212506
2024-06-04 17:54:48 +00:00
Ting-Yu Lin
9f961819ce Bug 1900522 Part 2 - Swap the arguments of StyleRect::Get() that gets T from logical side. r=layout-reviewers,emilio
This patch move `WritingMode` to the second argument, for the consistency with
the design of its own APIs like `StyleRect::Start(LogicalAxis, WritingMode)`,
and logical classes such as `LogicalMargin::Side(LogicalSide, WritingMode)`.

Differential Revision: https://phabricator.services.mozilla.com/D212505
2024-06-04 17:54:48 +00:00
Jonathan Watt
ca24f45edd Bug 1899949. Implement parsing of CSS 'position-try-options' property. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D212335
2024-06-04 17:14:37 +00:00
Emilio Cobos Álvarez
29b1f3c2f8 Bug 1899042 - Remove untested and unimplemented align="char" value for tables. r=jfkthame,layout-reviewers
Other engines also don't implement it, so moderately sure this is safe.

Differential Revision: https://phabricator.services.mozilla.com/D212549
2024-06-04 13:42:36 +00:00
Emilio Cobos Álvarez
171797e27f Bug 1899042 - Alias -webkit- prefixed versions of legacy HTML alignment keywords. r=jfkthame,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D212548
2024-06-04 13:42:36 +00:00
Boris Chiou
c67d3ccd79 Bug 1893409 - Make getCSSStyleRules() work for starting style as well. r=layout-reviewers,firefox-style-system-reviewers,nchevobbe,emilio
Update the API, `nspectorUtils.getCSSStyleRules`. Add one extra
argument so the user can choose whether we should return the starting
style, for a given element, at this moment.

Differential Revision: https://phabricator.services.mozilla.com/D209318
2024-06-04 03:15:00 +00:00
Boris Chiou
ffb238ac43 Bug 1893409 - Move resolve_starting_style() and after_change_style() into StyleResolverForElement. r=layout-reviewers,firefox-style-system-reviewers,emilio
We would like to add an API to resolve the starting style for DevTools, so
make them public.

Differential Revision: https://phabricator.services.mozilla.com/D210087
2024-06-04 03:14:59 +00:00
Nicolas Chevobbe
498865d822 Bug 1899533 - [devtools] Add InspectorUtils method to validate a value against a given syntax. r=emilio.
Differential Revision: https://phabricator.services.mozilla.com/D211975
2024-06-03 19:53:00 +00:00
Emilio Cobos Álvarez
a3df7f7279 Bug 1899949 - Add the ability to have a custom parse function to derived variants. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D212448
2024-06-03 16:40:08 +00:00
Jonathan Watt
e3d0635270 Bug 1900239. Derive Default for InsetAreaKeyword. r=tlouw
Differential Revision: https://phabricator.services.mozilla.com/D212374
2024-06-02 15:29:34 +00:00
Sandor Molnar
c8094db8fc Backed out changeset 8b201e1bef80 (bug 1900239) for causing wpt webcodecs failures CLOSED TREE 2024-06-02 13:33:05 +03:00
Jonathan Watt
ca7295d6d0 Bug 1900239. Derive Default for InsetAreaKeyword. r=tlouw
Differential Revision: https://phabricator.services.mozilla.com/D212374
2024-06-02 09:48:03 +00:00
Jonathan Watt
53bb6cb24a Bug 1900195. Remove support for the 'align-tracks' and 'justify-tracks' properties. r=emilio
These properties were added as part of the experimental Masonry support added
in bug 1607954. Since then the CSS WG resolved to remove these properties in:
https://github.com/w3c/csswg-drafts/pull/9529

This patch is a fairly brain dead removal of the properties, simply changing
the consumer code to take the code paths that would have been taken previously
if the properties were not set. That leaves some obvious dead code, which has
been removed, but no attempt has been made to redesign the Masonry code to
"make sense" without these properties. That would require a more prolonged
effort to understand Masonry, how the spec has changed in the last four years,
and how we should best change our code.

For now, this removal is simply focused on reducing the amount of memory used
by nsStyleDisplay to unblock the landing of bug 1899949.

Differential Revision: https://phabricator.services.mozilla.com/D212358
2024-06-02 00:16:26 +00:00
Norisz Fay
75e7e44c85 Backed out 2 changesets (bug 1670993) for causing reftest process crash and mochitest failures on test_property_database.html CLOSED TREE
Backed out changeset f0f3ed1d3a82 (bug 1670993)
Backed out changeset a9cfe8c04221 (bug 1670993)
2024-05-31 21:08:03 +03:00
Jonathan Kew
5c14afdaeb Bug 1670993 - For webcompat, make -webkit-font-smoothing:antialiased behave like -moz-osx-font-smoothing:grayscale. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D212130
2024-05-31 15:14:05 +00:00
Emilio Cobos Álvarez
d82e90cc8c Bug 1899597 - Avoid double walk over siblings in style invalidation. r=dshin
This fixes a regression with :has() on the test-case of bug 1480477 (but
we should still aim to make that faster).

While at it, avoid synchronization in some really hot paths, and add
tests.

Differential Revision: https://phabricator.services.mozilla.com/D212039
2024-05-31 13:14:36 +00:00
Jonathan Watt
d4087bed86 Bug 1897659. Implement parsing of CSS 'position-try-order' property. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D212220
2024-05-31 10:35:07 +00:00
Jonathan Watt
27c190ff0e Bug 1899911. Run rustfmt on servo/components/style/. r=tlouw
Differential Revision: https://phabricator.services.mozilla.com/D212206
2024-05-31 08:02:50 +00:00
Jonathan Watt
42bc18d72e Bug 1898887. Implement parsing of CSS 'inset-area' property. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D211955
2024-05-30 19:39:07 +00:00
David Shin
38d510bc54 Bug 1886441: Part 7 - Fast-reject with ancestor hashes for @scope. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208028
2024-05-30 15:23:42 +00:00
David Shin
b88e0a8198 Bug 1886441: Part 6 - Implement scoped styles. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D207783
2024-05-30 15:23:42 +00:00
David Shin
1a2c670c32 Bug 1886441: Part 5 - :scope is featureless in scoped style, if it refers to the shadow host. r=firefox-style-system-reviewers,emilio
A scoped style can match the featureless shadow host:

* Constructed stylesheets adopted by the shadow DOM
* Implicit scope defined in `<style>` at shadow root
* Explicit scope with `scope-start` selector of `:host`

Hence, they should not be considered non-featureless selector during parse time,
adding to featureless host rules when we can determine if we're in one of the
above cases.

Differential Revision: https://phabricator.services.mozilla.com/D207782
2024-05-30 15:23:41 +00:00
David Shin
7f31578a84 Bug 1886441: Part 4 - Add support for implicit scope. r=firefox-style-system-reviewers,emilio
Keep track of implicit scopes for shadow DOM styled separately,
as cascade data for shadow DOM are shared.

Differential Revision: https://phabricator.services.mozilla.com/D207781
2024-05-30 15:23:41 +00:00
David Shin
80976970d8 Bug 1886441: Part 3 - Implement substitutions in @scope. r=firefox-style-system-reviewers,emilio
`:scope` gets implicitly added if not present, without contributing
specificity (See https://github.com/w3c/csswg-drafts/issues/10196).

`&` is replaced with `scope-start` selector, or `:scope` if it not
specified.

Differential Revision: https://phabricator.services.mozilla.com/D207780
2024-05-30 15:23:41 +00:00
David Shin
469ea7cb2d Bug 1886441: Part 2 - Infrastructure for checking scoped styles. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D207779
2024-05-30 15:23:40 +00:00
David Shin
2ef0c6bb9b Bug 1886441: Part 1 - Introduce scope proximity in cascade ordering. r=firefox-style-system-reviewers,emilio
Uses the u32 hole left in `ApplicableDeclarationBlock`.

Differential Revision: https://phabricator.services.mozilla.com/D207778
2024-05-30 15:23:40 +00:00
Tiaan Louw
1378c24114 Bug 1899011 - In Lab/Oklab, very small a and b values makes the color achromatic r=layout-reviewers,emilio
Using an dynamic epsilon to check for small a and b values.

Differential Revision: https://phabricator.services.mozilla.com/D211665
2024-05-29 14:26:39 +00:00
Emilio Cobos Álvarez
302ad8f39b Bug 1899272 - Defer computation of registered custom color properties if needed. r=dshin,firefox-style-system-reviewers,zrhoffman
This is a bit less complicated than lengths because there's no cycle
possible which could turn the color-scheme declaration invalid afaict.

So it's just that we need to defer the colors when color-scheme is
specified, which is slightly annoying, but maybe not too bad.

I had to tweak a bit the code to defer properties to fix a bug that we
were papering over accidentally. We were using the wrong registration
here:

  https://searchfox.org/mozilla-central/rev/f60bb10a5fe6936f9e9f9e8a90d52c18a0ffd818/servo/components/style/custom_properties.rs#1613

That's the registration for reference.name, not for name, which
papered over some issues. The fix is simple tho, which is storing a
single CustomPropertiesMap.

Differential Revision: https://phabricator.services.mozilla.com/D211860
2024-05-29 14:19:02 +00:00
Emilio Cobos Álvarez
ac5d859c21 Bug 1899318 - Fix at-property-animation to account for spec ambiguity. r=firefox-style-system-reviewers,zrhoffman
See https://github.com/w3c/csswg-drafts/issues/10371 for the spec issue.

Differential Revision: https://phabricator.services.mozilla.com/D211871
2024-05-29 10:25:03 +00:00
Zach Hoffman
114165a306 Bug 1899446 - Allow transitioning from a custom property to None. r=firefox-animation-reviewers,firefox-style-system-reviewers,boris
If `getComputedStyle(...).getPropertyValue` is called on a registered
custom property that is used in a transition and that custom property's
registration is removed, `to` can be `None`.

Differential Revision: https://phabricator.services.mozilla.com/D211947
2024-05-29 00:24:39 +00:00
Zach Hoffman
5901bdda66 Bug 1899406 - Check custom property AnimationValue for None before unwrapping. r=boris,firefox-animation-reviewers,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D211925
2024-05-28 21:18:10 +00:00
Emilio Cobos Álvarez
5f86f91a61 Bug 1899187 - Use cbindgen for column-count. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211784
2024-05-28 09:37:23 +00:00
Emilio Cobos Álvarez
903d05f498 Bug 1899187 - Various extra mako simplifications. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211783
2024-05-28 09:37:22 +00:00
Emilio Cobos Álvarez
716862543d Bug 1899187 - Use cbindgen for initial-letter. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211782
2024-05-28 09:37:22 +00:00
Emilio Cobos Álvarez
1d2f00404f Bug 1899187 - Use cbindgen for border-spacing. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211781
2024-05-28 09:37:22 +00:00
Emilio Cobos Álvarez
dd4cff6234 Bug 1899187 - Use a real percentage for -moz-min-font-size-ratio. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211780
2024-05-28 09:37:21 +00:00
Emilio Cobos Álvarez
4338620c2b Bug 1899126 - Simplify some font-variant code to take advantage of cbindgen and derived implementations. r=jfkthame,layout-reviewers
While at it do fontLanguageOverride to, in order to remove
impl_simple_type_with_conversion.

Differential Revision: https://phabricator.services.mozilla.com/D211761
2024-05-28 09:37:21 +00:00
Jonathan Watt
b4d4983f4b Bug 1897756. Implement parsing of CSS 'position-visibility' property. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D210910
2024-05-28 00:52:04 +00:00
Emilio Cobos Álvarez
f9b44817e4 Bug 1899126 - Simplify text-transform representation. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D211731
2024-05-27 17:24:10 +00:00
Emilio Cobos Álvarez
abc2931af2 Bug 1899126 - Derive parsing of grid-auto-flow. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D211730
2024-05-27 17:24:10 +00:00
Emilio Cobos Álvarez
9642393c9c Bug 1899126 - Derive parse of TextUnderlinePosition. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D211729
2024-05-27 17:24:09 +00:00
Emilio Cobos Álvarez
64d9553bbc Bug 1899126 - Fix the documentation of #[css(bitflags())]. r=jwatt
The attribute is called validate_mixed because it only applies to mixed
flags.

Differential Revision: https://phabricator.services.mozilla.com/D211732
2024-05-27 17:23:47 +00:00
Emilio Cobos Álvarez
19f778623d Bug 1899126 - Simplify TextOverflow handling in the style engine. r=jwatt
No good reason to have different computed / specified representations.

Differential Revision: https://phabricator.services.mozilla.com/D211728
2024-05-27 17:14:32 +00:00
Jonathan Watt
4ebaa96406 Bug 1897619. Implement parsing of CSS 'position-anchor' property. r=emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D210880
2024-05-27 14:43:11 +00:00
Gregory Pappas
63bfe042e6 Bug 1851085 - Remove layout.css.computed-style.shorthands pref r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D211487
2024-05-26 16:47:47 +00:00
Tiaan Louw
29182bde1c Bug 1898468 - When converting legacy rgb(..) to color(srgb ..), ensure the flags are set accordingly r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211341
2024-05-24 07:16:57 +00:00
Sandor Molnar
2eba1ed517 Backed out changeset 4593c7cfe72e (bug 1898468) for causing wpt failures @ /css/css-properties-values-api/registered-property-computation.html CLOSED TREE 2024-05-24 01:26:11 +03:00
Tiaan Louw
f8598e6f55 Bug 1898468 - When converting legacy rgb(..) to color(srgb ..), ensure the flags are set accordingly r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211341
2024-05-23 20:54:23 +00:00