-
Notifications
You must be signed in to change notification settings - Fork 756
Description
Our current approach to the phases
I’ve been working on some visualizations for scroll-animations, to visually show how they are measured. For example, for smaller-than-scrollport-subjects:
![]() |
![]() |
|---|
For taller-than-scrollport-subjects, simply making the boxes bigger does not work, because that would mean contain 100% comes before contain 0%, which is impossible:
![]() |
![]() |
|---|
To solve this, we flipped the edge against which the subject is measured (note how the darker line on the center two subjects has flipped sides):
![]() |
![]() |
|---|
With that, we also shortened the range for enter/exit phases, in order to be able to use 1 set of keyframes that has no overlap between the enter-contain-exit phases:
![]() |
![]() |
|---|
Limitations of the current approach
This comes with two nasty side-effects imo:
-
The entry/exit phases are shortened, because phase change detection does not happen on the same edge

-
The meaning of enter and exit changes. This can be troublesome for an element that is initially smaller than the scrollport but becomes taller due to a resize.
This problem becomes clear in a demo such as https://codepen.io/bramus/pen/XWEeGZm no longer possible, where it’s not possible to create it using the new phases.
(FYI: the demo uses a version of the polyfill that measures things differently to make it work after all)
An alternative solution
To solve this, I would like us:
- To not change the meaning of enter/exit, and have their measurements be done consistently
- Introduce extra phases to allow the current interpretation of enter/exit for taller-than-scrollport-subjects.
Additionally, I also think we have our names wrong, as the current enter 100% for taller-than-scrollport-subjects visually means “it is entirely covering the scrollport”. This does not rhyme well the existing cover.
What I would like to propose, are the following phases. I have added the edge/threshold indicators from earlier versions of the spec as that might make thing easier to understand (this visualization tool of edges and thresholds might come in handy):
- Smaller than scrollport subjects
- enter = end 0 → end 1
- exit = start 1 → start 0
- contain = end 1 → start 1
- intersect = end 0 → start 0
- Taller than scrollport subjects
- enter = end 0 → end 1
- enter-cover = end 0 → start “1”
- exit = start 1 → start 0
- cover-exit = end ”1’ → start 0
- cover = start 1 → end 1
- intersect = end 0 → start 0
These visuals summarize the proposed changes:
![]() |
![]() |
![]() |
|---|
The real ask
Maybe we can do a breakout session on this? Some time in the 2nd half of November maybe? Just before/after a WG meeting?
As you might have noticed by now, I have prepared slides for this :)
/ping All attendees of a previous breakout session: @fantasai @tabatkins @flackr @kevers-google @mirisuzanne @ydaniv @jensimmons @smfr @argyleink










