Commit graph

46888 commits

Author SHA1 Message Date
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
Emilio Cobos Álvarez
8a63d9e059 style: Simplify our setup for font metric queries from style
While looking at moving the flag around I realized that the only reason
we have FontMetricsProvider and co is because we didn't have access to
the per-document font-prefs cache. That's trivial to fix tho, so do
that and simplify the setup for font queries even more.

Differential Revision: https://phabricator.services.mozilla.com/D157589
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
99d588a90e style: Honor currentColor in HCM
I think it's fair to honor it, just like we honor system color keywords.

By definition if we're forcing colors currentColor can only be forced or
a system color.

Differential Revision: https://phabricator.services.mozilla.com/D157675
2023-11-03 08:59:49 +01:00
Ziran Sun
f1bf68ef25 style: Rename initial value of `container-type' from 'none' to 'normal'
Differential Revision: https://phabricator.services.mozilla.com/D157098
2023-11-03 08:59:49 +01:00
Ziran Sun
3fc54c24e2 style: Disallow 'not', 'and', and 'or' from <container-name>
Differential Revision: https://phabricator.services.mozilla.com/D156805
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
f9f5283a65 style: React to font-size changes on query containers
Much like we react to font-size changes on the root.

Differential Revision: https://phabricator.services.mozilla.com/D157173
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
00c9d9d033 style: Add CSSContainerRule.queryContainerFor(Element)
This actually caught a bug in the existing selection logic.

Differential Revision: https://phabricator.services.mozilla.com/D156414
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
ccad16b560 style: Allow backplating if there's a background-image which is none
Differential Revision: https://phabricator.services.mozilla.com/D156756
2023-11-03 08:59:49 +01:00
Oriol Brufau
3cad1db7f9 Further changes required by Servo 2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
b7773d02d2 style: Make anonymous box wrapping inside XUL boxes be similar to modern flex boxes
I haven't spotted any UI regression from this, and this should generally
make the XUL -> modern flex transition easier, and simplify some
of the relevant code.

This does fix a few layout issues with emulated flexbox.

For the most part, this shouldn't change behavior without that. This
changes behavior if you have mixed inline/non-inline content in the same
XUL box (before they'd get a single item, now you'd get the flexbox /
grid behavior of one item per inline run), and multiple inline-elements
(which would become their own flex items). But I pushed a patch with
some asserts and they didn't fire on our browser mochitests, so I think
we're good.

The UA rule refactoring (removing the inherit from xul anon blocks)
shouldn't matter in practice, since we only have one item (so
box-ordinal is irrelevant) and they have overflow: visible (so
text-overflow and overflow-clip-box shouldn't have an effect).

Differential Revision: https://phabricator.services.mozilla.com/D156375
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
319dca5351 style: Remove layout.css.webkit-line-clamp.enabled, and add a new pref to apply line-clamp to all BFCs
It's always true, so remove it.

Add another pref to allow -webkit-line-clamp to work on all blocks
rather than just legacy -webkit-boxes, which seems something we should
try to look into, eventually.

Depends on D155181

Differential Revision: https://phabricator.services.mozilla.com/D155182
2023-11-03 08:59:49 +01:00
Oriol Brufau
6dafc18b67 Further changes required by Servo 2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
0dfd45ba21 style: Make -webkit-line-clamp create a block container in the appropriate situations
This is a hack, sorta, similar to Chromium's:

  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/layout_object.cc;l=356;drc=312b74e385e6aba98ab31fd911238c0dc16b396c

except at computed-value rather than used-value time, because it's both
simpler to reason about and prevents lying in the computed style.

This fixes the relevant test-case, and matches closer what Chromium does,
by not creating anonymous flex items for all elements inside the
line-clamp context.

The behavior change is covered by the test changes. I had to also fix a
couple pre-existing bugs that were caught by tests, now that the
line-clamped block is the -webkit-box-styled element rather than an anonymous
flex item (and thus now had padding).

Depends on D155180

Differential Revision: https://phabricator.services.mozilla.com/D155181
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
069304c99c style: Remove @supports selector pref. r=firefox-style-system-reviewers,layout-reviewers,boris
We've shipped it for a while.

Differential Revision: https://phabricator.services.mozilla.com/D156469
2023-11-03 08:59:49 +01:00
Oriol Brufau
98d10f954b Further changes required by Servo 2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
9f6341b83a style: Disallow forgiving selector-parsing in @supports
As per spec, see https://github.com/w3c/csswg-drafts/issues/7280

Differential Revision: https://phabricator.services.mozilla.com/D156468
2023-11-03 08:59:49 +01:00
Frederic Wang
ab36c8a39b style: Make maction/semantics elements behave as an mrow with the first child
See https://groups.google.com/forum/#!topic/mozilla.dev.platform/BWUvjERSXUM

Differential Revision: https://phabricator.services.mozilla.com/D49285
2023-11-03 08:59:49 +01:00
Frederic Wang
2edb151782 style: Do not reset font-weight/font-style when mathvariant is specified
In the past, mathvariant was cancelling the effect of legacy
fontstyle/fontweight attributes by resetting the font-style/font-weight
properties. These legacy attributes have been removed in bug 1783841,
so remove this hack from Stylo and add corresponding WPT test.

Differential Revision: https://phabricator.services.mozilla.com/D156174
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
d130831877 style: Fix typo to avoid devtools property-db failures
MANUAL PUSH: Orange fix CLOSED TREE
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
a44db17432 style: Move line-clamp out of mako and do some adjacent clean-up
No behavior change, but simplifies the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D155180
2023-11-03 08:59:49 +01:00
Jonathan Kew
3fa76ff2e8 style: Update font-tech feature-* keywords to features-*, as per editorial fix in the spec
Differential Revision: https://phabricator.services.mozilla.com/D155962
2023-11-03 08:59:49 +01:00
Oriol Brufau
5c3e8cade4 Further changes required by Servo 2023-11-03 08:59:49 +01:00
Frederic Wang
f196c19106 style: Use ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants
The math-depth implementation is refined to take into account the
ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants (if the
parent's first valid font has a MATH table) in order to calculate the
scale factor between math-deth 0 and 1, and between 0 and 2 respectively.

Behavior is unchanged if the legacy scriptsizemultiplier attribute is
specified or if no MATH table is available.

The preference layout.css.math-depth.enabled remains disabled in nightly
until the remaining bit (support for font-size: math) is implemented in
bug 1667090.

Differential Revision: https://phabricator.services.mozilla.com/D91604
2023-11-03 08:59:49 +01:00
AW255
12a2c88605 style: 0% values are not skipped when parsing CSS transform
Adds trait ZeroNoPercent to check for values that are 0 (such as 0px) but not 0%

Updated test css/css-transforms/animation/translate-interpolation.html and removed unnecessary formatting changes

Differential Revision: https://phabricator.services.mozilla.com/D154930
2023-11-03 08:59:49 +01:00
Emilio Cobos Álvarez
aefbae5f96 style: Improve CSS OM for CSSContainerRule
This implements https://github.com/w3c/csswg-drafts/pull/7293, pending a
spec resolution, so landing test as tentative for now, but the change
makes sense.

Differential Revision: https://phabricator.services.mozilla.com/D155602
2023-11-03 08:59:49 +01:00
Mukilan Thiyagarajan
b268936308
ci: use ubuntu 22.04 on linux runners (#30162)
* ci: use ubuntu 22.04 on linux runners

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Add env fix

* update expectations for tests under ubuntu-22.04

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2023-11-03 05:42:44 +00:00