Commit graph

15495 commits

Author SHA1 Message Date
Tiaan Louw
d431c710c8 Bug 1924363 - Eagerly resolve sum nodes during parsing a=RyanVM
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.

Original Revision: https://phabricator.services.mozilla.com/D225936

Differential Revision: https://phabricator.services.mozilla.com/D232498
2024-12-18 15:28:33 +00:00
Zach Hoffman
08a7091921 Bug 1926164 - Negate in_negation when nesting r=dshin,jwatt a=RyanVM
`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
Jonathan Kew
c7118866af Bug 1913536 - Expose the special shorthands in the SpecifiedValueInfo for the CSS white-space shorthand. a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D219426

Differential Revision: https://phabricator.services.mozilla.com/D225215
2024-10-10 15:31:38 +00:00
Sam Johnson
78d2e9b10b Bug 1906037 - Restore macOS desktop tinting on dialog windows. a=RyanVM
After bug 1867854, dialog windows on macOS no longer show desktop tinting on the window background. Since this requires a transparent Gecko background, the `-moz-mac-unified-toolbar-window` appearance added in bug 1870481 should be applied to every window. It has been renamed to reflect this.

Original Revision: https://phabricator.services.mozilla.com/D215596

Differential Revision: https://phabricator.services.mozilla.com/D219588
2024-08-20 17:21:02 +00:00
Emilio Cobos Álvarez
f2e5c20b74 Bug 1912663 - Fix some build issues with cbindgen 0.27. r=firefox-style-system-reviewers,zrhoffman, a=dmeehan
It updates serde and syn and they are more strict. In particular, syn 2
doesn't parse the rust 2015 syntax where try is not a keyword, and serde
rejects duplicate keys.

Differential Revision: https://phabricator.services.mozilla.com/D219025
2024-08-11 15:12:29 +00:00
Emilio Cobos Álvarez
e31ff5e9c6 Bug 1906078 - Avoid pathological VecDeque behavior on parallel traversal. r=dshin, a=dmeehan
Using split_off to split the front chunk from the queue seems like it'd
be efficient, but it's not:

  https://github.com/rust-lang/rust/issues/127281

Instead, pass the range of nodes to distribute, and use
VecDeque::from_iter in the callee. Then, just truncate() the queue to
the remaining local work.

Differential Revision: https://phabricator.services.mozilla.com/D215705
2024-07-08 18:07:42 +00:00
David Shin
07c77d3ecd Bug 1904228: Don't consider :scope selectors to be featureless outside of @scope. r=emilio, a=dmeehan
Differential Revision: https://phabricator.services.mozilla.com/D214678
2024-06-24 18:15:27 +00:00
longsonr
ebaa9c434c Bug 1901378 - Line height unit rlh in calc() is sometimes interpreted as lh r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D212989
2024-06-09 10:41:22 +00:00
Emilio Cobos Álvarez
e0c2a91699 Bug 1900623 - Fix perf regression from bug 1899272. r=firefox-style-system-reviewers,boris
Move the uncommon code-path out of line.

Differential Revision: https://phabricator.services.mozilla.com/D212567
2024-06-07 08:13:13 +00:00
Sandor Molnar
55f423c1b9 Backed out changeset 3a84ab9eef63 (bug 1900623) for causing build bustages. CLOSED TREE 2024-06-07 10:18:33 +03:00
Emilio Cobos Álvarez
1c9eb2b4f4 Bug 1900623 - Fix perf regression from bug 1899272. r=firefox-style-system-reviewers,boris
Move the uncommon code-path out of line.

Differential Revision: https://phabricator.services.mozilla.com/D212567
2024-06-07 06:48:38 +00:00
Jonathan Kew
885bab911c 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-06-05 17:28:36 +00:00
Nicolas Chevobbe
f114f4f423 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
db5d7e6f67 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
3774687f4b 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
72d1c570e6 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
68821e8ea9 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
0526c2a5c0 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
ae567c7141 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
6203ad286b 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
300659b5ee 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
08e9a99b4c 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
a572c0d70b 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
e8b8192976 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
ef05d7cc23 Backed out changeset 8b201e1bef80 (bug 1900239) for causing wpt webcodecs failures CLOSED TREE 2024-06-02 13:33:05 +03:00
Jonathan Watt
b11ef88224 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
8191eda786 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
242ada988e 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
008aa49ff5 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
32c120d2ec 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
3fa58fb2fa 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
46e06c40cf 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
745b6de9a7 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
2343e53edd 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
f4188d2589 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
536dcf63c5 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
e9208e701c 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
caf6d830a8 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
336fcf3956 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
4e40923fb6 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
7ace11cfe2 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
0c79149d0a 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
710739a2b0 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
589054a01b 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
2ee1113256 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
bf28f82a23 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
e86daa2b4d 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
686f4b7379 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
b4d60bef91 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
297dfea1e6 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