w3c / w3c/editing

Invalid or identical colors provided to `backColor`/`foreColor`/`hiliteColor` should return `true` instead of `false`

Open
#476 0 comments 0 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

If the value string provided to backColor, foreColor or hiliteColor is either an invalid CSS color or the current color, the spec states to return false:

https://github.com/w3c/editing/blob/b9fbe88d2319c5667a008804c2364023ce4ccec0/docs/execCommand/index.html#L4201-L4202

As tested in both Firefox and Chrome, we should instead return true here.

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 at the linked execCommand specification section around lines 4201-4202 and review the stated behavior for backColor, foreColor, and hiliteColor. Done means the specification states that invalid or unchanged CSS colors return true, matching the behavior reported in Firefox and Chrome.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html
Domain
documentation
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.