4.7 編集

[ `ins$e / `del$e ]要素は、文書に対する編集を表現する。 ◎ The ins and del elements represent edits to the document.

4.7.1. `ins^e 要素

`分類$
`~flow内容$/`句内容$/`可触~内容$。 ◎ Flow content. ◎ Phrasing content. ◎ Palpable content.
`この要素を利用できる文脈$
`句内容$が期待される所。 ◎ Where phrasing content is expected.
`内容~model$
`透過的$。 ◎ Transparent.
`text/htmlにおける~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
`cite$a — 当の編集についての更なる情報を指す~link。 ◎ cite — Link to the source of the quotation or more information about the edit
`datetime$a — 変更~日時 ◎ datetime — Date and (optionally) time of the change
`~DOM~interface$
`HTMLModElement$I を利用する。 ◎ Uses the HTMLModElement interface.

`ins$e 要素は、文書に対する追加を`表現-$する。 ◎ The ins element represents an addition to the document.

次のものは、単独の段落の追加を表現する: ◎ The following represents the addition of a single paragraph:

<aside>
 <ins>
  <p> 私は果物が好きです。 </p>
 </ins>
</aside>

次のものも。 この `aside$e 要素~内のすべては `句内容$なので、`段落$は 1 個である: ◎ As does the following, because everything in the aside element here counts as phrasing content and therefore there is just one paragraph:

<aside>
 <ins>
  リンゴは <em>美味</em>です。
 </ins>
 <ins>
  ナシも。
 </ins>
</aside>

`ins$e 要素は、`暗黙の段落$境界をまたがるべきでない。 ◎ ins elements should not cross implied paragraph boundaries.

次の例は, 2 個の段落の追加を表現しており、うち 2 個目の `ins$e 要素は 2 個~目の段落~内に挿入される。 したがって 1 個目の `ins$e 要素は、段落~境界をまたがっており、拙い形と見なされる。 ◎ The following example represents the addition of two paragraphs, the second of which was inserted in two parts. The first ins element in this example thus crosses a paragraph boundary, which is considered poor form.

<aside>
 <!-- (このような書き方はしないこと) -->
 <ins datetime="2005-03-16 00:00Z">
  <p> 私は果物が好きです。 </p>
  リンゴは <em>美味</em>です。
 </ins>
 <ins datetime="2007-12-19 00:00Z">
  ナシも。
 </ins>
</aside>

もっと良い仕方で~mark-upする例を次に示す。 利用する要素の個数は増えるが、どの要素も暗黙の段落~境界をまたがらない。 ◎ Here is a better way of marking this up. It uses more elements, but none of the elements cross implied paragraph boundaries.

<aside>
 <ins datetime="2005-03-16 00:00Z">
  <p> 私は果物が好きです。 </p>
 </ins>
 <ins datetime="2005-03-16 00:00Z">
  リンゴは <em>美味</em>です。
 </ins>
 <ins datetime="2007-12-19 00:00Z">
  ナシも。
 </ins>
</aside>

4.7.2. `del^e 要素

`分類$
`~flow内容$/`句内容$。 ◎ Flow content. ◎ Phrasing content.
`この要素を利用できる文脈$
`句内容$が期待される所。 ◎ Where phrasing content is expected.
`内容~model$
`透過的$。 ◎ Transparent.
`text/htmlにおける~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
`cite$a — 当の編集についての更なる情報を指す~link。 ◎ cite — Link to the source of the quotation or more information about the edit
`datetime$a — 変更~日時 ◎ datetime — Date and (optionally) time of the change
`~DOM~interface$
`HTMLModElement$I を利用する。 ◎ Uses the HTMLModElement interface.

`del$e 要素は、文書に対する除去を`表現-$する。 ◎ The del element represents a removal from the document.

`del$e 要素は、`暗黙の段落$境界をまたがるべきでない。 ◎ del elements should not cross implied paragraph boundaries.

次の例に “やること” ~listを示す。 やり終えた~itemは、完了の日時を伴って,消される。 ◎ The following shows a "to do" list where items that have been done are crossed-off with the date and time of their completion.

<h1>やること</h1>
<ul>
 <li>食洗機をかたづける</li>
 <li><del datetime="2009-10-11T01:25-07:00">Walter Lewin の講義を聴く</del></li>
 <li><del datetime="2009-10-10T23:38-07:00">楽曲をもっとダウンロードする</del></li>
 <li>プリンタを買う</li>
</ul>

4.7.3. `ins^e, `del^e 要素に共通の属性

`cite@a 属性を利用すれば、当の変更を説明する文書の`~URL$docを指定できる。 その文書が長いときは — 具体的には議事録など — 作者には、当の変更を論じている文書~内の特定の一部を指している`素片$urlも含めることが奨励される。 ◎ The cite attribute may be used to specify the URL of a document that explains the change. When that document is long, for instance the minutes of a meeting, authors are encouraged to include a fragment pointing to the specific part of that document that discusses the change.

`cite$a 属性に指定する値は、当の変更を説明する `前後~空白~可の妥当な~URL$で~MUST。 ~UAは、属性の値から 対応する引用元~linkを得るときは,値を要素の`~node文書$に`相対的に構文解析-$し~MUST。 ~UAは,そのような引用元~linkを 利用者が追えるようにしてよいが、それは読者ではなく,私的~利用が第一に意図されている(例:~siteにおける編集の利用についての統計を収集するような~server側~scriptなど)。 ◎ If the cite attribute is present, it must be a valid URL potentially surrounded by spaces that explains the change. To obtain the corresponding citation link, the value of the attribute must be parsed relative to the element's node document. User agents may allow users to follow such citation links, but they are primarily intended for private use (e.g., by server-side scripts collecting statistics about a site's edits), not for readers.

`datetime@a 属性を利用すれば、変更の時刻や日付を指定できる。 ◎ The datetime attribute may be used to specify the time and date of the change.

`datetime$a 属性に指定する値は、`妥当な省略あり日時~文字列$で~MUST。 ◎ If present, the datetime attribute's value must be a valid date string with optional time.

~UAは、 `datetime$a 属性の値に,`省略あり日時~文字列を構文解析する$~algoを適用し~MUST。 その結果が[ `日付$ / `大域的~日時$ ]でない場合、改変には,時刻印は結付けられない(その値は、`妥当な省略あり日時~文字列$でないので,不適合とされる)。 他の場合、改変は[ `日付$ / `大域的~日時$ ]に行われたものと~markされる。 所与の値が`大域的~日時$である場合、~UAは,その偏差~情報を利用して 所与の日時0が属する時間帯を決定するべきである。 ◎ User agents must parse the datetime attribute according to the parse a date or time string algorithm. If that doesn't return a date or a global date and time, then the modification has no associated timestamp (the value is non-conforming; it is not a valid date string with optional time). Otherwise, the modification is marked as having been made at the given date or global date and time. If the given value is a global date and time then user agents should use the associated time-zone offset information to determine which time zone to present the given datetime in.

~UAは、この値を利用者に示してよいが、それは私的~利用が第一に意図されている。 ◎ This value may be shown to the user, but it is primarily intended for private use.

[ `ins$e / `del$e ]要素は、 `HTMLModElement$I ~interfaceを実装し~MUST: ◎ The ins and del elements must implement the HTMLModElement interface:

[Exposed=Window,
 `HTMLConstructor$I]
interface `HTMLModElement@I : `HTMLElement$I {
  [`CEReactions$] attribute USVString `cite$m;
  [`CEReactions$] attribute DOMString `dateTime$m;
};
`cite@m
この要素の `cite$a 内容~属性を`反映-$し~MUST。
`dateTime@m
この要素の `datetime$a 内容~属性を`反映-$し~MUST。
◎ The cite IDL attribute must reflect the element's cite content attribute. The dateTime IDL attribute must reflect the element's datetime content attribute.

4.7.4. 編集と段落

~INFORMATIVE

[ `ins$e / `del$e ]要素は,`段落$分けには影響しないので、`暗黙の段落$(明示的 `p$e 要素によるものでない段落)があるような事例では,[ `ins$e / `del$e ]要素は[ 段落~全体, あるいは`句内容$でない要素 ]と, 別の段落の一部とにわたることもあり得る。 例えば: ◎ Since the ins and del elements do not affect paragraphing, it is possible, in some cases where paragraphs are implied (without explicit p elements), for an ins or del element to span both an entire paragraph or other non-phrasing content elements and part of another paragraph. For example:

<section>
 <ins>
  <p>この段落は挿入されたものである。</p>
  これは別の段落であり、その 1 個目の文は上の段落と同時に挿入された。
 </ins>
 これは 2 個目の文になったが、当初からここにある。
</section>

`p$e 要素をまたがる いくつかの段落を包装することにより,同じ[ `ins$e / `del$e ]要素が[ 1 個目の段落の終わりから, 2 個目の段落~全体, 3 個目の段落の始まりまで ]にわたることすらある(これは紛らわしく,よい実践とは見なされないが): ◎ By only wrapping some paragraphs in p elements, one can even get the end of one paragraph, a whole second paragraph, and the start of a third paragraph to be covered by the same ins or del element (though this is very confusing, and not considered good practice):

<section>
 これは 1 個目の段落。
 <ins>この文は後から挿入された。
 <p>これは、挿入された 2 個目の段落。</p>
 この文も挿入された。</ins>
 これは 3 個目の段落。
 <!-- (このような書き方はしないこと) -->
</section>

しかしながら,`暗黙の段落$の定義される仕方に因り、ある段落の終わりから その次の段落の始まりまでを 1 個の[ `ins$e / `del$e ]要素で~mark-upするのは可能0でない。 代わりに,次の例のように,一方または両方の段落を `p$e で括った上で 各~段落ごとに[ `ins$e / `del$e ]要素を利用する必要がある: ◎ However, due to the way implied paragraphs are defined, it is not possible to mark up the end of one paragraph and the start of the very next one using the same ins or del element. You instead have to use one (or two) p element(s) and two ins or del elements, as for example:

<section>
 <p>これは 1 個目の段落。
 <del>この文は削除された。</del></p>
 <p><del>この文も削除された。</del> その文にも別の <del> 要素が必要である。</p>
</section>

上に述べた`暗黙の段落$境界をまたがる[ `ins$e / `del$e ]要素による紛らわしさからも、作者には,すべての段落を常に `p$e 要素で~mark-upすることが強く奨励される。 ◎ Partly because of the confusion described above, authors are strongly encouraged to always mark up all paragraphs with the p element, instead of having ins or del elements that cross implied paragraphs boundaries.

4.7.5. 編集と~list

~INFORMATIVE

`ol$e / `ul$e 要素の内容~modelでは、[ `ins$e / `del$e ]要素は子として許容されない。 ~listは、削除されたものと~markされた~itemも含め,常にその~itemすべてを表現する。 ◎ The content models of the ol and ul elements do not allow ins and del elements as children. Lists always represent all their items, including items that would otherwise have been marked as deleted.

~itemが[ 挿入-/削除- ]されたことを指示するためには、当の `li$e 要素の内容を[ `ins$e / `del$e ]要素で包装する。 ~itemが別のものに置換されたことを指示するためには、同じ `li$e 要素の中で 1 個~以上の `del$e 要素に 1 個~以上の `ins$e 要素を続ける。 ◎ To indicate that an item is inserted or deleted, an ins or del element can be wrapped around the contents of the li element. To indicate that an item has been replaced by another, a single li element can have one or more del elements followed by one or more ins elements.

次の例では、当初は空であった~listに,時経過に伴い~itemが追加され, 除去されている( ~listの “現在の” 状態を表す箇所を強調して示す)。 ~list~item番号は、編集には織り込まれないが。 ◎ In the following example, a list that started empty had items added and removed from it over time. The bits in the example that have been emphasized show the parts that are the "current" state of the list. The list item numbers don't take into account the edits, though.

<h1>不具合報告一覧</h1>
<ol>
 <li><ins datetime="2008-02-12T15:20Z">報告 225:
 降雪時に降雨検出器が働いていない</ins></li>
 <li><del datetime="2008-03-01T20:22Z"
    ><ins datetime="2008-02-14T12:02Z">報告 228:
 水緩衝器が雨季に溢れる</ins></del></li>
 <li><ins datetime="2008-02-16T13:50Z">報告 230:
 水加熱器に再生可能燃料が利用できない</ins></li>
 <li><del datetime="2008-02-20T21:15Z"
    ><ins datetime="2008-02-16T14:25Z">報告 232:
 始動後に二酸化炭素の排出が検出された</ins></del></li>
</ol>

次の例では、当初は果物の~listであったが,色の~listに置換されている: ◎ In the following example, a list that started with just fruit was replaced by a list with just colors.

<h1>いろいろな<del>果物</del><ins>色</ins></h1>
<ul>
 <li><del>ライム</del><ins>黄緑</ins></li>
 <li><del>リンゴ</del></li>
 <li>オレンジ</li>
 <li><del>ナシ</del></li>
 <li><ins>青緑</ins></li>
 <li><del>レモン</del><ins>黄</ins></li>
 <li>オリーブ</li>
 <li><ins>紫</ins></li>
</ul>

4.7.6. 編集と~table

~INFORMATIVE

~table~modelの一部を成す要素の内容~modelに課される要件は、複雑であり,[ `ins$e / `del$e ]要素を許容しないため、~tableにおいて編集を指示するのは,困難なこともある。 ◎ The elements that form part of the table model have complicated content model requirements that do not allow for the ins and del elements, so indicating edits to a table can be difficult.

~tableの行(列)全体が[ 追加-/除去- ]されたことを指示するためには、その行(列)内の各~cellごとに その内容~全体を[ `ins$e / `del$e ]要素で包装する。 ◎ To indicate that an entire row or an entire column has been added or removed, the entire contents of each cell in that row or column can be wrapped in ins or del elements (respectively).

~tableに行を追加する例: ◎ Here, a table's row has been added:

<table>
    <thead>
<tr><th> ゲーム名   <th> 開発元     <th> ~~評価
    <tbody>
<tr><td> Diablo 2  <td> Blizzard  <td> 8/10
<tr><td> Portal    <td> Valve     <td> 10/10
<tr><td> <ins>Portal 2</ins> <td> <ins>Valve</ins> <td> <ins>10/10</ins>
</table>

~tableから列を除去する例(除去した時刻, および その~~理由を説明する頁への~linkも与えられている): ◎ Here, a column has been removed (the time at which it was removed is given also, as is a link to the page explaining why):

<table>
    <thead>
<tr><th> ゲーム名   <th> 開発元    <th> <del
cite="/edits/r192" datetime="2011-05-02 14:23Z">~~評価</del>
    <tbody>
<tr><td> Diablo 2  <td> Blizzard <td> <del
cite="/edits/r192" datetime="2011-05-02 14:23Z">8/10</del>
<tr><td> Portal    <td> Valve    <td> <del
cite="/edits/r192" datetime="2011-05-02 14:23Z">10/10</del>
<tr><td> Portal 2  <td> Valve    <td> <del
cite="/edits/r192" datetime="2011-05-02 14:23Z">10/10</del>
</table>

一般に、より複雑な編集については,それを指示する よい仕方はない(例えば、ある~cellが除去され,後続の~cellが空いた所にずれ込んだときなど)。 ◎ Generally speaking, there is no good way to indicate more complicated edits (e.g. that a cell was removed, moving all subsequent cells up or to the left).