Commit graph

47230 commits

Author SHA1 Message Date
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
Emilio Cobos Álvarez
3f03650c88 style: Plumb android text scale via nsLookAndFeel
That's how we do it for all other platforms. Do this rather than via a
custom mostly-untested pref, which allows us to simplify text zoom
handling.

Differential Revision: https://phabricator.services.mozilla.com/D177062
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
c2a2113136 style: Container units should prevent us from using the rule cache
Much like with font-relative units, when they're used for a
non-inherited property we need to avoid using the rule cache.

This is because two elements matching the same rules won't get
guaranteed-equal non-inherited style structs.

Depends on D177732

Differential Revision: https://phabricator.services.mozilla.com/D177733
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
af13e670d9 style: Clean up length handling
No behavior change, but using Self is shorter and while I'm touching
this code might as well clean it up a little bit.

Differential Revision: https://phabricator.services.mozilla.com/D177732
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
4b7260d846 style: Remove dead GTK menu styling code
Differential Revision: https://phabricator.services.mozilla.com/D177369
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
9370172552 style: Remove HasArcFFI for AnimationValue
See previous patches for context.

Differential Revision: https://phabricator.services.mozilla.com/D177622
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
779aa9d30e style: Remove HasArcFFI for some types
See blocked bug.

For non-Locked types we can just use the same underlying type at the FFI
boundary. Port StylesheetContents and CssUrlData to this set-up.
CssUrlData is already generated by cbindgen anyways.

Differential Revision: https://phabricator.services.mozilla.com/D177559
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
d9d865e8c9 style: Add an API to parse an absolute length without any other context
This should allow making these work on canvas.

Differential Revision: https://phabricator.services.mozilla.com/D177074
2023-11-24 08:57:14 +01:00
Emilio Cobos Álvarez
a69578993a style: display: inline list-item is also a line participant
So the line break suppression flags should be propagated through it.

Otherwise ruby invariants might break, leading to a nullptr crash in
this case.

On debug builds the assertion was this one:

  https://searchfox.org/mozilla-central/rev/e6cb503ac22402421186e7488d4250cc1c5fecab/layout/generic/nsRubyBaseContainerFrame.cpp#631

Differential Revision: https://phabricator.services.mozilla.com/D177093
2023-11-24 08:57:14 +01:00
Oriol Brufau
0094560541 Further changes required by Servo 2023-11-24 08:57:14 +01:00
Tiaan Louw
18c701e6b5 style: Hardening color checks
Avoid trying to resolve a currentcolor when a foreground color is not
available.

Differential Revision: https://phabricator.services.mozilla.com/D177368
2023-11-24 08:57:14 +01:00
dependabot[bot]
f967d3c4fd
build(deps): bump percent-encoding from 2.3.0 to 2.3.1 (#30777)
Bumps [percent-encoding](https://github.com/servo/rust-url) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.3.0...v2.3.1)

---
updated-dependencies:
- dependency-name: percent-encoding
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-23 20:27:24 +00:00
dependabot[bot]
0d91f4d616
build(deps): bump form_urlencoded from 1.2.0 to 1.2.1 (#30776)
Bumps [form_urlencoded](https://github.com/servo/rust-url) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v1.2.0...v1.2.1)

---
updated-dependencies:
- dependency-name: form_urlencoded
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-23 17:17:08 +00:00
dependabot[bot]
8e7beef835
build(deps): bump webpki-roots from 0.25.2 to 0.25.3 (#30774)
Bumps [webpki-roots](https://github.com/rustls/webpki-roots) from 0.25.2 to 0.25.3.
- [Release notes](https://github.com/rustls/webpki-roots/releases)
- [Commits](https://github.com/rustls/webpki-roots/compare/v/0.25.2...v/0.25.3)

---
updated-dependencies:
- dependency-name: webpki-roots
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-23 17:09:12 +00:00
dependabot[bot]
e3e1195329
build(deps): bump data-encoding from 2.4.0 to 2.5.0 (#30769)
Bumps [data-encoding](https://github.com/ia0/data-encoding) from 2.4.0 to 2.5.0.
- [Commits](https://github.com/ia0/data-encoding/commits)

---
updated-dependencies:
- dependency-name: data-encoding
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-23 10:45:16 +00:00
Oriol Brufau
b5bd416f7c
Make CSSConditionRule's conditionText readonly (#30768)
As per https://github.com/w3c/csswg-drafts/issues/6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.
2023-11-23 10:29:16 +00:00
Ngo Iok Ui (Wu Yu Wei)
604d785bad
Update Servo::handle_events to take IntoIterator (#30762) 2023-11-22 15:13:39 +00:00
Samson
7a5854693e
Retry packaged smoketest on mac (#30766) 2023-11-22 06:37:26 +00:00
dependabot[bot]
3be78096ef
build(deps): bump serde from 1.0.192 to 1.0.193 (#30764)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.192 to 1.0.193.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.192...v1.0.193)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-21 17:10:07 +00:00
Oriol Brufau
2b0a64b087 Update test expectations 2023-11-21 15:36:35 +01:00
Oriol Brufau
d74a16d2ed Disable formatting for malloc_size_of, servo_arc, to_shmem 2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
e18675401e style: Remove HasFFI as well
After the previous patches we only have one trait which we should also
tweak / rework, so let's put it all on that single trait.

Differential Revision: https://phabricator.services.mozilla.com/D177515
2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
42cbb9d3cf style: Remove HasSimpleFFI
It's completely unsused and we don't want to use it any time soon, see
bug 1831539 and related.

Differential Revision: https://phabricator.services.mozilla.com/D177497
2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
19e037d921 style: Remove HasBoxFFI
HasBoxFFI and HasArcFFI aren't great, see bug 1831242 as for examples of
why.

HasArcFFI requires a bit more care, but HasBoxFFI doesn't give us much
benefit. Instead use the same type in the FFI boundary.

Differential Revision: https://phabricator.services.mozilla.com/D177252
2023-11-21 15:36:35 +01:00
Oriol Brufau
1a49d8c79f Further changes required by Servo 2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
9ac97dd8ad style: when iterating over a selector to find a bucket, choose the rightmost
This restores the pre-regression behavior by choosing the later class in
cases where folks use stuff like `.foo.bar`.

This matches other browsers too.

Differential Revision: https://phabricator.services.mozilla.com/D177398
2023-11-21 15:36:35 +01:00
Boris Chiou
303ea410e2 style: Support self keyword for scroll()
`self` keyword specifies to use the element’s own principal box as the
scroll container. If the principal box is not a scroll container, then the
scroll progress timeline is inactive.

Differential Revision: https://phabricator.services.mozilla.com/D175707
2023-11-21 15:36:35 +01:00
Boris Chiou
f96c75c8d0 style: Update the syntax of scroll() to accept <scroller> and <axis> in any order
The order of <scroller> and <axis> doesn't matter in the parser.
However, we serialize <scroller> first, if it is not the initial value.

Differential Revision: https://phabricator.services.mozilla.com/D173906
2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
a27f477c7d style: Rework -x-text-zoom to allow disabling text zoom and min-font-size separately
And use it instead of explicit document checks. This centralizes where
we check for it.

IsChromeDoc is relatively cheap, but this bug wants to also check for
PDF.js which is a bit more expensive.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D176940
2023-11-21 15:36:35 +01:00