Should onselectstart and onselectionchange have content attributes or just IDL attributes?

Open
#351 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
html
Domain
api, web-dev

Research direction

Read the Selection API section “Extensions to GlobalEventHandlers” and compare its IDL-only wording with the Chromium interoperability report linked in the issue. Check the provided HTML example across the relevant browser behavior, then clarify whether onselectstart and onselectionchange should have content attributes as well as IDL attributes; done means the specification has an explicit, interoperable resolution.

Written by the indexing model from the issue text.

Description

The spec currently lists IDL attributes for onselectstart and onselectionchange here: https://w3c.github.io/selection-api/#extensions-to-globaleventhandlers

Someone found the onselectionchange content attribute is not currently interoperable between browsers. Consider the following:

<div id=parent onselectionchange="console.log('parent onselectionchange')">
  <input onselectionchange="console.log('input onselectionchange')">
</div>

Firefox and Safari will attach selectionchange event listeners for both elements, but chrome does neither. I'd be happy to implement this in chrome if the spec is updated to explicitly say that we should have global onselectionchange content attributes in addition to IDL attributes.

I suspect that onselectstart has the same interop issue right now.

Dominant language
HTML
Stars
49
Forks
30
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from w3c/selection-api

All issues in w3c/selection-api

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.