Commit graph

47363 commits

Author SHA1 Message Date
Samson
fd5f04c18e Use runner provided python 2023-11-03 16:41:26 +00: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
Martin Robinson
863529d962 Mark two css-paint-api tests as a flaky PASS, TIMEOUT 2023-11-03 15:21:11 +00:00
Oriol Brufau
22f877c6ab Update test expectations 2023-11-03 08:59:49 +01: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
Emilio Cobos Álvarez
5ded58a2b1 style: Allow propagating computed style bits from the selector-matching process
This allows us to propagate flags from the container query styles all the
way to the computed style of the element.

The flag for viewport units in container queries has to be different
because it requires rematching, see comments.

Depends on D159851

Differential Revision: https://phabricator.services.mozilla.com/D159852
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
bfa293c5c5 style: Split in_media_query and in_container_query bits from computed::Context
No behavior change, but it makes more sense this way :)

Differential Revision: https://phabricator.services.mozilla.com/D159851
2023-11-03 08:59:49 +01:00
Oriol Brufau
d21aa99252 Further changes required by Servo 2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
a62f6c78b2 style: Make a wrapper struct for extra matching data
No behavior change but we're about to add some extra field to it.

Differential Revision: https://phabricator.services.mozilla.com/D159850
2023-11-03 08:59:49 +01:00
Ziran Sun
b89c2be4bd style: @container rules should support not without parentheses
We are currently detect 'not' as part of the container-name.

Differential Revision: https://phabricator.services.mozilla.com/D159836
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
f14f1fa440 style: fix invalidation of sibling combinators in different slots
This extends the code to deal with sibling invalidation to handle the
case where the flat tree doesn't match the DOM tree. In the test-case
for example, dom is:

  * details
    * summary id=a
    * summary

But flat tree is:

  * details
  * slot
    * summary id=a
  * slot
    * summary

Differential Revision: https://phabricator.services.mozilla.com/D159150
2023-11-03 08:59:49 +01:00
David Shin
6cb665df95 style: Rematch all descendants when container-type changes
Extend WPT to ensure invalidation of descendants deeper than one.

Differential Revision: https://phabricator.services.mozilla.com/D158058
2023-11-03 08:59:49 +01:00
David Shin
27958b191a style: Enable lookup and computation of container size queries
Differential Revision: https://phabricator.services.mozilla.com/D158057
2023-11-03 08:59:49 +01:00
David Shin
5cbb81a0df style: Flag computed styles of elements with container-type: *size set & propagate them to their descendants
Low-hanging fruit optimization that enables short-circuit exit of container query lookups.

Differential Revision: https://phabricator.services.mozilla.com/D158056
2023-11-03 08:59:49 +01:00
David Shin
3acb103324 style: Centralize construction of computed::Context
For controlled construction and access of upcoming, lazily-evaluated container query size.

Differential Revision: https://phabricator.services.mozilla.com/D158055
2023-11-03 08:59:49 +01:00
David Shin
d8785f3a22 style: Implement parsing of container relative lengths
- For now, implementation always returns the fallback value, i.e. small viewport lengths.
- Enabled via existing pref `layout.css.container-queries.enabled`.

Differential Revision: https://phabricator.services.mozilla.com/D158054
2023-11-03 08:59:49 +01:00
Anurag Kalia
4dd841a036 style: Make vertical writing mode (left/right) in text-emphasis-position optional
Differential Revision: https://phabricator.services.mozilla.com/D158399
2023-11-03 08:59:49 +01:00
Frederic Wang
d4742aefb9 style: disable lquote/rquote attributes on the <ms> element
This commit introduces a MathML preference for the legacy implementation
of the lquote/rquote attributes, and disable it by default. This feature
is not implemented in Chromium or WebKit, not part of MathML Core and
Firefox's implementation has issues (e.g. bugs 787215 and 1108608).

Differential Revision: https://phabricator.services.mozilla.com/D158479
2023-11-03 08:59:49 +01:00
Oriol Brufau
444dc23e00 Further changes required by Servo 2023-11-03 08:59:49 +01:00
Jonathan Kew
fc10c64779 style: Connect CSS font-palette features to rendering via the presContext
Differential Revision: https://phabricator.services.mozilla.com/D157959
2023-11-03 08:59:49 +01:00
Oriol Brufau
d5e3a4e3a6 Further changes required by Servo 2023-11-03 08:59:49 +01:00
Jonathan Kew
6a98b777e0 style: CSS support for the font-palette property
This is just the CSS parsing, not yet connected to the rendering back-end.

Differential Revision: https://phabricator.services.mozilla.com/D157957
2023-11-03 08:59:49 +01:00
Oriol Brufau
38caec4f89 Further changes required by Servo 2023-11-03 08:59:49 +01:00
Jonathan Kew
a4ad5e19b0 style: Implement CSS parsing for the @font-palette-values rule
Not yet hooked up to any rendering functionality.

The intention is for both the @font-palette-values at-rule and the font-palette property
to be behind the same pref being introduced here.

Differential Revision: https://phabricator.services.mozilla.com/D157953
2023-11-03 08:59:49 +01:00
Ting-Yu Lin
ab4580e112 style: More rename and clean up related to StyleClear
* Rename `mBreakType` to `mFloatClearType` in nsLineBox and nsReflowStatus and
  the methods around it.
* Rename `mBreakType` to `mClear` in nsStyleDisplay.
* Many other method parameters or local variables rename such as from
  `aBreakType` to `aClearType`.

Differential Revision: https://phabricator.services.mozilla.com/D158276
2023-11-03 08:59:49 +01:00
Ting-Yu Lin
fea3f9fbc1 style: Move clear property out of gecko.mako.rs
Differential Revision: https://phabricator.services.mozilla.com/D158225
2023-11-03 08:59:49 +01:00
Ting-Yu Lin
f4e10192ca style: Remove StyleClear::Line
Before this patch, StyleClear::Line indicates that the nsLineBox has break-after
but no float clearance (note we don't allow line break-before with clear:none);
StyleClear::None indicates the line has no break-before nor break-after.

In this patch, I added `mHasForcedLineBreak` bit in nsLineBox to indicate the
line has a break so that StyleClear can serve its original meaning -- the float
clearance. In Part 6, I'll rename more existing methods and variables related to
float clearance.

Now, instead of using StyleClear::None to clear the line break status, the
caller should use ClearForcedLineBreak(); Similar to set
SetInlineLineBreakBeforeAndReset() and SetInlineLineBreakAfter on
nsReflowStatus, SetBreakTypeBefore/SetBreakTypeAfter on nsLineBox always sets
break status with an optional float clearance parameter.

This patch shouldn't change the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D158224
2023-11-03 08:59:49 +01:00
Ting-Yu Lin
3da52edffc style: Run "cargo +nightly fmt" for style components in servo
The directories changed:
* servo/components/selectors/
* servo/components/style/
* servo/components/style_derive/
* servo/ports/geckolib/

Per review request, disable rustfmt in `components_to_transform_3d_matrix()` to
preserve the format for a call to `Transform3D::new`.

My mozilla-central is at
https://hg.mozilla.org/mozilla-central/rev/d1ae84015c22f2034435b47194fdced878072035

My nightly rust is 1.66.0-nightly (8b705839c 2022-09-26).

Differential Revision: https://phabricator.services.mozilla.com/D158234
2023-11-03 08:59:49 +01:00
Anurag Kalia
1a9198a5ef style: Convert text-emphasis-position #defines to enum classes
Differential Revision: https://phabricator.services.mozilla.com/D155557
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
6cfdd989d5 style: Implement <tabpanels> and <deck> without XUL layout
Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.

As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).

For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.

For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.

Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.

Differential Revision: https://phabricator.services.mozilla.com/D157875
2023-11-03 08:59:49 +01:00
Oriol Brufau
6fa8160633 Further changes required by Servo 2023-11-03 08:59:49 +01:00
Boris Chiou
de396d9766 style: Drop @scroll-timeline rule entirely
This rule is not used in tests and should be removed per spec.

Differential Revision: https://phabricator.services.mozilla.com/D157249
2023-11-03 08:59:49 +01:00
Boris Chiou
4b736595d7 style: Drop the usage of @scroll-timeline from animation builder
@scroll-timeline rule was removed from the spec and wpt, so it's safe to
remove this from Gecko.

Differential Revision: https://phabricator.services.mozilla.com/D157248
2023-11-03 08:59:49 +01:00