Intent to Ship: Coalesce selectionchange events

43 views
Skip to first unread message

Shuangshuang Zhou

unread,
3:08 AM (11 hours ago) 3:08 AM
to blink-dev
Contact emailsshuangsh...@intel.com

ExplainerNone

Specificationhttps://w3c.github.io/selection-api/#scheduling-selectionhange-event

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.



Blink componentBlink>Editing>Selection

TAG reviewNone

TAG review statusIssues addressed

Risks


Interoperability and Compatibility

Interoperability risk is low because Firefox and Safari have shipped this according to the specification. It has none compatibility risk since this is nor a removal. W3C spec for this feature: https://w3c.github.io/selection-api/#scheduling-selectionhange-event



Gecko: Shipped/Shipping (https://hg.mozilla.org/integration/autoland/rev/6632631a15ec)

WebKit: Shipped/Shipping (https://commits.webkit.org/276388@main) This feature is shipped in Safari Technology Preview.

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

Low WebView application risks.



Debuggability

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?Yes

Is this feature fully tested by web-platform-tests?Yes

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


On latest wpt.fyi, the tests are all passed, see:

https://wpt.fyi/results/selection/onselectionchange-on-document.html?label=experimental&label=master&aligned


Flag name on chrome://flagsNone

Finch feature nameCoalesceSelectionchangeEvent

Requires code in //chrome?False

Estimated milestones
Shipping on desktop

128


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Statushttps://chromestatus.com/feature/5227302221512704?gate=5124056542871552

Links to previous Intent discussions

This intent message was generated by Chrome Platform Status.

Vladimir Levin

unread,
12:19 PM (2 hours ago) 12:19 PM
to Shuangshuang Zhou, blink-dev
On Tue, Jul 23, 2024 at 3:08 AM Shuangshuang Zhou <shuangsh...@intel.com> wrote:
Contact emailsshuangsh...@intel.com

ExplainerNone

Specificationhttps://w3c.github.io/selection-api/#scheduling-selectionhange-event

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.



Blink componentBlink>Editing>Selection

TAG reviewNone

TAG review statusIssues addressed

Risks


Interoperability and Compatibility

Interoperability risk is low because Firefox and Safari have shipped this according to the specification. It has none compatibility risk since this is nor a removal. W3C spec for this feature: https://w3c.github.io/selection-api/#scheduling-selectionhange-event


This is a fairly recent spec change, but it seems like it has support from other vendors. From reading the discussion on the issue (https://github.com/w3c/selection-api/issues/170), I think the impact to existing developer expectations is minimal.

LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/58462a23-205f-471c-aaf1-b2493d4ee471n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages