Page MenuHomePhabricator

Bug 1808409 - Part 1: Support view-timeline-name and view-timeline-axis in style system.
ClosedPublic

Authored by boris on Jan 7 2023, 12:57 AM.
Referenced Files
Unknown Object (File)
Jun 21 2025, 6:36 PM
Unknown Object (File)
Jun 19 2025, 1:14 PM
Unknown Object (File)
May 26 2025, 6:43 AM
Unknown Object (File)
May 25 2025, 11:11 PM
Unknown Object (File)
May 20 2025, 7:50 PM
Unknown Object (File)
May 14 2025, 8:38 AM
Unknown Object (File)
May 1 2025, 9:21 PM
Unknown Object (File)
Apr 19 2025, 1:46 PM
Subscribers

Details

Summary

view-timeline-name: none | <custom-ident>#
view-timeline-axis: [ block | inline | vertical | horizontal ]#

Note:
Both view-timeline-name and scroll-timeline-name should accept auto.
We will fix it in this patch series.

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.

Code analysis found 1 defect in the diff 665798:

  • 1 defect found by clang-tidy
WARNING: Found 1 issue (warning level) that can be dismissed.

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)

If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 665798.

boris edited the summary of this revision. (Show Details)

1 issue closed compared to the previous diff 666428.


If you see a problem in this automated review, please report it here.

emilio requested changes to this revision.Jan 18 2023, 7:23 AM
emilio added inline comments.
servo/components/style/properties/gecko.mako.rs
1916

The only reason this code for animations is not autogenerated is that it needed specific conversions (e.g. animation-iteration-count needs to convert to / from float). Given these don't, I'd much rather have this autogenerated

1939

So I know this is doing just what we do for transitions / animations, but maybe we don't need to? Is there any reason we need the struct and these shenanigans, and can't instead just keep the values separately?

If not, can we at least share more code with the transitions / animations?

servo/components/style/properties/longhands/ui.mako.rs
344

Should we remove these properties? What's the long term plan here?

This revision now requires changes to proceed.Jan 18 2023, 7:23 AM
servo/components/style/properties/gecko.mako.rs
1916

I submitted bug 1810946 with some clean-ups that should make this something like impl_coordinated_property('view_timeline', 'name', 'Name') or so

servo/components/style/properties/longhands/ui.mako.rs
344

Ah, I see this is on the spec but should also be a coordinated property.

boris added inline comments.
servo/components/style/properties/gecko.mako.rs
1939

Keeping the values separately may have issues.
For example:
If we define view-timeline-name: a, b; and we don't define view-timeline-axis, its getComputedStyle(target).viewTimelineAxis should returns block, block. If we keep the values separately, the value of getComputedStyle(target).viewTimelineAxis may be nothing or something unexpected based on our current auto-gen code (e.g. use simple_vector_bindings and allow_empty to generate the StyleOwnedSlice). I guess we may need some other implementation for auto-generating coordinated property list.

Therefore, we still have to manually create a list and assign the initial values. I will try to share this code with animations and transitions.

servo/components/style/properties/longhands/ui.mako.rs
344

Yes, I will update scroll-timeline-{name|axis} in a separate patch so all of them are coordinated properties

boris marked 4 inline comments as done.

addressed comments

emilio requested changes to this revision.Jan 20 2023, 7:59 PM
emilio added inline comments.
layout/style/nsStyleStruct.h
1289

Let's set mAxis to StyleScrollAxis::Block here, and avoid the uninitialized values?

servo/components/style/properties/gecko.mako.rs
1029–1031

I'm confused, it seems impl_coordinated_property would work? If not, can you document why is this different? At a glance it seems the only difference is the take(input_len) and, for some reason, the order of the arguments to zip. But a.zip(b) iterates over the shortest, so I don't see why those differences are relevant?

This revision now requires changes to proceed.Jan 20 2023, 7:59 PM
servo/components/style/properties/gecko.mako.rs
1029–1031

My bad. They are identical. I misread this iterator. impl_coordinated_property should work.

boris marked 2 inline comments as done.

addressed comments

emilio added a project: testing-approved.
emilio removed reviewers: Restricted Project, layout-reviewers.
This revision is now accepted and ready to land.Jan 21 2023, 3:20 PM
This revision is now accepted and ready to land.Jan 24 2023, 1:45 AM