Commit graph

46043 commits

Author SHA1 Message Date
bors-servo
9260683b5f
Auto merge of #29848 - Loirooriol:sync, r=mrobinson
Backport several style changes from Gecko (4)

<!-- Please describe your changes on the following line: -->
This continues https://github.com/servo/servo/pull/29816.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-06-12 12:11:30 +02:00
bors-servo
1d69e7b234
Auto merge of #29859 - mrobinson:float-negative-block-margin, r=Loirooriol
Layout 2020: Properly handle negative margins in floats

If a float has negative block margins, it should be pushed upward, but shouldn't affect the positioning of any floats that came before it. It should lower the ceiling though when it still has some non-negative block contribution. In order to implement this behavior, we should only place the float considering its non-negative block length contribution. If the float is pushed up completely past it's "natural" position, it should be placed like a float with zero block size.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-06-12 09:33:48 +02:00
Martin Robinson
bc58bb080f Layout 2020: Properly handle negative block margins in floats
If a float has negative block margins, it should be pushed upward, but
shouldn't affect the positioning of any floats that came before it. It
should lower the ceiling though when it still has some non-negative
block contribution. In order to implement this behavior, we should only
place the float considering its non-negative block length contribution. If
the float is pushed up completely past it's "natural" position, it
should be placed like a float with zero block size.
2023-06-11 11:47:56 +02:00
bors-servo
21c199072f
Auto merge of #29869 - servo:wpt_update_11-06-2023, r=servo-wpt-sync
Sync WPT with upstream (11-06-2023)

Automated downstream sync of changes from upstream as of 11-06-2023
[no-wpt-sync]
r? @servo-wpt-sync
2023-06-11 03:26:33 +02:00
WPT Sync Bot
d4243801cf Update web-platform-tests to revision b'04c64baa69c1692214ef350185b1ef817362a13c' 2023-06-11 01:26:17 +00:00
bors-servo
7d9839acc8
Auto merge of #29863 - nicoburns:fix-infinite-loop-when-shrinking, r=Loirooriol
Fix infinite loop in flexbox algorithm

Only apply step 5c of "resolve flexible lengths" if sum of scaled flexible shrink factors > 0
Probably fixes #29852 (but speculative as I can't get mach to run).

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___
2023-06-10 16:54:24 +02:00
Oriol Brufau
9cdcf98165 Update test expectations 2023-06-10 02:44:05 +02:00
bors-servo
9aeed659dc
Auto merge of #29866 - mrobinson:run-unit-tests-on-main-workflow, r=atbrakhi
Run unit tests on the main Linux workflow

Not running unit tests on the main Linux workflow makes it faster, but also allows merging changes that break the unit tests. This change fixes that.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they are CI changes.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-06-09 22:41:41 +02:00
bors-servo
edd197c74e
Auto merge of #29865 - sagudev:win-target, r=mrobinson
windows workflow use C drive as target directory

Currently we clone to drive D (default drive in GitHub Actions), then copy to drive C, then build from there (due to low disk space on D drive). In this PR instead of copying to C drive we only set `CARGO_TARGET_DIR` to C drive, the build is reading source files from D and writing target files to C drive. This gets us approx. -20min.

Try-windows build available [here](https://github.com/sagudev/servo/actions/runs/5219706997/jobs/9421863750).

What do we lose? Well copying step was good benchmarker for GitHub runner machines, fast windows machines spend ~5min in copying step while slow machines ~8min.

For the future: I do believe that D drive may be faster for writing, so switching roles could benefit us, but it will require slow (like copying step) clone.
2023-06-09 20:08:47 +02:00
bors-servo
f63f981654
Auto merge of #29862 - mukilan:default-to-layout-2020, r=jdm
Use layout 2020 by default

This PR switches `./mach build` to use layout 2020 by default. It doesn't switch the nightly builds served from download.servo.org to layout 2020. I can add that change to this PR if we are ready to make the switch in nightly builds as well.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #29843
- [x] These changes do not require tests because modify mach build configuration.
2023-06-09 15:05:50 +02:00
Martin Robinson
951a244ad1 Run unit tests on the main Linux workflow 2023-06-09 13:35:41 +02:00
Oriol Brufau
aefaa3f16c Update test expectations 2023-06-09 13:01:22 +02:00
bors-servo
b36db7f90e
Auto merge of #29860 - mrobinson:clang-format-python, r=jdm
Get clang-format from pip and upgrade to version 16

This allows relying on a specific version of clang-format and no longer use any version checks. In addition, we can use --dry-run -Werror in order to avoid having to run against every file individually.

Fix #29847.
Fix #29846.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #29847 and fix #29846.
- [x] These changes do not require tests because they update dev infrastructure.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-06-09 12:08:15 +02:00
Oriol Brufau
c4dbec650a Avoid complaints from ./mach test-tidy 2023-06-09 11:18:08 +02:00
Emilio Cobos Álvarez
e03261c433 style: Remove some no longer used use statements
MANUAL PUSH: Bustage fix CLOSED TREE
2023-06-09 11:18:08 +02:00
Emilio Cobos Álvarez
01fb804320 style: Use atomic ops to read / write node flags from stylo
The flags stylo cares about reading and writing potentially at the same
time are disjoint, so there's no need for any strong memory ordering.

Differential Revision: https://phabricator.services.mozilla.com/D141829
2023-06-09 11:18:08 +02:00
Emilio Cobos Álvarez
ece2a74709 style: Put overflow: -moz-hidden-unscrollable behind a pref on Nightly
Differential Revision: https://phabricator.services.mozilla.com/D141759
2023-06-09 11:18:08 +02:00
Emilio Cobos Álvarez
32dd0b27e4 style: Honor background-color: transparent in forced colors mode
See comment as for why, and linked bugs, in particular:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1755713#c16

And the following screenshot for example.

Differential Revision: https://phabricator.services.mozilla.com/D141514
2023-06-09 11:18:08 +02:00
Martin Robinson
eb96b29af0 style: Add support for parsing the content-visibility property from the CSS Contain specification
Add initial parsing support for the CSS `content-visibility` attribute.
Currently these parsed values have no effect.

Differential Revision: https://phabricator.services.mozilla.com/D140834
2023-06-09 11:18:07 +02:00
Emilio Cobos Álvarez
8016c434b0 style: Reuse inherited custom properties if they didn't change after resolution
This should be cheap and gives us a lot of memory savings for the page
on the bug, by deduplicating the inherited properties between parent and
children.

WebKit implements a similar optimization.

Differential Revision: https://phabricator.services.mozilla.com/D140826
2023-06-09 11:18:07 +02:00
Emilio Cobos Álvarez
da81d71ffa style: Make custom-property substitution only traverse variables which could have references
If a name is not in self.seen, it means we've inherited it from our
parent. That in turn means that it can't have any variable reference
(because we inherit the computed variables) and we can skip the work of
traversing it, as we'd hit the early-return in traverse() anyways.

This doesn't fix the memory usage issue of the page on the bug, which
has a giant list of properties on the root and then a custom property
specified on all elements, but should significantly reduce the time we
spend iterating over custom properties for all those elements.

Differential Revision: https://phabricator.services.mozilla.com/D140825
2023-06-09 11:18:07 +02:00
Emilio Cobos Álvarez
b798336f81 style: Generalize moz-os-version into moz-platform
Allow differentiating non-windows platforms on it.

Differential Revision: https://phabricator.services.mozilla.com/D138431
2023-06-09 11:18:07 +02:00
Oriol Brufau
e2901169c8 Further changes required by Servo 2023-06-09 11:18:07 +02:00
Emilio Cobos Álvarez
2a67752418 style: Style system and plumbing for mix-blend-mode: plus-lighter
Differential Revision: https://phabricator.services.mozilla.com/D137951
2023-06-09 11:18:07 +02:00
Oriol Brufau
ebfbd2d9c0 Further changes required by Servo 2023-06-09 11:18:07 +02:00
Mike Hommey
d3aeba6bd3 style: Use the mozbuild crate in servo
Differential Revision: https://phabricator.services.mozilla.com/D136562
2023-06-09 11:18:06 +02:00
Mike Hommey
d32c5ed85f style: Remove MOZ_DIST
As mentioned in bug 1747354, the location of the dist directory is
relied to be $topobjdir/dist, so just use that consistently rather
than getting it from a separate variable for rust build scripts.

Differential Revision: https://phabricator.services.mozilla.com/D136556
2023-06-09 11:18:06 +02:00
Oriol Brufau
54878595b3 Further changes required by Servo 2023-06-09 11:18:06 +02:00
Emily McDonough
199f54342c style: Add style_traits::ToCss for AtomIdent
Differential Revision: https://phabricator.services.mozilla.com/D136290
2023-06-09 11:18:06 +02:00
Oriol Brufau
f39ab4ffc1 Further changes required by Servo 2023-06-09 11:18:06 +02:00
Emily McDonough
01c6eb3556 style: Implement basic @page-rule selector parsing
This does not support any of the pseudo page types.

Differential Revision: https://phabricator.services.mozilla.com/D131532
2023-06-09 11:18:05 +02:00
Oriol Brufau
e4bb1df878 Upgrade darling to 0.13.1
Based on https://phabricator.services.mozilla.com/D136568
2023-06-09 11:17:48 +02:00
Emilio Cobos Álvarez
0307500c3d style: Choose tabpanel background based on content preferred color-scheme
If the theme is dark but user prefers light pages, the background of the
tabpanel should arguably be light, since it can be seen across some
navigations.

Expose a -moz-content-prefers-color-scheme media query to chrome pages
so that our UI can correctly query it (and remove the unused -moz-proton
atom while at it).

Differential Revision: https://phabricator.services.mozilla.com/D136437
2023-06-09 10:22:26 +02:00
Emilio Cobos Álvarez
df6b6ba675 style: Apply line-height to ::marker
Differential Revision: https://phabricator.services.mozilla.com/D136313
2023-06-09 10:22:26 +02:00
Oriol Brufau
01549f0389 Further changes required by Servo 2023-06-09 10:22:26 +02:00
Emilio Cobos Álvarez
080b3f8d1a style: Avoid generating InterpolateMatrix operations if there are no size dependencies
The issue here is that we end up with a transition between mismatched
transform lists that ends up generating an InterpolateMatrix {}
operation. So far so good, but we end up interpolating that a lot of
times and generating an unboundedly-deep operation list.

This implementas an optimization that flattens them to a single matrix
when possible (when there's no dependencies on the containing box).

This is similar to:

  https://chromium.googlesource.com/chromium/src.git/+/2b89cc4df436e672ef9cf940d1c0dc73fef82a4a

We fix the to_pixel_length() behavior for LenghtPercentage to be
correct (and update callers to preserve behavior).

Differential Revision: https://phabricator.services.mozilla.com/D134784
2023-06-09 10:22:26 +02:00
Emilio Cobos Álvarez
6cb3b7e254 style: Remove touch-action pref
It's been enabled by default since ~forever.

Differential Revision: https://phabricator.services.mozilla.com/D134935
2023-06-09 10:22:26 +02:00
Emilio Cobos Álvarez
f0524611c4 style: Rename StyleMathMLMathVariant -> StyleMathVariant
MANUAL PUSH: Trivial rename.
2023-06-09 10:22:25 +02:00
Neia Finch
e44bedbcda style: Replace MathML font constants with enum
Differential Revision: https://phabricator.services.mozilla.com/D134802
2023-06-09 10:22:25 +02:00
Emilio Cobos Álvarez
01e43a8488 style: Make color-adjust an alias of print-color-adjust as per spec
Differential Revision: https://phabricator.services.mozilla.com/D134779
2023-06-09 10:22:25 +02:00
Emilio Cobos Álvarez
fcc55f2156 style: Shrink maps if needed after stylist rebuilds
Hashbrown grows a lot sometimes making us waste a lot of memory. Shrink
some of these maps after CascadeData rebuild / stylesheet collection
invalidation.

Differential Revision: https://phabricator.services.mozilla.com/D134716
2023-06-09 10:22:25 +02:00
Oriol Brufau
f9610e5898 Further changes required by Servo 2023-06-09 10:22:25 +02:00
Emilio Cobos Álvarez
5b62f66f6e style: Remove ThinBoxedSlice
The only remaining consumers are ::-moz-tree pseudo-elements (we used to
use ThinBoxedSlice for other data structures in the past).

Those are not particularly performance sensitive so I think just
double-boxing is fine. In the future, if we wanted to avoid the double
indirection, we could probably use the "thin" crate
(https://docs.rs/thin) or similar, which stores the length of the slice
along with the allocation, making the pointer thin in all
configurations, much like "ThinArc" does:

  https://searchfox.org/mozilla-central/rev/1ce2eea39442190a71a1f8f650d098f286bf4a01/servo/components/servo_arc/lib.rs#891

In practice though, I don't think it's particularly worth it for this
specific case.

Differential Revision: https://phabricator.services.mozilla.com/D134672
2023-06-09 10:22:25 +02:00
Emilio Cobos Álvarez
fc4d185079 style: Use ThreadPool::scope_fifo in style
It does the same, but it saves an indentation level:

  https://searchfox.org/mozilla-central/rev/a11b63915bd7810a03635d733123448ab5bfcad3/third_party/rust/rayon-core/src/thread_pool/mod.rs#217

Differential Revision: https://phabricator.services.mozilla.com/D134321
2023-06-09 10:22:25 +02:00
Emilio Cobos Álvarez
d0475b75d4 style: Remove hwba since it's not a thing (hwb function supports alpha)
Partially backs out the previous patch.

Differential Revision: https://phabricator.services.mozilla.com/D134256
2023-06-09 10:22:24 +02:00
Emilio Cobos Álvarez
4229ace432 style: Add hwb/a to devtools autocomplete lists
The changes to the devtools directory were written automatically via ./mach devtools-css-db

Differential Revision: https://phabricator.services.mozilla.com/D134197
2023-06-09 10:22:24 +02:00
Oriol Brufau
89041ac330 Further changes required by Servo 2023-06-09 10:22:24 +02:00
Emilio Cobos Álvarez
2b6fce1e57 style: Remove servo/components/{hashglobe,fallible} in favor of try_reserve
Differential Revision: https://phabricator.services.mozilla.com/D134194
2023-06-09 10:22:24 +02:00
Oriol Brufau
07d1bd560b Further changes required by Servo 2023-06-09 10:22:24 +02:00
Emilio Cobos Álvarez
454a9777b3 style: Deal with layers and at-rules
Differential Revision: https://phabricator.services.mozilla.com/D134010
2023-06-09 10:22:24 +02:00