Intent to Implement: Selection Events

36 views
Skip to first unread message

Michael Layzell

unread,
Aug 18, 2015, 11:21:31 AM8/18/15
to dev-platform
Summary: We currently require webpages to poll the current selection
when they want to be
notified of changes to the user's selection.This patch adds two events,
selectstart and
selectionchange, which allow the website to detect when the selection is
changed. selectstart
is fired when the user starts selecting, and selectionchange is fired
when the selection
changes for any reason.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=571294

Link to standard:http://w3c.github.io/selection-api/#user-interactions

Platform coverage:All platforms.

Target release: Firefox 43.

Preference behind which this will be implemented:
"dom.select_events.enabled"

DevTools bug: N/A

Do other browser engines implement this: IE, Chrome, and Safari all
implement this API.

Security & Privacy Concerns: This API adds a new mechanism for canceling
user selections, which
could be abused. However it was already possible.

Web designer / developer use-cases: This is a useful tool for websites
which wish to be notified
when the user's selection changes, as currently websites have to poll
the selection in Firefox.

Michael

Panos Astithas

unread,
Aug 19, 2015, 5:30:16 AM8/19/15
to Michael Layzell, dev-platform
On Tue, Aug 18, 2015 at 6:21 PM, Michael Layzell <mic...@thelayzells.com>
wrote:

> Summary: We currently require webpages to poll the current selection when
> they want to be
> notified of changes to the user's selection.This patch adds two events,
> selectstart and
> selectionchange, which allow the website to detect when the selection is
> changed. selectstart
> is fired when the user starts selecting, and selectionchange is fired when
> the selection
> changes for any reason.
>
> Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=571294
>
> Link to standard:http://w3c.github.io/selection-api/#user-interactions
>
> Platform coverage:All platforms.
>
> Target release: Firefox 43.
>
> Preference behind which this will be implemented:
> "dom.select_events.enabled"
>
> DevTools bug: N/A
>

Listeners for these new events should be visible in the inspector [1] and
debugger [2] and the user should be able to break on them. I don't expect
any devtools changes will be needed to make this work, but I'm mentioning
it in order to be tested and verified.

Thanks,
Panos

[1]:
https://developer.mozilla.org/docs/Tools/Page_Inspector/How_to/Examine_event_listeners
[2]:
https://developer.mozilla.org/docs/Tools/Debugger/How_to/Break_on_a_DOM_event
Reply all
Reply to author
Forward
0 new messages