[Bug 24169] New: Restrictions on contentEditable

https://www.w3.org/Bugs/Public/show_bug.cgi?id=24169

            Bug ID: 24169
           Summary: Restrictions on contentEditable
           Product: WebAppsWG
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: HTML Editing APIs
          Assignee: ayg@aryeh.name
          Reporter: thangalin@gmail.com
        QA Contact: sideshowbarker+html-editing-api@gmail.com
                CC: mike@w3.org, public-webapps@w3.org

Bug 14554 describes a mechanism for plaintext editing using the contentEditable
attribute, but has too narrow a focus. Elements that are contentEditable should
have the flexibility to control what child elements are allowed or not allowed.

This would allow for a plaintext editor, and much more. Here are a few
examples.

1. Create a permanent ordered list that always has at least one list item:

<ol contentEditable="true" accept="li" destroy="false">
  <li destroy="false">Edit list item.</li>
</ol>

2. Create a heading that can be changed, but not removed:

<h1 contentEditable="true" accept="b i" destroy="false">Edit heading.</h1>

3. Create a plaintext editor:

<div contentEditable="true" accept="p" destroy="false">
</div>

4. Create a custom editor that cannot include tables, images, or links:

<div contentEditable="true" reject="table img a" destroy="false">
</div>

5. Create a table that can be edited and removed:

<table contentEditable="true" accept="thead th tr tbody td tfoot">
</table>

See also: https://www.w3.org/Bugs/Public/show_bug.cgi?id=14554

Implement the first item in a cross-browser fashion required a fair amount of
effort to handle bugs and browser inconsistencies (see:
https://github.com/DaveJarvis/listeditor/tree/master/source).

Underneath the hood of contentEdtiable, various browser vendors will provide
various interpretations of the HTML specification regarding contentEdtiable. By
allowing Web App developers the ability to choose what child elements are
permitted, it might help to reign in the inconsistencies.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Thursday, 26 December 2013 20:46:11 UTC