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

What should be the shape of contentEditable? #4

Closed
BenjamP opened this issue Sep 15, 2014 · 8 comments
Closed

What should be the shape of contentEditable? #4

BenjamP opened this issue Sep 15, 2014 · 8 comments

Comments

@BenjamP
Copy link

BenjamP commented Sep 15, 2014

Some ideas include contentEditable="minimal", where we would need to be clear about what functionality is provided, and contentEditable={list of capabilities}, where {list of capabilities} might include "cursor", "typing", "newlines", etc.

@BenjamP
Copy link
Author

BenjamP commented Sep 16, 2014

From Julie Parent (a few months ago):
Without default text input, the current proposal for contentEditable="minimal" is essentially just enabling cursors (drawing them, dispatching events, performing default actions). Rather than calling the mode "minimal", which is ill-defined, why not explicitly call it what it is: "cursor-only"? Or, have contentEditable take a list of features to turn enable: contentEditable="enable-cursors enable-CommandEvents".

Or, rather than tying this concept to contentEditable, with all the assumptions and complications that brings up, why not expose this building block as a completely separate attribute?

@darobin
Copy link
Member

darobin commented Sep 16, 2014

On the contrary: rather than bringing in the complexity from cE (which it doesn't) it avoids conflicting with it. Imagine we add a cursoring attribute, what happens with <div contentEditable=true cursoring>?

Using cE is just a simple syntax hook, it doesn't bring up the rest of the tangled mess.

@BenjamP
Copy link
Author

BenjamP commented Sep 16, 2014

Are you advocating for contentEditable="minimal"? I currently think that have a space-delimited list is the best approach. We can say which ones have precedence. For instance "true" could mean "ignore everything else, just use legacy contentEditable".

@johanneswilm
Copy link
Contributor

I think either way can work. But if we could start out with one mode that only allows the movement of the cursor (not entering or deleting any content), then we don't have to define a lot of behavior on element merging, etc. . If the possibility to write/delete content is there, but not not defined through a spec, editors will once again build their functionality on top of the implementations and if we ever want to create a definition in the future we will have the same problem as we have now with editors relying on bugs and weird implementations.

@BenjamP
Copy link
Author

BenjamP commented Oct 8, 2014

I propose we start with the following allowed values for contentEditable: true, false, inherit, and cursor. We can speck it such that inherit and cursor have defined behaviors, and true and false simply overwrite all other values, with a similar meaning as is already in HTML5. If there are no objections, I would like to go ahead and create this definition in the spec.

@darobin
Copy link
Member

darobin commented Oct 9, 2014

Definitely go ahead and specify this — it's good to have concrete text and if we find issues we can change that later!

@BenjamP
Copy link
Author

BenjamP commented Oct 16, 2014

I have added a proposed definition to the Editing Explainer. Feedback would be great!

http://w3c.github.io/editing-explainer/#customizable-default-handling-with-contenteditable

@BenjamP
Copy link
Author

BenjamP commented Dec 3, 2014

I have updated the definition to reflect the ideas in http://lists.w3.org/Archives/Public/public-editing-tf/2014Nov/0049.html

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