Skip to content
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

Update wpt scroll-to-visible-areas tests #19007

Merged
merged 1 commit into from Sep 13, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Sep 11, 2019

The original tests were based on an inaccurate understanding of
"visibility" for a snap area, where a snap area was considered to be
visible if it is in the viewport at the scroll location before the
snap. The definition of visibility per the specification is that a snap
area is visible if it would be in the viewport at its snap point.

See:
w3c/csswg-drafts#2526 (comment)

Also added tests for the consideration of scroll-margin when
calculating visibility as well.

Bug: 954851
Change-Id: Ic2ffef8d02fc5ea2439054b6ea5185bb66622d1d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1795308
Commit-Queue: Kaan Alsan <alsan@google.com>
Reviewed-by: Yi Gu <yigu@chromium.org>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696435}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already reviewed downstream.

The original tests were based on an inaccurate understanding of
"visibility" for a snap area, where a snap area was considered to be
visible if it is in the viewport at the scroll location before the
snap. The definition of visibility per the specification is that a snap
area is visible if it would be in the viewport at its snap point.

See:
w3c/csswg-drafts#2526 (comment)

Also added tests for the consideration of scroll-margin when
calculating visibility as well.

Bug: 954851
Change-Id: Ic2ffef8d02fc5ea2439054b6ea5185bb66622d1d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1795308
Commit-Queue: Kaan Alsan <alsan@google.com>
Reviewed-by: Yi Gu <yigu@chromium.org>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696435}
@majido
Copy link
Member

majido commented Sep 13, 2019

@hiikezoe FYI, in this PR we have updated some of the scroll-margin tests as it related to snapping and I believe we have discovered a bug in Firefox implementation. Here is some more details:

Note: 'snap-to-visible-areas-both.html' fails on Firefox. When using scrollTo() and there are no snap areas in the viewport at the scrolled to position (before snap) it does not snap to any points. When using scrollbar/wheel it snaps to a position combining the x-axis of the left-top area and the y-axis of the right-bottom area, which snaps to a position where there is no snap area in the viewport.

@hiikezoe
Copy link
Contributor

Thank you, @majido! That's an interesting test case. Indeed the current Firefox implementation is broken in such cases. (We probably need to drop the old scroll snap implementation completely before fixing this issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants