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

[whatwg] Selection events in editable content

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Fri, 6 May 2011 09:11:17 -0700
Message-ID: <BANLkTikARx+W6ZsMLnyrcbjr1TNLnW8VCw@mail.gmail.com>
On Fri, May 6, 2011 at 8:55 AM, Tim Down <timdown at gmail.com> wrote:

> 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:
>

I have recently implemented WebKit's selectionchange
event<http://trac.webkit.org/changeset/79208>.
WebKit's implementation is slightly different from that of Internet Explorer
in that the event fires asynchronously but should still be useful in many
cases.

At some point in the future, I'd like to standardize selectionchange event.

However, no event is fired in WebKit when  the
> user chooses "Select all" from the edit or context menus, or presses
> Ctrl/Cmd-A.
>

That sounds like a bug. Please file a bug <http://bugs.webkit.org/>.


> 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.
>

One of the challenges we face as implementors is when selection changes due
to DOM mutations (via JavaScript, editing, etc...).  Because of the way
selection is updated in WebKit, introducing new synchronous event or firing
selectstart/select in new places will be quite tricky for us.

Best,
Ryosuke Niwa
Software Engineer
Google Inc.
Received on Friday, 6 May 2011 09:11:17 UTC

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