w3c / w3c/editing

spellchecking - how to give JS devs more control

Open
#166 22 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

We have previously discussed the possibility of letting JS have more direct access to the browser internal spell checker. We refrained from that due to security concerns because users may have added secret terms to their dictionaries.

Because JS editors do at least some of the DOM changes manually, the browser cannot know exactly which parts are still in need of spell checking and which parts have been spell checked already.

Also, the language of the spell checker is set by the browser and not the editor, and this does not always make sense. For example, a JS editor may know that the language of a specific text is French, but the browser still applies the user's standard dictionary English to the text and on a small mobile device it may be difficult even for the user to change the language used by the spell checker.

What is needed:

  1. Some way for JavaScript to either execute spell checking itself using the dictionary resources present in the browser (possibly without any user customizations), OR

  2. a way for JavaScript to communicate to the browser that a specific range of text either has been spell checked already OR that it is not in need of spell checking.

Additionally, it would be good if the JavaScript could tell the browser which spellchecker language to use on a specific range of text. Lower priority, but still nice to have, would be for the JavaScript to be able to tell the browser that certain terms are field-related terms and therefore not in need of spell checking.

Whatever we come up with should be extendable to also be able to cover grammar checkers some time in the future.

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.

Research direction

No source files or tests are identified in the issue. Start by reviewing the browser spell-checking and DOM-range constraints described here, then examine the editing task force’s prior discussion. Done means a concrete, security-conscious proposal for JavaScript control of checking, range and language signaling, and possible grammar-checker extensibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.