Skip to content

[Interop] Make scroll event timing expectation match the spec - #61558

Open
chromium-wpt-export-bot wants to merge 1 commit into
masterfrom
chromium-export-cl-8046081
Open

[Interop] Make scroll event timing expectation match the spec#61558
chromium-wpt-export-bot wants to merge 1 commit into
masterfrom
chromium-export-cl-8046081

Conversation

@chromium-wpt-export-bot

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

This WPT is part of Interop 2026.

When one scroll event e1 queues a scroll request for a different
scroller, the WPT expected that the first scroll event e2 for the second
scroll has to fire in the second iteration of the event loop after the
request. The spec requirement here is more relaxed, effectively allowing
e2 to fire in any iteration after the request.

This CL updates the WPT to match the spec requirement.

More details:

  • Scroll events are fired from the "run the scroll steps" algorithm in
    CSSOM View Module Level 1 (Step 2.4 in [1]), which is called from
    "window event loop" Step 3.9 in HTML event loop processing model [2].
  • Queuing of scroll events is not synced with [1] or [2] at all: it is
    specified through an independent step "whenever an element gets
    scrolled" a few paragraphs above [1].
  • After the WPT fires e1, the exact timing of the queuing (therefore
    the firing) of e2 remains UA-defined. Because the second request is
    for an instant scroll, Blink queues e2 synchronously in the same
    iteration of [2] that fired e1, and fires e2 in the first iteration
    afterwards. This timing conforms to the specs but fails the WPT.
  • This CL fixed the WPT by dropping the assertion that e2 must not
    fire in the next iteration.

[1] https://drafts.csswg.org/cssom-view/#document-run-the-scroll-steps
[2] https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model

Fixed: 397737222
Change-Id: Ic87b3d72d096466510d3087308e76876ba45eac7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8046081
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1669472}

This WPT is part of Interop 2026.

When one scroll event e1 queues a scroll request for a different
scroller, the WPT expected that the first scroll event e2 for the second
scroll has to fire in the second iteration of the event loop after the
request. The spec requirement here is more relaxed, effectively allowing
e2 to fire in any iteration after the request.

This CL updates the WPT to match the spec requirement.

More details:
- Scroll events are fired from the "run the scroll steps" algorithm in
CSSOM View Module Level 1 (Step 2.4 in [1]), which is called from
  "window event loop" Step 3.9 in HTML event loop processing model [2].
- Queuing of scroll events is not synced with [1] or [2] at all: it is
  specified through an independent step "whenever an element gets
  scrolled" a few paragraphs above [1].
- After the WPT fires e1, the exact timing of the queuing (therefore
  the firing) of e2 remains UA-defined. Because the second request is
  for an instant scroll, Blink queues e2 synchronously in the same
  iteration of [2] that fired e1, and fires e2 in the first iteration
  afterwards. This timing conforms to the specs but fails the WPT.
- This CL fixed the WPT by dropping the assertion that e2 must not
  fire in the next iteration.

[1] https://drafts.csswg.org/cssom-view/#document-run-the-scroll-steps
[2] https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model

Fixed: 397737222
Change-Id: Ic87b3d72d096466510d3087308e76876ba45eac7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8046081
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1669472}

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

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.

3 participants