-
Notifications
You must be signed in to change notification settings - Fork 715
[css-scroll-snap-2] Add SnapEvent definition #9515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi, @flackr , ptal at this addition of SnapEvent definition to the scroll-snap-2 spec. PS: I don't seem to be able to add reviewers so I thought I'd just ping you. |
flackr
reviewed
Nov 17, 2023
flackr
reviewed
Jan 16, 2024
f253ab7
to
b7f1e87
Compare
SnapEvent defines the interface of scroll-snap-related JavaScript events, snapchanged and snapchanging.
980e120
to
dfbb664
Compare
Snap events should fire during scrolling. This is to specify when the events should fire with respect to other scrolling events.
flackr
reviewed
Feb 21, 2024
emilio
reviewed
Feb 22, 2024
emilio
reviewed
Feb 22, 2024
-Remove extra spaces. -Improve snapchanging description. -Append snap containers to event targets list only once. -Explicitly reflect patch to cssom-view.
- Streamline snap events algorithms to one location, and link to them from cssom-view spec.
zcorpan
reviewed
Feb 29, 2024
- Specify SnapEventInit - Indicate event target in scroll steps.
flackr
reviewed
Mar 6, 2024
- Let snap events fire upon the first snap. - Specify snap events when re-snapping due on layout changes.
- Make steps clearer by separating block and inline if conditions for "update snapchanged targets" and layout change algorithm.
flackr
reviewed
Mar 8, 2024
- Don't fire snap events synchronously.
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Mar 14, 2024
This patch makes snapchanged fire SnapEvents based on the updated[1] SnapEvent interface which supplies exactly one snap target per axis. We detect that the snap targets of a SnapContainerData has changed by comparing its current target_snap_area_element_ids_ to the element ids that were most recently used to evaluate snapchanged. This requires that if a snap container is snapped in both axes but is then scrolled in only one axis, it needs to remember what it was snapped to in the other (unscrolled) axis - previously, we simply forgot what we were snapped to in the unscrolled axis. prefer-common-to-both-axes.html had to be modified because remembering what we are snapped to in the unscrolled axis affects the choice of snap targets when there is a layout change resulting in the targets along each axis not being mutually visible. Currently, chromium handles this somewhat arbitrarily (This will be adddressed in crbug.com/329250094) This patch gets around this by scrolling in both axes. snapchanged-ensures-dom-order.html is deleted because we don't return a list anymore so we don't need to ensure the order of the list. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I4af884bd58d0517087a8c8960bf7646f3a36ba72
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Mar 14, 2024
This patch makes snapchanged fire SnapEvents based on the updated[1] SnapEvent interface which supplies exactly one snap target per axis. We detect that the snap targets of a SnapContainerData has changed by comparing its current target_snap_area_element_ids_ to the element ids that were most recently used to evaluate snapchanged. This requires that if a snap container is snapped in both axes but is then scrolled in only one axis, it needs to remember what it was snapped to in the other (unscrolled) axis - previously, we simply forgot what we were snapped to in the unscrolled axis. prefer-common-to-both-axes.html had to be modified because remembering what we are snapped to in the unscrolled axis affects the choice of snap targets when there is a layout change resulting in the targets along each axis not being mutually visible. Currently, chromium handles this somewhat arbitrarily (This will be adddressed in crbug.com/329250094) This patch gets around this by scrolling in both axes. snapchanged-ensures-dom-order.html is deleted because we don't return a list anymore so we don't need to ensure the order of the list. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I4af884bd58d0517087a8c8960bf7646f3a36ba72
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Mar 14, 2024
This patch makes snapchanged fire SnapEvents based on the updated[1] SnapEvent interface which supplies exactly one snap target per axis. We detect that the snap targets of a SnapContainerData has changed by comparing its current target_snap_area_element_ids_ to the element ids that were most recently used to evaluate snapchanged. This requires that if a snap container is snapped in both axes but is then scrolled in only one axis, it needs to remember what it was snapped to in the other (unscrolled) axis - previously, we simply forgot what we were snapped to in the unscrolled axis. prefer-common-to-both-axes.html had to be modified because remembering what we are snapped to in the unscrolled axis affects the choice of snap targets when there is a layout change resulting in the targets along each axis not being mutually visible. Currently, chromium handles this somewhat arbitrarily (This will be adddressed in crbug.com/329250094) This patch gets around this by scrolling in both axes. snapchanged-ensures-dom-order.html is deleted because we don't return a list anymore so we don't need to ensure the order of the list. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I4af884bd58d0517087a8c8960bf7646f3a36ba72
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Mar 14, 2024
This patch makes snapchanged fire SnapEvents based on the updated[1] SnapEvent interface which supplies exactly one snap target per axis. We detect that the snap targets of a SnapContainerData has changed by comparing its current target_snap_area_element_ids_ to the element ids that were most recently used to evaluate snapchanged. This requires that if a snap container is snapped in both axes but is then scrolled in only one axis, it needs to remember what it was snapped to in the other (unscrolled) axis - previously, we simply forgot what we were snapped to in the unscrolled axis. prefer-common-to-both-axes.html had to be modified because remembering what we are snapped to in the unscrolled axis affects the choice of snap targets when there is a layout change resulting in the targets along each axis not being mutually visible. Currently, chromium handles this somewhat arbitrarily (This will be adddressed in crbug.com/329250094) This patch gets around this by scrolling in both axes. snapchanged-ensures-dom-order.html is deleted because we don't return a list anymore so we don't need to ensure the order of the list. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I4af884bd58d0517087a8c8960bf7646f3a36ba72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369681 Reviewed-by: Steve Kobes <skobes@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1273041}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Mar 14, 2024
This patch makes snapchanged fire SnapEvents based on the updated[1] SnapEvent interface which supplies exactly one snap target per axis. We detect that the snap targets of a SnapContainerData has changed by comparing its current target_snap_area_element_ids_ to the element ids that were most recently used to evaluate snapchanged. This requires that if a snap container is snapped in both axes but is then scrolled in only one axis, it needs to remember what it was snapped to in the other (unscrolled) axis - previously, we simply forgot what we were snapped to in the unscrolled axis. prefer-common-to-both-axes.html had to be modified because remembering what we are snapped to in the unscrolled axis affects the choice of snap targets when there is a layout change resulting in the targets along each axis not being mutually visible. Currently, chromium handles this somewhat arbitrarily (This will be adddressed in crbug.com/329250094) This patch gets around this by scrolling in both axes. snapchanged-ensures-dom-order.html is deleted because we don't return a list anymore so we don't need to ensure the order of the list. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I4af884bd58d0517087a8c8960bf7646f3a36ba72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369681 Reviewed-by: Steve Kobes <skobes@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1273041}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Mar 14, 2024
This patch updates chromium snapchanging code so that snapchanging events use the updated SnapEvents API[1]. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I844fbbf9b43c1b5759ada0d341ce1532661d39a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369682 Reviewed-by: Steve Kobes <skobes@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1273042}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Mar 14, 2024
This patch updates chromium snapchanging code so that snapchanging events use the updated SnapEvents API[1]. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I844fbbf9b43c1b5759ada0d341ce1532661d39a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369682 Reviewed-by: Steve Kobes <skobes@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1273042}
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Mar 15, 2024
…ent interface as deprecated., a=testonly Automatic update from web-platform-tests [css-scroll-snap-2] Mark obsolete SnapEvent interface as deprecated. The new interface is described in [1]. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I1985757eed10d15433590e35438b83e4db09a092 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369679 Commit-Queue: David Awogbemila <awogbemila@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/main@{#1272921} -- wpt-commits: c9a1cb97473bb77fe4259d81a739f64e7f8ad167 wpt-pr: 45089
jamienicol
pushed a commit
to jamienicol/gecko
that referenced
this pull request
Mar 17, 2024
…ent interface as deprecated., a=testonly Automatic update from web-platform-tests [css-scroll-snap-2] Mark obsolete SnapEvent interface as deprecated. The new interface is described in [1]. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I1985757eed10d15433590e35438b83e4db09a092 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369679 Commit-Queue: David Awogbemila <awogbemila@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/main@{#1272921} -- wpt-commits: c9a1cb97473bb77fe4259d81a739f64e7f8ad167 wpt-pr: 45089
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Mar 19, 2024
…o updated SnapEvent interface, a=testonly Automatic update from web-platform-tests [css-scroll-snap-2] Switch snapchanged to updated SnapEvent interface This patch makes snapchanged fire SnapEvents based on the updated[1] SnapEvent interface which supplies exactly one snap target per axis. We detect that the snap targets of a SnapContainerData has changed by comparing its current target_snap_area_element_ids_ to the element ids that were most recently used to evaluate snapchanged. This requires that if a snap container is snapped in both axes but is then scrolled in only one axis, it needs to remember what it was snapped to in the other (unscrolled) axis - previously, we simply forgot what we were snapped to in the unscrolled axis. prefer-common-to-both-axes.html had to be modified because remembering what we are snapped to in the unscrolled axis affects the choice of snap targets when there is a layout change resulting in the targets along each axis not being mutually visible. Currently, chromium handles this somewhat arbitrarily (This will be adddressed in crbug.com/329250094) This patch gets around this by scrolling in both axes. snapchanged-ensures-dom-order.html is deleted because we don't return a list anymore so we don't need to ensure the order of the list. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I4af884bd58d0517087a8c8960bf7646f3a36ba72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369681 Reviewed-by: Steve Kobes <skobes@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1273041} -- wpt-commits: 2817af77c7e8465130e93b5d4935e0887dd8ea81 wpt-pr: 45109
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Mar 19, 2024
…to updated SnapEvents interface, a=testonly Automatic update from web-platform-tests [css-scroll-snap-2] Switch snapchanging to updated SnapEvents interface This patch updates chromium snapchanging code so that snapchanging events use the updated SnapEvents API[1]. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I844fbbf9b43c1b5759ada0d341ce1532661d39a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369682 Reviewed-by: Steve Kobes <skobes@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1273042} -- wpt-commits: 49339277bcf945dd569ace5cf3c7be961f93071b wpt-pr: 45114
tabatkins
reviewed
Mar 19, 2024
tabatkins
reviewed
Mar 19, 2024
tabatkins
reviewed
Mar 19, 2024
tabatkins
reviewed
Mar 19, 2024
tabatkins
reviewed
Mar 19, 2024
tabatkins
reviewed
Mar 19, 2024
BruceDai
pushed a commit
to BruceDai/wpt
that referenced
this pull request
Mar 25, 2024
The new interface is described in [1]. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I1985757eed10d15433590e35438b83e4db09a092 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369679 Commit-Queue: David Awogbemila <awogbemila@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/main@{#1272921}
BruceDai
pushed a commit
to BruceDai/wpt
that referenced
this pull request
Mar 25, 2024
This patch makes snapchanged fire SnapEvents based on the updated[1] SnapEvent interface which supplies exactly one snap target per axis. We detect that the snap targets of a SnapContainerData has changed by comparing its current target_snap_area_element_ids_ to the element ids that were most recently used to evaluate snapchanged. This requires that if a snap container is snapped in both axes but is then scrolled in only one axis, it needs to remember what it was snapped to in the other (unscrolled) axis - previously, we simply forgot what we were snapped to in the unscrolled axis. prefer-common-to-both-axes.html had to be modified because remembering what we are snapped to in the unscrolled axis affects the choice of snap targets when there is a layout change resulting in the targets along each axis not being mutually visible. Currently, chromium handles this somewhat arbitrarily (This will be adddressed in crbug.com/329250094) This patch gets around this by scrolling in both axes. snapchanged-ensures-dom-order.html is deleted because we don't return a list anymore so we don't need to ensure the order of the list. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I4af884bd58d0517087a8c8960bf7646f3a36ba72 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369681 Reviewed-by: Steve Kobes <skobes@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1273041}
BruceDai
pushed a commit
to BruceDai/wpt
that referenced
this pull request
Mar 25, 2024
This patch updates chromium snapchanging code so that snapchanging events use the updated SnapEvents API[1]. [1]w3c/csswg-drafts#9515 Bug: 329111147 Change-Id: I844fbbf9b43c1b5759ada0d341ce1532661d39a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5369682 Reviewed-by: Steve Kobes <skobes@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1273042}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SnapEvent defines the interface of scroll-snap-related JavaScript events, snapchanged and snapchanging.