Re: [w3c/editing] EditContext: how is bold represented? (Issue #368)

@johanneswilm, EditContext is not expected to be used with contenteditable, if we attach an EditContext to a contenteditable div, EditContext's behavior will override contenteditable, i.e. the user input won't change DOM, instead it will go to EditContext's text buffer and fire related events.

@annevk, EditContext is designed to be able to integrate with native editing UI like the iOS menu you mentioned. We can think of EditContext as a special version of contenteditable, all the editing heuristics remain the same, e.g. the editing UI, the context menu, etc, the only difference is that the user input now doesn't go to the div and instead it goes to the EditContext. And only after the author's editor model handles the EditContext events and updates the DOM do the users see the characters they type. So back to your question, the native editing UI doesn't need to be reimplemented, but after user apply some command in the menu, e.g. bold, a 'formatBold' input event will be fired, and the authors are responsible to update the DOM accordingly.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/368#issuecomment-1012926862
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/editing/issues/368/1012926862@github.com>

Received on Friday, 14 January 2022 08:55:01 UTC