Commit Graph

1447 Commits

Author SHA1 Message Date
David Shin
c291c3a105 Bug 1958914: Treat AnchorResolved-using types as instantiations, not subtypes. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D244658
2025-04-08 02:29:19 +00:00
David Shin
85c922b0dd Bug 1923959: Resolve anchor for (max) sizes. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D240864
2025-04-08 02:29:18 +00:00
David Shin
40e6a5c66e Bug 1923959: Resolve anchor for margins. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D240863
2025-04-08 02:29:18 +00:00
David Shin
9dcac8482f Bug 1957747: Remove ResolveWithAnchor. r=firefox-style-system-reviewers,emilio
Since we're replacing anchor functions in calc nodes in advance, we only need
to resolve percentage bases.

Differential Revision: https://phabricator.services.mozilla.com/D244082
2025-04-02 21:30:54 +00:00
Daniel Holbert
bb9006d664 Bug 1956578: Preserve the min-width/min-height 'auto' value in getComputedStyle, for elements with non-default 'aspect-ratio'. r=TYLin
This is the behavior that was resolved on in
https://github.com/w3c/csswg-drafts/issues/11716

I'm including a WPT that exercises a bunch of different cases where 'auto' is
or isn't preserved in getComputedStyle.

Differential Revision: https://phabricator.services.mozilla.com/D243234
2025-03-31 16:21:19 +00:00
Emilio Cobos Álvarez
b14be4c008 Bug 1954145 - Make the IS_IN_PSEUDO_ELEMENT_SUBTREE flag more specific. r=dshin
We only need it for ::first-line (and things inheriting from it) really.

Differential Revision: https://phabricator.services.mozilla.com/D241659
2025-03-17 13:23:51 +00:00
Emilio Cobos Álvarez
b042e3fda6 Bug 1951562 - Do not return used border-width values from getComputedStyle(). r=layout-reviewers,dholbert
border-*-width is not on the list of properties with resolved values:
https://drafts.csswg.org/cssom-1/#resolved-values

This used to be more useful when our buttons and so on didn't respect
the UA sheet borders.

Let's try to do this? Otherwise we should file a bug to change the spec.

Differential Revision: https://phabricator.services.mozilla.com/D240312
2025-03-04 15:25:41 +00:00
David Shin
44a8158034 Bug 1947482: Anchor resolution takes axis, not side. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D238962
2025-02-20 21:22:10 +00:00
Alexandru Marc
3cc336f1e0 Backed out changeset 4d1903e35fc5 (bug 1947482) for causing build bustages @ ServoStyleConstsInlines.h 2025-02-20 21:34:50 +02:00
David Shin
894d84866a Bug 1947482: Anchor resolution takes axis, not side. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D238962
2025-02-20 18:26:22 +00:00
Otto Länd
1850172898 Bug 1942715: apply code formatting via Lando
# ignore-this-changeset
2025-02-12 01:46:16 +00:00
David Shin
4dc4e2d920 Bug 1942715: Part 4 - Switch to using a more transparent wrapper. r=firefox-style-system-reviewers,emilio
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.

Differential Revision: https://phabricator.services.mozilla.com/D237097
2025-02-12 01:31:30 +00:00
David Shin
72e65118b1 Bug 1942715: Part 2 - Use the new resolution path for resolving anchor functions in math functions for insets. r=firefox-style-system-reviewers,emilio
Try to resolve math function nodes with percentage basis of zero. Invalid
anchor functions will make the value Invalid-At-Computed-Value-Time (i.e.
`auto`), so that is handled. Otherwise, `CalcNode` existing indicates use
of percentage values and/or anchor functions. If only anchor functions
are used, we can use the resolved value as-is - otherwise, it must be
re-resolved before its value is queried.
This is of course redundant, and may require some optimization down
the line (We don' eagerly get percentage basis since that requires
ancestor traversal that may be wasted).

Differential Revision: https://phabricator.services.mozilla.com/D237095
2025-02-12 01:31:29 +00:00
Butkovits Atila
e51ff081c6 Backed out 6 changesets (bug 1942715) for causing build bustages. CLOSED TREE
Backed out changeset 1433202bd2f3 (bug 1942715)
Backed out changeset d9ce2be09cd0 (bug 1942715)
Backed out changeset 9789581a42a3 (bug 1942715)
Backed out changeset 9a18f1aca5d5 (bug 1942715)
Backed out changeset 46bd0cb031f4 (bug 1942715)
Backed out changeset 73fec8bae045 (bug 1942715)
2025-02-12 01:45:46 +02:00
Otto Länd
49c107da21 Bug 1942715: apply code formatting via Lando
# ignore-this-changeset
2025-02-11 23:20:36 +00:00
David Shin
c536f3deb5 Bug 1942715: Part 4 - Switch to using a more transparent wrapper. r=firefox-style-system-reviewers,emilio
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.

Differential Revision: https://phabricator.services.mozilla.com/D237097
2025-02-11 21:06:24 +00:00
David Shin
aada1ca6dd Bug 1942715: Part 2 - Use the new resolution path for resolving anchor functions in math functions for insets. r=firefox-style-system-reviewers,emilio
Try to resolve math function nodes with percentage basis of zero. Invalid
anchor functions will make the value Invalid-At-Computed-Value-Time (i.e.
`auto`), so that is handled. Otherwise, `CalcNode` existing indicates use
of percentage values and/or anchor functions. If only anchor functions
are used, we can use the resolved value as-is - otherwise, it must be
re-resolved before its value is queried.
This is of course redundant, and may require some optimization down
the line (We don' eagerly get percentage basis since that requires
ancestor traversal that may be wasted).

Differential Revision: https://phabricator.services.mozilla.com/D237095
2025-02-11 21:06:23 +00:00
Butkovits Atila
fd3125f8e5 Backed out 6 changesets (bug 1942715) for causing build bustages. CLOSED TREE
Backed out changeset 7c5cfe6bbaeb (bug 1942715)
Backed out changeset cc5530b02046 (bug 1942715)
Backed out changeset 5a534f455cc3 (bug 1942715)
Backed out changeset ecdd7307c9f1 (bug 1942715)
Backed out changeset 05a62c484807 (bug 1942715)
Backed out changeset a9825ee69550 (bug 1942715)
2025-02-11 22:17:26 +02:00
Otto Länd
1110401843 Bug 1942715: apply code formatting via Lando
# ignore-this-changeset
2025-02-11 19:39:31 +00:00
David Shin
96712d3db0 Bug 1942715: Part 4 - Switch to using a more transparent wrapper. r=firefox-style-system-reviewers,emilio
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.

Differential Revision: https://phabricator.services.mozilla.com/D237097
2025-02-11 18:19:56 +00:00
David Shin
c69b19f02a Bug 1942715: Part 2 - Use the new resolution path for resolving anchor functions in math functions for insets. r=firefox-style-system-reviewers,emilio
Try to resolve math function nodes with percentage basis of zero. Invalid
anchor functions will make the value Invalid-At-Computed-Value-Time (i.e.
`auto`), so that is handled. Otherwise, `CalcNode` existing indicates use
of percentage values and/or anchor functions. If only anchor functions
are used, we can use the resolved value as-is - otherwise, it must be
re-resolved before its value is queried.
This is of course redundant, and may require some optimization down
the line (We don' eagerly get percentage basis since that requires
ancestor traversal that may be wasted).

Differential Revision: https://phabricator.services.mozilla.com/D237095
2025-02-11 18:19:55 +00:00
David Shin
3d615cb7f6 Bug 1923763: Part 5 - Replace inset evaluations with anchor-resolved inset evaluations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231259
2025-01-21 15:11:25 +00:00
Stanca Serban
4a35296e0c Backed out 7 changesets (bug 1923763) for causing build bustages in nsStyleStruct.cpp. CLOSED TREE
Backed out changeset d55070e64ced (bug 1923763)
Backed out changeset a92a0bc6047f (bug 1923763)
Backed out changeset 2203e2c5268e (bug 1923763)
Backed out changeset 0cc5e744c01a (bug 1923763)
Backed out changeset d2139afa933b (bug 1923763)
Backed out changeset 93e59980eac1 (bug 1923763)
Backed out changeset 8018734b5491 (bug 1923763)
2025-01-21 11:10:22 +02:00
David Shin
6b9f17e7ff Bug 1923763: Part 5 - Replace inset evaluations with anchor-resolved inset evaluations. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D231259
2025-01-20 23:54:50 +00:00
Boris Chiou
dac5d98343 Bug 1921553 - Use PseudoStyleRequest in EffectSet. r=view-transitions-reviewers,layout-reviewers,emilio
Use `PseudoStyleRequest` in the APIs of EffectSet. We would like to
store the animation in the originating element, so need to use
`PseudoStyleRequest`.

Differential Revision: https://phabricator.services.mozilla.com/D228226
2024-11-25 23:46:32 +00:00
Boris Chiou
b6c240ef4c Bug 1921553 - Use PseudoStyleRequest in nsCSSPseudoElements. r=view-transitions-reviewers,layout-reviewers,emilio
And some related code, such as `KeyframeEffectParams` and
`IsSupportedPseudoForAnimations()`.

Note: `GetPseudoAtom()` and `GetPseudoType()` are redundant, so remove them.

Differential Revision: https://phabricator.services.mozilla.com/D228224
2024-11-25 23:46:31 +00:00
Boris Chiou
30af2312c9 Bug 1921553 - Use PseudoStyleRequest in AnimationUtils and EffectCompositor. r=view-transitions-reviewers,layout-reviewers,emilio
Basically, we'd like to separate the originating element and its pseudo
element request in Animation code (for better compatibility with Web
Animations APIs and other pseudo types), and store the animations and
keyframe effects in the origninating element as well.

In this patch, we reuse `Element::GetPseudoElement()`, and update the
function signatures in EffectCompositor and RestyleManager.

All the following patches will replace more places with
`PseudoStyleRequest`.

Differential Revision: https://phabricator.services.mozilla.com/D228223
2024-11-25 23:46:31 +00:00
Martin Robinson
9dac591f84 Bug 1918856 - Do serialization of computed border-spacing in stylo r=emilio
Reland of D222204: This fixes an issues in
`test_transitions_per_property.html` where `border-spacing` was assumed
to serialize to `0px 0px`. It follows the pattern used by other
properties that do not serialize this way.

Differential Revision: https://phabricator.services.mozilla.com/D227460
2024-11-01 15:37:36 +00:00
Butkovits Atila
4c51398e77 Backed out changeset 22da217ea4e5 (bug 1918856) for causing failures at test_transitions_per_property.html. 2024-10-29 22:16:35 +02:00
Martin Robinson
810d24eafa Bug 1918856 - Do serialization of computed border-spacing in stylo r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D222204
2024-10-29 17:57:17 +00:00
serge-sans-paille
262f78c07f Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Alexandru Marc
a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
Boris Chiou
2cb4814131 Bug 1922315 - Replace the tuple of PseudoStyleType and nsAtom with PseudoStyleRequest. r=view-transitions-reviewers,emilio
We introduce PseudoStyleRequest, which contains `PseudoStyleType` and
`nsAtom*`, and I tried to replace the tuple of `PseudoStyleType` and
`nsAtom*` in nsComputedDOMStyle.

Also, for the animation part, let's leave them to Bug 1921553.

There is no behavior change to end users. Only do refactoring code.

Differential Revision: https://phabricator.services.mozilla.com/D226710
2024-10-24 22:34:22 +00:00
serge-sans-paille
07101ac24d Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc
004e704b22 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
2c916d4973 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
David Shin
e52d21fa25 Bug 1900232: Part 5 - Add anchor-size() to sizing properties. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D222534
2024-09-23 13:58:38 +00:00
David Shin
1fad4eeb43 Bug 1900232: Part 4 - Add anchor-size() to margin properties. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D222533
2024-09-23 13:58:38 +00:00
David Shin
41f83d368b Bug 1900232: Part 2 - Create one place to shim inset getters. r=firefox-style-system-reviewers,emilio
... Instead of handling `anchor()` function at each site manually.

Differential Revision: https://phabricator.services.mozilla.com/D222531
2024-09-23 13:58:37 +00:00
David Shin
6a51a65195 Bug 1900230: Implement parsing of anchor() function in inset properties. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D220285
2024-09-10 14:11:15 +00:00
Daniel Holbert
a8c637281f Bug 1909773 part 4: Add support for '-webkit-fill-available' as an alias for the CSS 'stretch' behavior (off-by-default for now). r=emilio
Both '-webkit-fill-available' and 'stretch' are equivalent to '-moz-available'
at this point in the patch series, and both are off-by-default, because
actually supporting them would require that we add special logic to handle them
as block-axis sizes (which I'll do in a separate bug).

Differential Revision: https://phabricator.services.mozilla.com/D217687
2024-07-25 18:18:24 +00:00
Daniel Holbert
6bdbaba6b7 Bug 1909773 part 3: Add off-by-default support for the CSS 'stretch' sizing keyword, just matching the behavior of '-moz-available' for now. r=emilio
This patch is intended to be mechanical, just adding the new keyword as an
alias for the existing behavior, basically.

In a later bug, 'stretch' will gain additional capabilities before we enable
the pref.  After that, I intend to ultimately make '-moz-available' an alias of
'stretch', assuming that doing so is web-compatible.

Differential Revision: https://phabricator.services.mozilla.com/D217686
2024-07-25 18:18:24 +00:00
Emilio Cobos Álvarez
f49da1c698 Bug 1909153 - Fix interaction of transitions and zoom. r=firefox-style-system-reviewers,layout-reviewers,boris
The main issue here is that we transition the zoomed value, which is
generally wrong because the animated value gets injected back into the
cascade (and thus zoomed again).

We happen to cancel the transition in [1], which is kinda nice because
otherwise we would've just transitioned to a completely wrong value (and
maybe indefinitely, since values would keep getting bigger and
bigger...).

We need to do something similar to to_resolved_value, and unzoom lengths
in to_animated_value, that is, interpolate "unzoomed" values.

The extra test to test_transitions_per_property caught some existing
issues with calc() and zoom which are fixed too for the test to pass.

Same for the ToResolvedValue for Au, that is needed for properties like
column-rule-width to return the correct resolved values.

Main thing I left unfixed is bug 1909280, but that deserves a more
subtle test and a bit more thought because only matrix components need
to be zoomed.

While at it, I simplified the animation setup a little bit, removing the
special animation_value_type="ComputedValue", which means that we need
to add a few ToAnimatedValue calls.

Now the only values are "none", "discrete", and "normal", and given it's
not a value type anymore I called it just "animation_type".

This got a bit bigger than I would've liked, but also it fixes more bugs
that what I was originally expecting, so... :)

[1]: https://searchfox.org/mozilla-central/rev/5756c5a3dea4f2896cdb3c8bb15d0ced5e2bf690/layout/style/nsTransitionManager.cpp#168-171

Differential Revision: https://phabricator.services.mozilla.com/D217308
2024-07-23 21:54:01 +00:00
Sandor Molnar
fc33dbde1c Backed out 3 changesets (bug 1901652) for causing mochitest failures @ browser_scrollToPoint.js CLOSED TREE
Backed out changeset 24bb7e89929c (bug 1901652)
Backed out changeset 8fc6e70268be (bug 1901652)
Backed out changeset a7a4eb34e7b1 (bug 1901652)
2024-06-17 10:06:06 +03:00
Ting-Yu Lin
d4223ff969 Bug 1901652 Part 2 - Implement GetScrollTargetFrame() for ViewportFrame. r=layout-reviewers,emilio
`nsIFrame` provides `GetScrollTargetFrame()` for getting the scroll container
child under a frame. We can implement this for ViewportFrame so that callers
don't need to get the first child and then downcast.

Differential Revision: https://phabricator.services.mozilla.com/D213344
2024-06-17 02:43:01 +00:00
Ting-Yu Lin
5cdee429ce Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-30 06:32:22 +00:00
Ting-Yu Lin
76523f97b1 Bug 1896516 Part 6 - Remove nsIScrollableFrame usages in nsLayoutUtils. r=layout-reviewers,emilio
Convert `nsIScrollableFrame` to `ScrollContainerFrame` for all the APIs in
nsLayoutUtils, and then adapt other callers until everything compiles.

In `nsLayoutUtils::CalculateBasicFrameMetrics()`'s documentation,
s/ComputeFrameMetrics/ComputeScrollMetadata/ because the method was renamed in
https://hg.mozilla.org/mozilla-central/rev/cb2023f50288

Differential Revision: https://phabricator.services.mozilla.com/D211493
2024-05-30 06:32:20 +00:00
Emilio Cobos Álvarez
ac5d859c21 Bug 1899318 - Fix at-property-animation to account for spec ambiguity. r=firefox-style-system-reviewers,zrhoffman
See https://github.com/w3c/csswg-drafts/issues/10371 for the spec issue.

Differential Revision: https://phabricator.services.mozilla.com/D211871
2024-05-29 10:25:03 +00:00
Sebastian Hengst
bf4dfe53f8 Backed out 15 changesets (bug 1896516) for causing scrolling crashes on macOS. a=backout
Backed out changeset fd6904338812 (bug 1896516)
Backed out changeset 2977ff81a23e (bug 1896516)
Backed out changeset c8a6b0e526d6 (bug 1896516)
Backed out changeset 3c06f22da72b (bug 1896516)
Backed out changeset f63b0c4335fe (bug 1896516)
Backed out changeset 6f7ab8adfa6e (bug 1896516)
Backed out changeset 997c9249dbed (bug 1896516)
Backed out changeset c964fccd5180 (bug 1896516)
Backed out changeset 7b481b747b7a (bug 1896516)
Backed out changeset 42e1bbe0ecb6 (bug 1896516)
Backed out changeset 717dac08b607 (bug 1896516)
Backed out changeset 2f0817331dbe (bug 1896516)
Backed out changeset b765169a7a8f (bug 1896516)
Backed out changeset a2d37b98273c (bug 1896516)
Backed out changeset ea9ecb543e66 (bug 1896516)
2024-05-29 11:22:52 +02:00
Emilio Cobos Álvarez
1d2f00404f Bug 1899187 - Use cbindgen for border-spacing. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211781
2024-05-28 09:37:22 +00:00