Skip to content

Nested contenteditable=true and contenteditable=plaintext-only should win only the ourtermost one #10651

Open
@masayuki-nakano

Description

@masayuki-nakano

What is the issue with the HTML Standard?

See w3c/editing#470 for the detail of the situations.

If partial editing mode change is allowed with:

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

It's difficult to define the behavior of all edge cases when selection range crosses the inner contenteditable element boundary. Therefore, the editing mode should be considered with the outermost element whose parent element is not editable.

E.g., I think that in the following case, the innermost one should win:

<div contenteditable=true>
  rich text
  <div contenteditable=false>
    non-editable text
    <div contenteditable=plaintext-only>plain text</div>
    non-editable text
  </div>
  rich text
</div>

(So, it seems that when contenteditable is nested with contenteditable=false, the outermost contenteditable in the innermost contenteditable=false should always have focus when selection is in it.)

@smaug---- , @johanneswilm, @rniwa

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs concrete proposalMoving the issue forward requires someone to figure out a detailed planneeds testsMoving the issue forward requires someone to write teststopic: editing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions