Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
masayuki-nakano opened this issue Sep 25, 2024 · 2 comments

Comments

@masayuki-nakano
Copy link
Collaborator

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.

@johanneswilm johanneswilm added the Agenda+ Agenda item to be inserted in the Editing TF meeting queue label Sep 26, 2024
@rniwa
Copy link
Contributor

rniwa commented Sep 26, 2024

Filed https://bugs.webkit.org/show_bug.cgi?id=280419 to track this issue in WebKit.

@johanneswilm
Copy link
Contributor

From TPAC 2024 Minutes:

#470
Johannes: What happens if contenteditable=true/plaintext are nested?

Dan: The outer one takes precedence. You can reset with contenteditable=false

Ryosuke: Same true for Webkit

Sanket: We should write this down in a spec. Current definition looks incomplete:
https://html.spec.whatwg.org/multipage/interaction.html#editing-host

Resolution: follow model of outermost wins. File issue with HTML spec (Olli takes responsibility).

Dan: In both examples below, they should be richtext.

Resolution: Bug will need to be filed with Chromium (Dan)/Webkit (Ryosuke).

@johanneswilm johanneswilm removed the Agenda+ Agenda item to be inserted in the Editing TF meeting queue label Oct 7, 2024
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Mar 1, 2025
…xt-only"` and `contenteditable="true"` are nested

Adding the tests for the conclusion of <w3c/editing#470>.

If `contenteditable="true"` (`=""`) and `contenteditable="plaintext-only"`
without `contenteditable="false"`, the outermost editing host should consider
whether it's a richtext editor or a plaintext editor.

Differential Revision: https://phabricator.services.mozilla.com/D239868

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1921171
gecko-commit: ecc241ac8ebc8b436b9ca4d9a0474b78b960107e
gecko-reviewers: smaug
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Mar 1, 2025
…table="plaintext-only"` and `contenteditable="true"` are nested r=smaug

Adding the tests for the conclusion of <w3c/editing#470>.

If `contenteditable="true"` (`=""`) and `contenteditable="plaintext-only"`
without `contenteditable="false"`, the outermost editing host should consider
whether it's a richtext editor or a plaintext editor.

Differential Revision: https://phabricator.services.mozilla.com/D239868
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Mar 2, 2025
…xt-only"` and `contenteditable="true"` are nested

Adding the tests for the conclusion of <w3c/editing#470>.

If `contenteditable="true"` (`=""`) and `contenteditable="plaintext-only"`
without `contenteditable="false"`, the outermost editing host should consider
whether it's a richtext editor or a plaintext editor.

Differential Revision: https://phabricator.services.mozilla.com/D239868

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1921171
gecko-commit: ecc241ac8ebc8b436b9ca4d9a0474b78b960107e
gecko-reviewers: smaug
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this issue Mar 5, 2025
…table="plaintext-only"` and `contenteditable="true"` are nested r=smaug

Adding the tests for the conclusion of <w3c/editing#470>.

If `contenteditable="true"` (`=""`) and `contenteditable="plaintext-only"`
without `contenteditable="false"`, the outermost editing host should consider
whether it's a richtext editor or a plaintext editor.

Differential Revision: https://phabricator.services.mozilla.com/D239868
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Mar 5, 2025
…table="plaintext-only"` and `contenteditable="true"` are nested r=smaug

Adding the tests for the conclusion of <w3c/editing#470>.

If `contenteditable="true"` (`=""`) and `contenteditable="plaintext-only"`
without `contenteditable="false"`, the outermost editing host should consider
whether it's a richtext editor or a plaintext editor.

Differential Revision: https://phabricator.services.mozilla.com/D239868
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants