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

Expected behaviour of contentEditable, slot and distributed nodes #579

Closed
bedeoverend opened this issue Sep 28, 2016 · 5 comments
Closed

Comments

@bedeoverend
Copy link

I'm curious as to what the expected behaviour is in the following situation:

Given this HTML:

<div id="container">
  Should this be editable?
  <p>Or this?</p>
</div>

Where #container has a shadow root of:

<div contenteditable="true">
  <slot></slot>
</div>

From what I've read in the spec, contenteditable - when missing - inherits from the "parent element", so should that mean that none of the distributed elements / nodes be editable? Apart from reference to contenteditable not propagating down from Shadow Host to its Shadow Trees, I couldn't see any reference in the Shadow DOM spec either.

Trying this out in Chrome 54, the p becomes editable, but the unwrapped text node is not - but the contenteditable bounding box still wraps around both when clicking on the text. In Safari 10 neither the p element nor text node are editable, however contenteditable still gets focus, and wraps around both, as in Chrome.

What's the expected behaviour here? Apologies if I've missed something.

@rniwa
Copy link
Collaborator

rniwa commented Sep 29, 2016

The expected behavior is that nothing inside the slots will become editable.

@hayatoito @domenic @hayatoito

@hayatoito
Copy link
Contributor

The expected behavior is that nothing inside the slots will become editable.

Yeah, that is the intended behavior of the current spec.
Let me check whether Blink's implementation is intentional one or not.

@yosinch
Copy link

yosinch commented Oct 4, 2016

It seems there are bug in Blink for handling "--webkit-user-modify" CSS property, Blink use "--webkit-user-modify" CSS property to control editability.

BTW, V0 Shadow DOM works as expected.

Sample: https://jsfiddle.net/cx2jgp8t/1/

@hayatoito
Copy link
Contributor

hayatoito commented Oct 5, 2016

@yosinch
Thank you. It sounds that we can close this issue. @yosinch would file a bug for Blink, I expect. :)

@bedeoverend
Copy link
Author

Yeah that's cleared it up - thanks everyone! Really appreciate all your work on WC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants