w3c / w3c/editing

Clarify the nested case of `contenteditable=true` and `contenteditable=plaintext-only`

Open
#470 2 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

There are 2 simple cases:

<div contenteditable="true">
  <div contenteditable="plaintext-only">plaintext-only</div>
</div>
<div contenteditable="plaintext-only">
  <div contenteditable="true">rich text allowed</div>
</div>

Perhaps, initial shipping of contenteditable=plaintext-only of Firefox may depend on the topmost editing host value (i.e., focused editing host) because there are complicated issues.

For example, in the following cases, it's unclear whether rich text or plaintext should be pasted.

<div contenteditable="true">
  [rich text
  <div contenteditable="plaintext-only">plaintext-only]</div>
</div>
<div contenteditable="true">
  <div contenteditable="plaintext-only">[plaintext-only</div>
  rich text]
</div>

It seems that Chrome considers it from anchor node of selection. So, if you make the above selections with opposite direction, you'll see different result.

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 by reviewing the two simple nested examples and the selections that cross editing hosts, then compare the reported Chrome behavior. Determine the expected paste behavior for each selection direction and document an agreed rule for the nested contenteditable case.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
web-dev
Issue type
Documentation
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.