Commit graph

8856 commits

Author SHA1 Message Date
Oriol Brufau
0c36795e20 style: Evaluate size feature to unknown if the container lacks size containment
For example, inline elements may have container-type:size but they don't
support size containment, so @container(width >= 0) shouldn't match.

Differential Revision: https://phabricator.services.mozilla.com/D163936
2023-11-04 08:17:09 +01:00
Oriol Brufau
1beb9880a9 Further changes required by Servo 2023-11-04 08:17:09 +01:00
Jonathan Kew
6ea75b0646 style: Parse errors in individual @font-face src components should cause only the bad component to be dropped, not the entire descriptor
Differential Revision: https://phabricator.services.mozilla.com/D163810
2023-11-04 08:17:09 +01:00
Oriol Brufau
647d813c6b style: @container(width:0) shouldn't match elements with no box
Depends on D163879

Differential Revision: https://phabricator.services.mozilla.com/D163844
2023-11-04 08:17:09 +01:00
Oriol Brufau
6c02e9fdaa style: Implement Kleene logic for query feature expressions
Differential Revision: https://phabricator.services.mozilla.com/D163879
2023-11-04 08:17:09 +01:00
Oriol Brufau
748dd1eae2 style: Make container queries check content-box size
They were checking the border-box size (with paddings and borders), but
https://drafts.csswg.org/css-contain-3/#size-container says it should
be the content-box size.

Differential Revision: https://phabricator.services.mozilla.com/D163784
2023-11-04 08:17:09 +01:00
Oriol Brufau
f11e232a53 Further changes required by Servo 2023-11-04 08:17:09 +01:00
Oriol Brufau
7ec4c53266 style: Fix style containment not triggered by 'contain'
'container-type' and 'content-visibility' can trigger various kinds of
containment, but this was done via nsStyleDisplay::EffectiveContainment,
to avoid affecting the computed value of 'contain'.

This was fine except for style containment, which needs to set the flag
SELF_OR_ANCESTOR_HAS_CONTAIN_STYLE in order to really work, but this was
only done with 'contain: style'.

So this patch removes nsStyleDisplay::EffectiveContainment, and instead
uses two fields for containment: mContain and mEffectiveContainment.
This is somewhat analogous to mDisplay and mOriginalDisplay, though in
that case the computed value is the modified display.

Also fixes a typo in IsContainStyle() that made it return true for any
kind of containment, not just for style containment.

Differential Revision: https://phabricator.services.mozilla.com/D163779
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
60bd00980d style: Speed up dom iteration in querySelector
This removes a few branches and null-checks that I found in profiles.

Depends on D163627

Differential Revision: https://phabricator.services.mozilla.com/D163628
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
b6d9b77a15 style: Speed up selector matching with already-lowercase local name selectors
This makes relatively simple changes so that we check lowercase-ness of
local-name selectors first. If so, we don't need to check whether we're
an HTML element in an HTML document, which requires a fair bit of
pointer-chasing.

Differential Revision: https://phabricator.services.mozilla.com/D163627
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
dbba87d73e style: Implement Buttonborder/mark/marktext
Needs some extra test expectation updates.

Differential Revision: https://phabricator.services.mozilla.com/D157748
2023-11-04 08:17:09 +01:00
Mike Hommey
1a04ce81a6 style: Remove explicit rust target for bindgen in stylo
This doesn't seem necessary anymore. It was originally added to disable
unions, which is now done with disable_untagged_union.

Differential Revision: https://phabricator.services.mozilla.com/D163662
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
11313368ac style: Remove non-standard and unused system font values
And hide internal but used values. System fonts are not exposed in the
computed style so this should be fine.

If we need the old values for some obscure reason, it's trivial to alias
them to e.g., menu or so.

Differential Revision: https://phabricator.services.mozilla.com/D163269
2023-11-04 08:17:09 +01:00
Mike Hommey
bf593a81ed style: Upgrade bindgen to 0.63.0
Differential Revision: https://phabricator.services.mozilla.com/D163375
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
020ba9e749 style: Follow-up clean-ups and tweaks
<general-enclosed> should be handled in parse_in_parens.

Add some convenience functions to KleeneValue.

Differential Revision: https://phabricator.services.mozilla.com/D163214
2023-11-04 08:17:09 +01:00
Ziran Sun
bee44a5259 style: Add parsing for <general-enclosed> in queries conditions
See https://drafts.csswg.org/mediaqueries-5/#typedef-general-enclosed

Differential Revision: https://phabricator.services.mozilla.com/D158662
2023-11-04 08:17:09 +01:00
Oriol Brufau
a298c296e4 Further changes required by Servo 2023-11-04 08:17:09 +01:00
Connor Pearson
e55c03c8ff style: Implement CSS mod() and rem() functions
Differential Revision: https://phabricator.services.mozilla.com/D163166
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
653b37f80a style: Green up and re-enable style system layout tests
It's unclear to me when they were disabled, but we do want to enable
these as otherwise there's no way to catch bindgen issues that can end
up in subtle bugs at best, or memory corruption at worst.

Differential Revision: https://phabricator.services.mozilla.com/D162997
2023-11-04 08:17:09 +01:00
Thomas Wisniewski
62dddfb2a6 style: Alias -webkit-clip-path to clip-path for webcompat
Differential Revision: https://phabricator.services.mozilla.com/D162674
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
cc30a418a3 style: Remove unused -moz-window-frame appearance constants
Differential Revision: https://phabricator.services.mozilla.com/D162864
2023-11-04 08:17:09 +01:00
Ziran Sun
ea04827f05 style: Use root element font size for rem calculation in Container queries
Differential Revision: https://phabricator.services.mozilla.com/D162853
2023-11-04 08:17:09 +01:00
Ben Freist
4b9fc07522 style: [refactor] Migrate NS_STYLE_UNICODE_BIDI_* defines
Differential Revision: https://phabricator.services.mozilla.com/D162487
2023-11-04 08:17:09 +01:00
Oriol Brufau
f9c55a2971 style: Exclude 'size' from the 'all' shorthand
Differential Revision: https://phabricator.services.mozilla.com/D162568
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
63c3d36d28 style: Remove appearance: -moz-win-glass, which is unused
This we don't need to uplift.

Differential Revision: https://phabricator.services.mozilla.com/D162535
2023-11-04 08:17:09 +01:00
Oriol Brufau
d53696e452 Further changes required by Servo 2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
57da2712d0 style: Implement label[value] and start/end cropping with CSS rather than XUL layout
This reduces the weird interactions that can appear on menus.

This also progresses BiDi support, including for accesskeys.

Differential Revision: https://phabricator.services.mozilla.com/D161498
2023-11-04 08:17:09 +01:00
Ziran Sun
aee17ed05c style: container-queries: Stop restrict none/auto/normal from <custom-ident>
Differential Revision: https://phabricator.services.mozilla.com/D161764
2023-11-04 08:17:09 +01:00
Ben Freist
717e4acefb style: [refactor] Migrate NS_STYLE_TEXT_COMBINE_UPRIGHT_* defines
Differential Revision: https://phabricator.services.mozilla.com/D161965
2023-11-04 08:17:09 +01:00
Connor Pearson
2a7055a8ff style: Remove unused std::ops::Rem implementations
Differential Revision: https://phabricator.services.mozilla.com/D161844
2023-11-04 08:17:09 +01:00
Emilio Cobos Álvarez
91626808e9 style: Remove display: -moz-popup
We already rely on it applying only to XULPopupElement's. Make it
explicit and remove the CSS value.

Differential Revision: https://phabricator.services.mozilla.com/D161552
2023-11-04 08:17:09 +01:00
Martin Robinson
f4d3af296c Move *_traits and other shared types to shared
This is the start of the organization of types that are in their own
crates in order to break dependency cycles between other crates. The
idea here is that putting these packages into their own directory is the
first step toward cleaning them up. They have grown organically and it
is difficult to explain to new folks where to put new shared types. Many
of these crates contain more than traits or don't contain traits at all.

Notably, `script_traits` isn't touched because it is vendored from
Gecko. Eventually this will move to `third_party`.
2023-11-03 15:38:18 +00:00
Emily McDonough
8193fb3985 style: Check that we do not insert more than MAX_GRID_LINE subgrid line name lists while constructing the list
This helps avoid OOM with very large repeats.

Differential Revision: https://phabricator.services.mozilla.com/D161533
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
e520c3796d style: Make panel animations a LookAndFeel int
This will allow us to enable panel animations in some Linux
configurations but not others. Also, it's cleaner.

Differential Revision: https://phabricator.services.mozilla.com/D161693
2023-11-03 08:59:49 +01:00
Oriol Brufau
a4d2beecd3 Further changes required by Servo 2023-11-03 08:59:49 +01:00
Connor Pearson
6a4a97ad7c style: Implement CSS round() function
Co-Authored-By: Emilio Cobos Álvarez <emilio@crisal.io>

Differential Revision: https://phabricator.services.mozilla.com/D156742
2023-11-03 08:59:49 +01:00
Jonathan Kew
17d33183c2 style: Fix serialization of the font-variant shorthand when font-variant-emoji is preffed off
Depends on D160256

Differential Revision: https://phabricator.services.mozilla.com/D160257
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
8ffe78e511 style: Don't bother preserving authored colors for canvas
Differential Revision: https://phabricator.services.mozilla.com/D161266
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
81ae588ec9 style: Fix container query evaluation on unsupported axis
We were falling back to viewport size, which is not what the spec says.

Differential Revision: https://phabricator.services.mozilla.com/D161132
2023-11-03 08:59:49 +01:00
Ziran Sun
aba0a4bce0 style: Only a single name allowed in @container rule
Differential Revision: https://phabricator.services.mozilla.com/D158775
2023-11-03 08:59:49 +01:00
Jonathan Watt
2c1799a8df style: Rename page::PageOrientation to page::PageSizeOrientation
The @page rule may contain both 'page-orientation' and 'size' properties. The
'size' property can contain an orientation component which was being
represented as 'PageOrientation' prior to this patch. This patch changes that
to 'PageSizeOrientation' so that 'PageOrientation' can be used for
'page-orientation' in a subsequent patch.

Differential Revision: https://phabricator.services.mozilla.com/D160790
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
b2ab136cd9 style: Simplify container-type implementation
It was made a bitfield so that we could include style. But then style
containment was removed and the bitfield keeps causing us to do wrong
check (since INLINE_SIZE intersects SIZE).

So just make it an enum. This causes a progression and a test that
failed now times out (which is a pre-existing issue, just like the
pseudo-elements test that times out).

Differential Revision: https://phabricator.services.mozilla.com/D160371
2023-11-03 08:59:49 +01:00
Oriol Brufau
8a5ba3fe16 Further changes required by Servo 2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
efdf518acc style: Remove system font support for various font longhands
We don't use them[1], and these are generally not properties that
authors would be able to set via the font shorthand anyways.

Let's simplify the code. This fixes the font-variant bug and also
unblocks further clean-ups of these properties in the future.

[1]: https://searchfox.org/mozilla-central/rev/59f0bf3c13dd455d9f5415b89178de701ea6b850/widget/LookAndFeelTypes.ipdlh#12-18

Differential Revision: https://phabricator.services.mozilla.com/D160352
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
3c4d198ad7 style: Don't propagate bits for children invalidated under display:none/not in the flat tree
Much like invalidated_descendants. This preserves our invariant that we
only visit elements with data in the post-traversal.

Differential Revision: https://phabricator.services.mozilla.com/D160338
2023-11-03 08:59:49 +01:00
sskcvqikf
8dcf5cddca style: Change NS_STYLE_MATH_STYLE_* macros to enum StyleMathStyle
Differential Revision: https://phabricator.services.mozilla.com/D160016
2023-11-03 08:59:49 +01:00
Jonathan Kew
8149cd4a0c style: Add support for the CSS font-variant-emoji property to the style system
Differential Revision: https://phabricator.services.mozilla.com/D147494
2023-11-03 08:59:49 +01:00
David Shin
14eece6f5a style: Container Relative Units: Set flag for USES_VIEWPORT_UNITS only when viewport fallback is actually used
Differential Revision: https://phabricator.services.mozilla.com/D159866
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
15cf28815e style: Invalidate viewport units on container-queries properly
By re-selector-matching the element (thus re-evaluating the container
query condition).

Depends on D159852

Differential Revision: https://phabricator.services.mozilla.com/D159853
2023-11-03 08:59:49 +01:00
Oriol Brufau
b8c0a898ad Further changes required by Servo 2023-11-03 08:59:49 +01:00