Commit graph

47219 commits

Author SHA1 Message Date
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
Tiaan Louw
a6b97563c3 style: Add negate node to use in place of mul_by in sum nodes
Sum nodes would use mul_by to negate nodes to do subtraction, but some
nodes are not distributive.  This patch adds a negate node, so that the
operations inside these negate nodes can be resolved first and then the
"subtraction" can be applied.

Differential Revision: https://phabricator.services.mozilla.com/D172941
2023-11-21 15:36:35 +01:00
Boris Chiou
9fd6f09a41 style: Add animation-timeline: view() in style system
Support view() notation for animation-timeline:
  `<view()> = view( [ <axis> || <'view-timeline-inset'> ]? )`

We move AnimationTimeline and its related types into the generics folder,
and define two new structs for scroll() and view().

Note:
1. The syntax of scroll() doesn't match the current version of the spec.
    I will update it in Bug 1814444.
2. We will handle the creation/usage of the Anonymous View Progress Timelines
    in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D173904
2023-11-21 15:36:35 +01:00
Oriol Brufau
115a45f8eb Further changes required by Servo 2023-11-21 15:36:35 +01:00
Boris Chiou
b1bcb22650 style: Move animation-related values from box.rs/ui.rs to animation.rs
Although we store animation and transition style values in StyleUIReset and
define their properties in longhands/ui.mako.rs, but we may move them in
the future if this style struct becomes too large. So let's move the
definition of their values to an independent module, animation, so we
don't have to worry about this again.

This patch doesn't change any other things. Only move code.

Differential Revision: https://phabricator.services.mozilla.com/D173903
2023-11-21 15:36:35 +01:00
Oriol Brufau
1816d7750f Further changes required by Servo 2023-11-21 15:36:35 +01:00
CanadaHonk
a5b85ec834 style: Refactor ImportLayer into enum
Refactored ImportLayer into an enum instead of a struct and using
Option everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D176793
2023-11-21 15:36:35 +01:00
CanadaHonk
2e713d4366 style: Serialize NaN and infinity percentages correctly
NaN and infinity percentages are now serialized as expected.

Also added some new WPT tests as percentages were previously untested
and added some spec comments to previous NaN/inf serialization code.

Differential Revision: https://phabricator.services.mozilla.com/D176726
2023-11-21 15:36:35 +01:00
Oriol Brufau
d44f772dc3 Further changes required by Servo 2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
6f090b8a85 style: [css-nesting] Update cssparser to allow parsing qualified rules along with declaration
No implementation just yet (the default QualifiedRuleParser
implementation just rejects stuff), but this is plumbing that I'd rather
get reviewed separately.

Differential Revision: https://phabricator.services.mozilla.com/D176686
2023-11-21 15:36:35 +01:00
Emilio Cobos Álvarez
93e0711194 style: [css-nesting] Process nested rules at cascade data rebuild
More nesting plumbing. Still does nothing because we don't parse the
nested rules.

Should be trivial to prove this patch doesn't change any behavior so
far, but I want to land it on its own because it can have performance
implications.

This follows the pattern of what we do with other rules like layers and
container conditions, that is, keep the ancestor selectors in a stack,
and poke at the last one in order to replace the ancestor.

This changes the behavior of replace_parent_selector as with the newer
version of the spec, stuff like:

  div {
    .foo {
      stuff
    }
  }

Should work as `div .foo`. A test is added for this case.

Differential Revision: https://phabricator.services.mozilla.com/D176560
2023-11-21 15:36:35 +01:00
Oriol Brufau
f9a48e15aa Further changes required by Servo 2023-11-21 15:36:35 +01:00