W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2011

[whatwg] Selection events in editable content

From: Tim Down <timdown@gmail.com>
Date: Fri, 6 May 2011 16:55:35 +0100
Message-ID: <BANLkTi==ftLcc4xWTpgRs20tB_tCtZBdKA@mail.gmail.com>
Are there any plans for selection-related events for editable HTML
content (contenteditable or designMode)? An event that fires whenever
the selection changes would be very useful and seems a curious
oversight in most current browsers. The current situation is:

- There are two events that exist: select and selectstart
- In IE, the selectstart event fires whenever the user starts changing
the selection within any contenteditable element, including when the
user chooses "Select all" from the edit or context menus. It also
fires on the <body> element when the user starts making a selection
anywhere in the page.
- Additionally, in IE, the select event fires on the <body> element
whenever the selection changes, whether the body is contenteditable or
not, including when the user chooses "Select all" from the edit or
context menus
- In WebKit, the selectstart event fires on the <body> whenever the
user starts making a selection either with the mouse or the keyboard
(regardless of whether the content is editable), and then fires again
whenever the mouse moves in the case of a mouse selection until the
button is released. However, no event is fired in WebKit when  the
user chooses "Select all" from the edit or context menus, or presses
Ctrl/Cmd-A.
- Firefox does not fire either event in editable content.

IE is the only major browser that has seriously useful behaviour here.
Are there any plans to spec this or similar behaviour? I can think of
several use cases within the context of a rich text editor if
justification is required.

Forgive me if this has been covered before, but I've been unable to
find anything in any specs about it.

Tim
Received on Friday, 6 May 2011 08:55:35 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:33 UTC