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 contenteditable="false" elements which is associated with an EditContext #70

Open
masayuki-nakano opened this issue Oct 13, 2023 · 1 comment

Comments

@masayuki-nakano
Copy link

https://w3c.github.io/edit-context/#edit-context-differences

Each child node of the EditContext editing host becomes editable, unless that node has a contenteditable attribute set to "false".

I guess that if the element whose contenteditable is "false" has an EditContext, it should be editable because if only the element has focus, it should be editable.

So in my understanding an element can be editable if:

  • designMode is set to on
  • contenteditable is set to true
  • an EditContext is associated
  • an ancestor is editable and not in designMode and not associated with an EditContext and contenteditable is set to "false"

I.e., an element in an editing host can be non-editable if and only if:

  • not in designMode
  • not associated with an EditContext
  • contenteditable is set to "false"
  • or a descendant of the non-editable element and is not an editing host

Cc: @dandclark

@johanneswilm johanneswilm transferred this issue from w3c/editing Oct 13, 2023
@dandclark
Copy link
Contributor

This description matches my understanding of things should work. We do still need to discuss the designMode question in #74.

The example in this issue shows a lot of the interesting cases: #53

We also discussed in #38 the question of what happens if contenteditable=true and EditContext are set on the same element. The decision at the time was that the EditContext behavior wins over the contenteditable behavior. I think that should also be the case for contenteditable=false, so if contenteditable=false and EditContext are set on the same element, the element is editable and the contenteditable=false is ignored.

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

2 participants