This is a snapshot of an early working draft and has therefore been superseded by the HTML standard.

This document will not be further updated.

HTML 5

Call For Comments — 27 October 2007

3.13. Edits

The ins and del elements represent edits to the document.

3.13.1. The ins element

Transparent block-level element, and transparent strictly inline-level content.

Contexts in which this element may be used:
Where block-level elements is expected.
Where strictly inline-level content is allowed.
Content model:
Transparent.
Element-specific attributes:
cite
datetime
DOM interface:
Uses the HTMLModElement interface.

The ins element represents an addition to the document.

The ins element must be used only where block-level elements or strictly inline-level content can be used.

An ins element can only contain content that would still be conformant if all elements with transparent content models were replaced by their contents.

The following would be syntactically legal:

<aside>
 <ins>
  <p>...</p>
 </ins>
</aside>

As would this:

<aside>
 <ins>
  <em>...</em>
 </ins>
</aside>

However, this last example would be illegal, as em and p cannot both be used inside an aside element at the same time:

<aside>
 <ins>
  <p>...</p>
 </ins>
 <ins>
  <em>...</em>
 </ins>
</aside>

3.13.2. The del element

Block-level element, and strictly inline-level content.

Contexts in which this element may be used:
Where block-level elements is expected.
Where strictly inline-level content is allowed.
Content model:
When the element has a parent: same content model as the parent element (without taking into account the other children of the parent element).
Otherwise: zero or more block-level elements, or inline-level content (but not both).
Element-specific attributes:
cite
datetime
DOM interface:
Uses the HTMLModElement interface.

The del element represents a removal from the document.

The del element must only contain content that would be allowed inside the parent element (regardless of what the parent element actually contains).

The following would be syntactically legal:

<aside>
 <del>
  <p>...</p>
 </del>
 <ins>
  <em>...</em>
 </ins>
</aside>

...even though the p and em elements would never be allowed side by side in the aside element. This is allowed because the del element represents content that was removed, and it is quite possible that an edit could cause an element to go from being an inline-level container to a block-level container, or vice-versa.

3.13.3. Attributes common to ins and del elements

The cite attribute may be used to specify a URI that explains the change. When that document is long, for instance the minutes of a meeting, authors are encouraged to include a fragment identifier pointing to the specific part of that document that discusses the change.

If the cite attribute is present, it must be a URI (or IRI) that explains the change. User agents should allow users to follow such citation links.

The datetime attribute may be used to specify the time and date of the change.

If present, the datetime attribute must be a valid datetime value.

User agents must parse the datetime attribute according to the parse a string as a datetime value algorithm. If that doesn't return a time, then the modification has no associated timestamp (the value is non-conforming; it is not a valid datetime). Otherwise, the modification is marked as having been made at the given datetime. User agents should use the associated timezone information to determine which timezone to present the given datetime in.

The ins and del elements must implement the HTMLModElement interface:

interface HTMLModElement : HTMLElement {
           attribute DOMString cite;
           attribute DOMString dateTime;
};

The cite DOM attribute must reflect the element's >cite content attribute. The dateTime DOM attribute must reflect the element's datetime content attribute.