w3c / selection-api

Selection API
http://w3c.github.io/selection-api/
Other
47 stars 29 forks source link

Fixes https://github.com/w3c/selection-api/issues/170. #172

Closed rniwa closed 7 months ago

rniwa commented 7 months ago

Add a boolean flag "has scheduled selectionchange event" to selection, and check it before queuing a task to fire a selectionchange event.


Preview | Diff

ShuangshuangZhou commented 7 months ago

So currently we don't do this for the only focused element, right? For example, for several input elements on the same page, every input has its own has_scheduled_selectionchange_event, and we will do same things for every input or text area .

rniwa commented 7 months ago

So currently we don't do this for the only focused element, right? For example, for several input elements on the same page, every input has its own _has_scheduled_selectionchangeevent, and we will do same things for every input or text area .

Right. Boolean is per element.

rniwa commented 7 months ago

WebKit has implemented this new behavior as of https://commits.webkit.org/276388@main.

smaug---- commented 5 months ago

Curious, is this (possibly breaking) change already in the shipping version of Safari? (I don't have a Mac around atm). I'm changing the behavior in Gecko. Test runs are still pending.

rniwa commented 5 months ago

No, it hasn't shipped yet.