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

Clarify selectstart event behaviour #50

Closed
mystor opened this issue Aug 12, 2015 · 2 comments
Closed

Clarify selectstart event behaviour #50

mystor opened this issue Aug 12, 2015 · 2 comments

Comments

@mystor
Copy link

mystor commented Aug 12, 2015

I'm currently implementing selection events for gecko, and I noticed that the selectstart event documentation currently appears to imply that every time that a user changes the selection, a selectstart event should be fired. This is because of the combination of:

When the user agent is about to associate a new range newRange to the selection in response to a user initiated action, the user agent must fire ([DOM4]) an event with the name selectstart [...]

and

If the user makes any modification to a selection, the user agent must create a new range with suitable start and end of the range ([DOM4]) and associate the selection with this new range (not modify the existing range) [...]

This behavior definitely doesn't agree with chrome's implementation (resizing a selection in a textbox with the arrow keys in chrome, for example, doesn't fire selectstart events).

My best guess at the intention of this is that the selectstart event is intended to fire whenever a selection goes from being empty or collapsed to being non-collapsed. This is what I am currently implementing in Bug 571294. The spec should be updated to clarify what the intent is.

rniwa added a commit that referenced this issue Aug 13, 2015
@rniwa
Copy link
Contributor

rniwa commented Aug 13, 2015

I've updated the sentence so that now it reads as follows:

When the user agent is about to associate a new range newRange to the selection in response to a user initiated action, the user agent must fire ([DOM4]) an event with the name selectstart, which bubbles and is cancelable, at the node associated with the boundary point of newRange's start prior to changing the selection if the selection was previously empty or the previously associated range was collapsed.

@rniwa
Copy link
Contributor

rniwa commented Aug 13, 2015

Please reopen the bug if this change is insufficient.

@rniwa rniwa closed this as completed Aug 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants