← Back to release summary

Coalesce selectionchange events

Category
Miscellaneous
Type
Chromium catches up
Status
In developer trial (Behind a flag) (Chrome 128)
Intent stage
None

WPT details: Some related WPT tests results have been updated in our commit. Commit url: https://chromium-review.googlesource.com/c/chromium/src/+/5494116 Related wpt tests(all passed in the try job): *third_party/blink/web_tests/external/wpt/selection/onselectionchange-on-distinct-text-controls.html *third_party/blink/web_tests/external/wpt/selection/onselectionchange-on-document.html *third_party/blink/web_tests/external/wpt/selection/onselectionchange-on-document.html *third_party/blink/web_tests/external/wpt/selection/textcontrols/selectionchange.html *third_party/blink/web_tests/external/wpt/selection/textcontrols/selectionchange-on-shadow-dom.html *third_party/blink/web_tests/fast/events/selectionchange-iframe.html The feature is not enabled by default, so in wpt.fyi these tests shoule still be failed.

Summary

This feature is not to fire selectionchange event when there is already one pending. For web developers, selectionchange event listeners will be called less often with this feature. Before this feature, every time the mutation of the selection on one target(input/textarea/document) would make the listener to be called once. Now with this feature, before the selectionchange event listner is finally called, multiple mutations of the selection on one target would make the listener to be called only once.

Motivation

The specification of scheduling selectionchange events has been updated. We need to implement this to catch up the latest specification.

Standards & signals

Ecosystem

View on chromestatus.com