W3C home > Mailing lists > Public > public-html@w3.org > November 2007

ins and del elements

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Mon, 12 Nov 2007 22:06:48 +0100
Message-ID: <4738C068.90407@disruptive-innovations.com>
To: public-html@w3.org

I would like to come back to the ins and del elements. They are
far, very far from being the best solution for editing environments.

The most common example of that is a selection starting with
a paragraph and ending in the middle of a sublist item (see [
and ] in the prose below):

    [<p>this is a paragraph</p>
    <ul>
      <li>list item level 1
        <ul>
          <li>list item] level 2</li>
        </ul>
      </li>
      <li>another list item level 1</li>
    </ul>

To delete the selection, you need three del elements, one being
block-level, the two others being inline-level (please note a
li element cannot be contained inside a del element, and it's
painful...) :

    <del><p>this is a paragraph</p></del>
    <ul>
      <li><del>list item level 1</del>
        <ul>
          <li><del>list item</del> level 2</li>
        </ul>
      </li>
      <li>another list item level 1</li>
    </ul>

 From an editing perspective, that's hell. Another solution
used a lot in SGML editing environments is called Paired Elements
and it's able to better represent the selection :

    <del id="foo" end="bar"/><p>this is a paragraph</p>
    <ul>
      <li>list item level 1
        <ul>
          <li>list item<del id="bar" start="foo"/> level 2</li>
        </ul>
      </li>
      <li>another list item level 1</li>
    </ul>

For people with enough SGML background, think IDREF.

That's harder to style but that's MUCH easier to edit, and the ins and
del elements are made to help/improve editing right ? In particular,
you don't have to care any more about the real caret's position when
the cursor is at the beginning of the sublist item. Is it before the
del element or at its beginning ? This question is the most severe
problem using del and ins elements in a wysiwyg editing tool.

I know it's kind of disruptive here but please consider paired elements
with two extra CSS pseudo-elements ::deleted and ::inserted.
An API allowing to know if a given DOM point (node, offset) has a
deleted or inserted status is also needed.

Thanks.

</Daniel>
Received on Tuesday, 13 November 2007 09:36:11 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:50 UTC