w3c / w3c/edit-context

Can we remove TextFormat.textColor?

Open
#54 12 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

needs-spec-edits
Dominant language
HTML
Stars
48
Forks
13
PR merge metrics
No merged PRs in 30d

Description

There is a problem with TextFormat.textColor in that it's not clear what value this field should contain when the text color does not need to be changed. Since the textColor field is always present, an author can't tell the difference between a TextFormatUpdateEvent instructing the page to both show an underline and to change the text color, and a TextFormatUpdateEvent that is only instructing the page to show an underline.

One solution to fix this is to specify that an empty string means the author should not modify the text color.

Stepping back, however, it's not clear this field is needed at all. @snianu informed me of the history here, where this was added as a potential requirement for Windows dicatation, where text color is used to indicate the system's confidence in a candidate word. However, this hasn't yet been implemented and it's not clear whether there are any other definite use cases.

Therefore I think the simplest choice is to just remove the textColor field until we have a proven need for it. If we remove it now before EditContext ships, then it's easy to add it back -- but if we ship the field without a good understanding of how it will be used then we may find it hard to make needed changes later on.

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

Start with the linked EditContext specification and inspect the TextFormat and TextFormatUpdateEvent definitions, including the stated Windows dictation history. Confirm the API change needed to remove TextFormat.textColor and check the surrounding specification text for references; the issue names no repository files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api, web-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.