Commit graph

47258 commits

Author SHA1 Message Date
Oriol Brufau
abc0c86fef Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
d02c4e2fe9 style: Remove viewport rule code
Turns out Servo doesn't need this either, see
https://github.com/servo/servo/pull/29850.

Differential Revision: https://phabricator.services.mozilla.com/D180264
2023-11-24 08:57:14 +01:00
Oriol Brufau
0b75c1d9d1 Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
23d60c2195 style: Unify parallel and sequential traversal scheduling
Use in_place_scope_fifo to spawn work into the thread pool while doing
work in the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D179492
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
7771cf25a8 style: Remove :nth-child(... of) pref
We ship this, and the front-end uses it by default, so remove the pref.

Differential Revision: https://phabricator.services.mozilla.com/D180222
2023-11-24 08:57:14 +01:00
Boris Chiou
bcae33a43f style: Send offset-position to the compositor
We send offset-position to the compositor, just like other similar
properties, e.g. offset-rotate, offset-anchor. This includes extracting
this animation value, doing serialization and sending it via IPC.

So now we can run the animation of ray() on the compositor properly.

Differential Revision: https://phabricator.services.mozilla.com/D179862
2023-11-24 08:57:14 +01:00
Boris Chiou
2fef5d1a17 style: Add at <position> into ray() in style system
We reuse PositionOrAuto here, and let "auto" represent the situation when the
author omits "at <position>" because it has a special meaning.

https://drafts.fxtf.org/motion-1/#valdef-ray-at-position

Note: No need to update css/motion/parsing/offset-path-parsing-valid.html
because Blink added some to the upstream repo already.

Differential Revision: https://phabricator.services.mozilla.com/D179860
2023-11-24 08:57:14 +01:00
Boris Chiou
8b60424e29 style: Return Err() in to_animated_zero() for offset-path
It's unnecessary to implement ToAnimatedZero for this property and so we
return Err(()), just like other properties which also use basic shapes,
e.g. clip-path, shape-outside.

Differential Revision: https://phabricator.services.mozilla.com/D179859
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
52e2cc5ff0 style: Change some references to raw pointers in some FFI functions
Even tho https://github.com/rust-lang/rust/issues/112337 is IMO a rust
bug, it's easy to work around in our code and it doesn't really affect
expressiveness.

Differential Revision: https://phabricator.services.mozilla.com/D180065
2023-11-24 08:57:14 +01:00
Oriol Brufau
e792eba7c7 Further changes required by Servo 2023-11-24 08:57:14 +01:00
Jihye Hong
9e223342e7 style: Make content-visibility: auto forces contain-intrinsic-size to gain an auto value
When the content having `content-visibility: auto` and the specific value for `contain-intrinsic-size` is slightly out of the viewport,
its computed value keeps changing.
This patch makes `content-visibilty: auto` forces `contain-intrinsic-size` to gain an auto value to solve this issue.

Differential Revision: https://phabricator.services.mozilla.com/D174583
2023-11-24 08:57:14 +01:00
Oriol Brufau
dcbeb2f1ab Further changes required by Servo 2023-11-24 08:57:14 +01:00
Mike Hommey
39bc94a4f7 style: Update serde_with to 3.0.0
We upgrade enumset alongside so that we keep only one copy of darling.

Differential Revision: https://phabricator.services.mozilla.com/D179651
2023-11-24 08:57:14 +01:00
Boris Chiou
e1b6632313 style: Update the syntax of offset-position
Now it supports "normal" keyword. Also, offset-position doesn't create
stacking context and it doesn't have offset transform, so we can
simplify CompareMotionValues() a little bit.

Note: We don't have to add test in [1] because Blink added one to WPT
upstream repo already.

[1] css/motion/parsing/offset-position-parsing-valid.html

Note: the usage of offset-position is in other bugs.

Differential Revision: https://phabricator.services.mozilla.com/D179623
2023-11-24 08:57:14 +01:00
Oriol Brufau
0fd2f08da1 Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
7b4fb5dc22 style: Simplify border snapping
Make the computed value of border-like properties app units (which is
effectively what happens in Gecko already), and clamp at computed value
time.

Differential Revision: https://phabricator.services.mozilla.com/D179481
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
ad72081ac8 style: Rustfmt servo/. r=zrhoffman
$ find servo -name '*.rs' | xargs rustup run nightly rustfmt

Depends on D179380

Differential Revision: https://phabricator.services.mozilla.com/D179381
2023-11-24 08:57:14 +01:00
Oriol Brufau
68cbe6833d Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
6728158188 style: Use non-locked rules for all rule types that can
Anything that doesn't need interior mutability doesn't need Locked<>
around it.

Depends on D179059

Differential Revision: https://phabricator.services.mozilla.com/D179060
2023-11-24 08:57:14 +01:00
Zach Hoffman
0aed54f636 style: [css-properties-values-api] Remove Locked<> from CssRule::Property arc
Depends on D179038

Differential Revision: https://phabricator.services.mozilla.com/D179039
2023-11-24 08:57:14 +01:00
Oriol Brufau
cd67a09ac1 Further changes required by Servo 2023-11-24 08:57:14 +01:00
David Shin
ff8100d396 style: Correct style sharing handling for any element that considered :has() in selector matching
For any element that anchors a `:has()` selector (i.e. Matches a selector that
contains a `:has()` on its rightmost side), we prevent style sharing altogether,
as evaluation of the `:has()` selector is required in the first place to
determine style sharing.

On the other hand, any element matching a rule containing `:has()` without
anchoring it can do style sharing for siblings, but not cousins.

Differential Revision: https://phabricator.services.mozilla.com/D176836
2023-11-24 08:57:14 +01:00
Zach Hoffman
5c0897c8eb style: [css-properties-values-api] Share PropertyRule instance when cloning CssRule::Property
Differential Revision: https://phabricator.services.mozilla.com/D178892
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
48f2f475c6 style: Flush parent document layout if needed for viewport dependent media queries
This is necessary to properly report changes in our document.

The remaining failures are about change event scheduling, which is a
pre-existing issue. Will fix, but in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D178917
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
ad81122fcf style: More gracefully deal with broken calls into selector matching
If this happens again, it might be worth not matching rather than
potentially crashing. Though I guess crashing is a very good way getting
it reported soon...

Differential Revision: https://phabricator.services.mozilla.com/D178921
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
b329d547be style: Properly increase the nesting level when matching :nth-child(of) selectors
Differential Revision: https://phabricator.services.mozilla.com/D178920
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
520f851d8c style: Simplify some appearance code
I was looking into simplifying our scrollbar styles:

  * StyleAppearance::Resizer is not used in content, and some of the
    values were only for <xul:window> which are not supported anymore.

  * Statusbarpanel and Resizerpanel aren't used. Statusbar is only used
    once on macOS so we only need to keep it there.

Differential Revision: https://phabricator.services.mozilla.com/D178374
2023-11-24 08:57:14 +01:00
Oriol Brufau
7d72d7c385 Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
d49b014c78 style: Make style parallel traversal more tunable at runtime
This adds two prefs to configure the parallel traversal work item size
and kick-off threshold, but otherwise shouldn't change behavior.

I switched from iterator generics to just a slice while at it, mostly
for simplicity, but there is a trade-off:

  * When switching from sequential to parallel traversal, we potentially
    pay the price of memmoving the VecDeque around once to make them a
    contiguous slice.

  * However we win in the common case of the smaller-than-work-unit size
    in which case we no longer need to copy stuff to a WorkItem. So I
    think overall this should be an improvement.

Differential Revision: https://phabricator.services.mozilla.com/D178656
2023-11-24 08:57:14 +01:00
Oriol Brufau
ea3fcce25f Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
10f8eb4239 style: Make stylo thread pool size configurable via pref rather than just env
Remove a variety of code which we don't use to change the pool size. We
can just use the pref as needed in the future.

Differential Revision: https://phabricator.services.mozilla.com/D178575
2023-11-24 08:57:14 +01:00
CanadaHonk
3a51e530d2 style: Remove overflow-block optional-paged
Removed overflow-block optional-paged value and reftesting as it was
removed from the spec in 2020: https://github.com/w3c/csswg-drafts/issues/5287

1 WPT subtest now newly passes.

WPT tests: https://wpt.fyi/results/css/mediaqueries/test_media_queries.html

Differential Revision: https://phabricator.services.mozilla.com/D178710
2023-11-24 08:57:14 +01:00
Oriol Brufau
8d2ae3f1c5 Further changes required by Servo 2023-11-24 08:57:14 +01:00
Zach Hoffman
9c46eabe83 style: [css-properties-values-api] Implement parsing and serialization for @property at-rule
Implemented behind the new properties-and-values pref.

Support for the CSSPropertyRule WebIDL interface is also added in this
patch, because until it's added, any attempt to access the rule using
the CSSOM would crash the browser.

Depends on D178268

Differential Revision: https://phabricator.services.mozilla.com/D178270
2023-11-24 08:57:14 +01:00
Zach Hoffman
87ce7045ef style: [css-properties-values-api] Parsing and serialization for @property syntax descriptor
Based off of @emilio's syntax parser at
<https://github.com/emilio/css-typed-om-syntax>.

Co-authored-by: Emilio Cobos Álvarez <emilio@crisal.io>

Differential Revision: https://phabricator.services.mozilla.com/D178268
2023-11-24 08:57:14 +01:00
Daniel Holbert
8823b63513 style: Remove code that's flagged as to-be-removed once layout.css.always-repaint-on-unvisited is true
If I'm reading the code comment correctly, this is now unreachable code,
and hence can & should be removed.

Differential Revision: https://phabricator.services.mozilla.com/D178570
2023-11-24 08:57:14 +01:00
Boris Chiou
b5deea8442 style: Reject empty svg path string for basic shape path function
Per CSS shape spec, the empty path string is invalid. However, for SVG
d property, the EBNF allows the path data string in the d property to be
empty. We just disable the rendering of the path.

Note: only offset-path and clip-path are affected.

Differential Revision: https://phabricator.services.mozilla.com/D178123
2023-11-24 08:57:14 +01:00
Oriol Brufau
d4aafad560 Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
7c4ec6e9cc style: [css-nesting] Do a first pass at parsing nested rules mixed with declarations
Plumb everything up. This factors out declaration and rule parsing so
we share the code with the regular declaration parser.

This could be made a bit nicer in the future. We need to decide what to
do for @page and @keyframe (it seems conditional rules inside ought to
work, but that's not so easy because per spec we create a nested style
rule).

But this is a first pass that passes a good chunk of the tests. There
are other fixups to cssom, and I think some of the tests we fail are
actually wrong...

Differential Revision: https://phabricator.services.mozilla.com/D178266
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
b92440ef7c style: Disable NSCAP_FEATURE_USE_BASE
This is a relatively small code size regression (130k on windows and
macOS, 180k on Linux), for a few high confidence improvements in
speedometer 3. See link in the bug.

If this sticks, we can actually clean up a bunch of code, and eventually
unify RefPtr and nsCOMPtr. But I want this to be on the tree for a while
before doing more aggressive refactorings / actually removing the code.

Differential Revision: https://phabricator.services.mozilla.com/D178267
2023-11-24 08:57:14 +01:00
David Shin
7a2b444a60 style: Implement parsing for baseline-source
Differential Revision: https://phabricator.services.mozilla.com/D173884
2023-11-24 08:57:14 +01:00
Emily McDonough
571136562d style: Remove the layout.css.named-pages.enabled pref
Differential Revision: https://phabricator.services.mozilla.com/D175438
2023-11-24 08:57:14 +01:00
Oriol Brufau
f1ae42678a Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
920a1c1f08 style: [css-nesting] Update cssparser again
This changes the cssparser setup to:

  * Avoid having to do copies of the ParsingContext all over the place,
    which is useful because I plan to stash more nesting state in there.

  * Use the new RuleBodyParser which allows parsing qualified rules,
    declarations, and so on. Though we still don't use this anywhere.

The next step is to join NestedRuleParser and PropertyDeclarationParser,
so that we can parse declarations in a lot of the nested rules as well.

Differential Revision: https://phabricator.services.mozilla.com/D178053
2023-11-24 08:57:14 +01:00
Oriol Brufau
32f1989a5c Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
ae993e485a style: Move a bit declaration_block and cascade modules
So that they aren't imported via #[path]. This allows cargo to see them
even before building.

Differential Revision: https://phabricator.services.mozilla.com/D178105
2023-11-24 08:57:14 +01:00
David Shin
9c58f0c635 style: Disallow :has selector nesting
Unlike the `ParseRelative` flag, which turns on relative selector parsing for
that parsing level only, the newly added `DISALLOW_RELATIVE_SELECTOR` flag
propagates through nested parsing calls.

Differential Revision: https://phabricator.services.mozilla.com/D176807
2023-11-24 08:57:14 +01:00
Oriol Brufau
9c7e0930c3 Further changes required by Servo 2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
d1046739fc style: Remove some magic from the bindings
This simplifies a tiny bit our bindings in some places, and complicates
it in others, but over all I think it's better.

It requires a bit more manual code in the rust side to drop and cast the
relevant pointers (which was done implicitly before), but it's a lot
less magic than it used to be, and that's all autogenerated so consumers
don't need to care about it.

The set up is still not ideal. I don't like that we rely on destructors
running in both sides of the FFI boundary, but that's for another day.

This is the last usage of RawOffsetArc, so remove that. We now support
proper Arc<> in structs (GridTemplateAreas uses it), so I don't think
we'll need it any time soon.

Differential Revision: https://phabricator.services.mozilla.com/D177905
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
e9bf977369 style: Finish removing HasArcFFI
Use the actual Locked<T> types around (via a typedef, just for
convenience).

Differential Revision: https://phabricator.services.mozilla.com/D177824
2023-11-24 08:57:14 +01:00