1. 序論
この文書は、 `UI-EVENTS$r にて述べられれた 2 つの~event — `input$et, `beforeinput$et `UI-EVENTS$r — に対する,編集に関係する追加について述べる。 これらの~eventの目標は、作者が編集-時の既定の挙動を,編集が生じる前と後の両者について,解したり上書きできるようにすることである。 ◎ This document describes editing related additions to 2 events - input and beforeinput which are described in the UI events spec [UI-EVENTS]. The goal of these events is to allow authors to understand and/or override default edit behavior both before and after editing occurs.
2. 定義
- `DataTransfer$I
- `DataTransfer^I ~objは、何らかの型の入力に対し,~richtextや~plaintextによる~dataを包含する。 `HTML$r ◎ A DataTransfer object contains richtext and plaintext data for some inputtypes. [HTML]
- `意向を表す@ ( express an intention )
- 利用者は、[ ~keyboard, ~IME, ~speech, などに類する~method ]をもって,特定の~編集中の~演算を実行する`意向を表す$ことができる。 特定の~入力~動作は、~platform特有の規約に従う意向に,対応付けられる。 ◎ A user can express an intention to execute a specific editing operation by means of keyboard, IME, speech, or similar method. Specific input actions are mapped to intentions following platform-specific conventions.
- `~kill-buffer@ ( kill buffer )
- この定義は規範的ではない。 ◎ This definition is not normative.
- `~kill-buffer$は、~clipboardとは別々の記憶域に格納された~richtext内容であり、特定の削除~commandを用いて削除された内容を,一時的に保持できるようにする。 利用者は、~kill-bufferを `引き出す@ ( yank する)意向を指示することにより、現在の選択を~kill-bufferの内容で置換できる。 ◎ A kill buffer is a in-memory store of richtext content that is separate from the clipboard which allows for the temporal storage of content that was deleted using specific deletion commands. The user can replace the current selection with the content held in the kill buffer by indicating an intention to yank the kill buffer.
- `編集可能@ な要素( contenteditable )
- `contenteditable$a 属性に基づいて,利用者が内容を編集できるとされる要素。
- 【 この項目は,訳者による追加であり、その定義も訳者の推定による。 原文では、単に “contenteditable 要素” あるいは “`contenteditable^c 要素” 。 】
3. ~~解決される問題
~INFORMATIVE~browser~codeの上層に ~webに基づく~text~editorを作成するためには、他にも相当量の~JSを要する — なぜなら: ◎ Creating a webbased texteditor requires a considerable amount of JavaScript on top of the browser code, among other things because:
- すべての~browserが編集~演算を同じ仕方で取扱うわけではない。 ◎ Browsers do not handle all editing operations the same way.
- 編集~演算によっては、~browserの取扱いに~bugが多い。 ◎ Browsers are often buggy in the way they handle certain editing operations.
- 編集~演算によっては、個々の~siteごとに,その取扱いに~custom選好があり得る。 ◎ Individual sites may have custom preferences for how they want to handle certain editing operations.
- ~browserにおける高~levelの~text編集 特色機能の開発は、 Extensible Web Manifesto に画策された原則に従っていない — これらの特色機能の開発は、~web開発者~communityの必要性と常に協調しているわけではない。 ◎ The development of high-level text editing features in browsers has not followed the principles laid out in the Extensible Web Manifesto in that development of these features has not always been in coordination with the needs of the web developer community.
この仕様は、次の両者について,~web開発者にとって単純な仕方を供することにより、問題を~~軽減しようと~~試みるものである:
- ~text編集に関係する すべての利用者~入力に対する~browserによる取扱いを, `beforeinput$et ~eventを通して上書きする。
- 利用者~入力に因り~DOM内の何が変更されたかを, `input$et ~eventを通して監視する。
4. 利用事例
~INFORMATIVE- 利用者が~boldと~markした~textを `<b>^e ~tagに代えて `<strong>^e ~tagを利用するように~markするような次のような~JS~text~editorを作成すること — ~browserに組込みの ~textを~boldとして~markするような仕方を利用して【?】 — 既存の~browserすべてに~accessする必要なく【?】 ◎ Creating a JavaScript text editor in which the <strong>-tag is used instead of the <b>-tag to mark text that the user marks as bold, using any browser-builtin way to mark a text as bold, without having access to all existing browsers.
- 背後の~data~modelに働き,[ ~JSが,~text編集による変更を ~DOMに反映させることを~careする ]ような、~JS~text~editorを作成すること。 ◎ Creating a JavaScript text editor which works with a data model in the background where JavaScript takes care of rendering changes to the edited text to the DOM.
- ~richtext編集を部分的にのみ許容するような~JS~editorを作成すること(例えば、~boldは許容する一方で~italicは許容しない)。 ◎ Creating a JavaScript editor which only allows a subset of richtext editing (for example: bold is allowed, but italic not).
- 様々な~browserを様々な意向で利用している利用者の意向に基づいて、[ ~JSを利用して,変更を~DOMに反映させる ]ような,共同作業可能な~editorを作成すること。 ◎ Creating a collaborative editor in which JavaScript is used to render changes to the DOM, based on user intentions with users using different browsers with different ways of expressing specific intentions.
- 様々な利用者からの~accessに対する~optionを備えるような,~JS~editorを作成すること — 例えば、ある利用者に可能なのは ~textを追加する/削除することに限られ、別の利用者に可能なのは ある種の整形を追加する/除去することに限られる,など。 ◎ Creating a JavaScript editor with different user access options, where some users only can add or delete text and other users only can add or remove certain types of formatting.
5. 入力~event型
入力~eventは、利用者が~markupを編集しようと試みる前( `beforeinput$et ~event )と試みた後( `input$et ~event)に送信される。 これには、内容の挿入, 削除,あるいは整形の変更も含まれる。 ◎ Input events are sent before (beforeinput event) and after (input event) a user attempts to edit the markup. This includes insertion and deletion of content, and formatting changes.
入力~eventは、編集中の~hostとして動作する要素に向けて`配送-$される。 `UI-EVENTS$r そのような要素には、次が挙げられる:
- `contenteditable$a 属性が設定されているもの
- `textarea$e 要素
- ~text入力を許容する `input$e 要素
5.1. ~interface `InputEvent^I
partial interface `InputEvent$I { readonly attribute DOMString `inputType$m; readonly attribute `DataTransfer$I? `dataTransfer$m; sequence<`StaticRange$I> `getTargetRanges()$m; }; partial dictionary `InputEventInit$I { DOMString `inputType$mI = ""; `DataTransfer$I? `dataTransfer$mI = null; sequence<`StaticRange$I> `targetRanges$mI = []; };
`InputEvent$I, `InputEventInit$I は、 `UI-EVENTS$r に定義される。 ◎ The InputEvent and InputEventInit objects are defined in [UI-EVENTS].
`InputEventInit$I の[ `inputType@mI, `dataTransfer@mI, `targetRanges@mI ]属性は、 `InputEvent$I ~objの対応する属性を初期化する。 ◎ The attributes inputType, dataTransfer and targetRanges of InputEventInit initialize the corresponding attributes of the InputEvent object.
5.1.1. 概観
~INFORMATIVE[ `data$m, `dataTransfer$m ]属性が,いつ[ 内容を包含する/~NULL にされる ]か, および `getTargetRanges()$m ~methodが `inputType$m に基づいて,いつ[ 空 /空でない ] Array を返すかを,次の表に要約する。 ◎ The following table provides a summary of when the data and dataTransfer attributes contain contents and when they are null as well as when the getTargetRanges() method returns an empty or non-empty Array, based on the inputType.
編集中の~host | `inputType$m | `data$m | `dataTransfer$m | `getTargetRanges()$m |
---|---|---|---|---|
`編集可能$ | `insertText^l, `insertCompositionText^l, `insertFromComposition^l, `formatSetBlockTextDirection^l, `formatSetInlineTextDirection^l, `formatBackColor^l, `formatFontColor^l, `formatFontName^l, `insertLink^l | 非~NULL | ~NULL | 空でない Array |
`編集可能$ | `insertFromPaste^l, `insertFromDrop^l, `insertReplacementText^l, `insertFromYank^l | ~NULL | 非~NULL | 空でない Array |
`<textarea>^e, `<input type="text">^e | `insertText^l, `insertCompositionText^l, `insertFromComposition^l, `insertFromPaste^l, `insertFromDrop^l, `insertReplacementText^l, `insertFromYank^l, `formatSetBlockTextDirection^l, `formatSetInlineTextDirection^l, `formatBackColor^l, `formatFontColor^l, `formatFontName^l, `insertLink^l | 非~NULL | ~NULL | 空 Array |
すべて | `historyUndo^l, `historyRedo^l | ~NULL | ~NULL | 空 Array |
`編集可能$ | 残り全て | ~NULL | ~NULL | 空でない Array |
`<textarea>^e, `<input type="text">^e | 残り全て | ~NULL | ~NULL | 空 Array |
5.1.2. 各種 属性
~UAは、~eventの初期化-時に,一部の各種~属性を以下に従って拡充し~MUST: ◎ ↓
- `inputType@m
- 入力の型を保持する。 ◎ inputType holds the type of input. During initialization, the user agent [UI-EVENTS] is responsible for populating this field as follows:
-
`beforeinput$et ~eventの取消~可否は,下に与える `inputType$m 値に依存し、次に挙げるいずれかの値に初期化される場合は取消せない( `cancelable$m は ~F になる):
- `insertCompositionText^l
- `deleteCompositionText^l
-
この属性は、次の表の 2, 3, 4 列目に与える[ 利用者が`表した意向$, ~IME組成の間に編集が生じるかどうか, 選択の状態 ]に応じて,表の 1 列目に与える値にされ~MUST: ◎ The inputType to be picked depends on the user's expression of intention, whether or not the editing takes place during an IME composition and the state of the selection. ◎ This specification defines the inputType values as the values in the inputType column of the following table.
【 原文の表には `beforeinput$et ~eventの取消~可否の列もあるが、この訳ではその列を省略して,上の記述に集約している。 】
- 編集? 列の[ “・” は ~IME組成の間に編集は生じない / `編^i は ~IME組成の間に編集は生じる ]ことを表す。
- 選択~状態 列の[ 空欄は 選択~状態は関わらない(無条件) / `畳^i は 選択は畳まれている / `非畳^i は選択は畳まれていない ]ことを表す。
`inputType$m 利用者が`表した意向$ ◎ User's expression of intention 編集? ◎ Part of IME composition 選択~状態 ◎ State of selection `insertText^l 打込んだ素の~textを挿入する ◎ insert typed plain text ・ `insertReplacementText^l ~spell-checker, 自動訂正などに類する~methodにより,既存の~textを置換する ◎ replace existing text by means of a spell checker, auto-correct or similar ・ `insertLineBreak^l 改行を挿入する ◎ insert a line break ・ `insertParagraph^l 段落~分断を挿入する ◎ insert a paragraph break ・ `insertOrderedList^l 番号付き~listを挿入する ◎ insert a numbered list ・ `insertUnorderedList^l 番号無し~listを挿入する ◎ insert a bulleted list ・ `insertHorizontalRule^l 水平罫線を挿入する ◎ insert a horizontal rule ・ `insertFromYank^l `~kill-buffer$に格納されている内容で,現在の選択を置換する ◎ replace the current selection with content stored in a kill buffer ・ `insertFromDrop^l ~dropにより,~DOMの中へ内容を挿入する ◎ insert content into the DOM by means of drop ・ `insertFromPaste^l ~pasteする ◎ paste ・ `insertTranspose^l 手入力された最後の 2 文字を入替える ◎ transpose the last two characters that were entered ・ `insertCompositionText^l 現在の組成~文字列を置換する ◎ replace the current composition string `編^i `insertFromComposition^l ~DOMの中へ,次の組成~文字列の一部を成さない最終的に組成された文字列を挿入する ◎ insert into the DOM a finalized composed string that will not form part of the next composition string `編^i `insertLink^l ~linkを挿入する ◎ insert a link ・ `deleteByComposition^l ~IMEを用いて当の部分を再組成するために,~DOMの一部を除去する ◎ remove a part of the DOM in order to recompose this part using IME `編^i `deleteCompositionText^l ~IMEを用いる組成の間に,~DOMに最終的に文字列を~commitする前に,現在の組成~文字列を削除する ◎ delete the current composition string before commiting a finalized string to the DOM `編^i `deleteWordBackward^l ~caret位置の直前にある単語を削除する ◎ delete a word directly before the caret position ・ `畳^i `deleteWordForward^l ~caret位置の直後にある単語を削除する ◎ delete a word directly after the caret position ・ `畳^i `deleteSoftLineBackward^l ~caret位置からその前にある最も近い視覚的~改行までを削除する ◎ delete from the caret to the nearest visual line break before the caret position ・ `畳^i `deleteSoftLineForward^l ~caret位置からその後にある最も近い視覚的~改行までを削除する ◎ delete from the caret to the nearest visual line break after the caret position ・ `畳^i `deleteEntireSoftLine^l [ ~caret位置の前にある最も近い視覚的~改行 ]から[ ~caret位置の後にある最も近い視覚的~改行 ]までを削除する ◎ delete from to the nearest visual line break before the caret position to the nearest visual line break after the caret position ・ `畳^i `deleteHardLineBackward^l ~caret位置からその前にある最も近い[ 塊~要素または `br$e 要素 ]の始まりまでを削除する ◎ delete from the caret to the nearest beginning of a block element or br element before the caret position ・ `畳^i `deleteHardLineForward^l ~caret位置からその後にある最も近い[ 塊~要素または `br$e 要素 ]の終わりまでを削除する ◎ delete from the caret to the nearest end of a block element or br element after the caret position ・ `畳^i `deleteByDrag^l ~dragにより,~DOMから内容を除去する ◎ remove content from the DOM by means of drag ・ `deleteByCut^l ~cutの一部として,現在の選択を除去する ◎ remove the current selection as part of a cut ・ `deleteContent^l 他の `inputType$m 値に該当しない意向の下で、削除の方向を指定せずに,選択を削除する ◎ delete the selection without specifying the direction of the deletion and this intention is not covered by another inputType ・ `非畳^i `deleteContentBackward^l 次のいずれか: - 他の `inputType$m 値に該当しない意向の下で、~caret位置の直前にある内容を削除する
- 選択を,削除~後にその始端に畳まれるように削除する
・ `非畳^i `deleteContentForward^l 次のいずれか: - 他の `inputType$m 値に該当しない意向の下で、~caret位置の直後にある内容を削除する
- 選択を,削除~後にその終端に畳まれるように削除する
・ `非畳^i `historyUndo^l 最後の編集~動作を~undoする ◎ undo the last editing action ・ `historyRedo^l 最後の~undone編集~動作を~redoする ◎ to redo the last undone editing action ・ `formatBold^l ~bold~textを起動する ◎ initiate bold text ・ `formatItalic^l ~italic~textを起動する ◎ initiate italic text ・ `formatUnderline^l ~underline~textを起動する ◎ initiate underline text ・ `formatStrikeThrough^l ~stricken~textを起動する ◎ initiate stricken through text ・ `formatSuperscript^l ~superscript~textを起動する ◎ initiate superscript text ・ `formatSubscript^l ~subscript~textを起動する ◎ initiate subscript text ・ `formatJustifyFull^l 現在の選択を両端揃えにする ◎ make the current selection fully justified ・ `formatJustifyCenter^l 現在の選択を中央に寄せる ◎ center align the current selection ・ `formatJustifyRight^l 現在の選択を右端に寄せる ◎ right align the current selection ・ `formatJustifyLeft^l 現在の選択を左端に寄せる ◎ left align the current selection ・ `formatIndent^l 現在の選択の字下げを増やす ◎ indent the current selection ・ `formatOutdent^l 現在の選択の字下げを減らす ◎ outdent the current selection ・ `formatRemove^l 現在の選択からすべての整形情報を除去する ◎ remove all formatting from the current selection ・ `formatSetBlockTextDirection^l ~text塊~方向を設定する ◎ set the text block direction ・ `formatSetInlineTextDirection^l ~text行内~方向を設定する ◎ set the text inline direction ・ `formatBackColor^l 背景~色を変更する ◎ change the background color ・ `formatFontColor^l ~font色を変更する ◎ change the font color ・ `formatFontName^l `font-family^p を変更する ◎ change the font-family ・ - 注記: 他の仕様は、この定義を拡げて~MAY。 ◎ Note ◎ Other specifications may expand on this definition.
- 注記: 上に挙げられているからといって、実装が それらの `inputType$m 値すべてを~supportすることにはならない。 所与の~browserが[ ~DOMを変化させ得るような,ある編集~演算 ]を~supportする場合、対応する[ `beforeinput$et, `input$et ]~eventを`配送-$し~MUST。 `UI-EVENTS$r ◎ Note ◎ The existence of the above mentioned inputTypes does not mean that any given implementation will support all of these. But if a given browser supports an editing operation which potentially leads to a change of the DOM, it MUST dispatch [UI-EVENTS] the corresponding beforeinput and input events.
- 注記: 選択が畳まれている場合、次のいずれにも `deleteContentBackward^l が利用される: 利用者が[ ~text~nodeの中で~textを削除する / より複雑な要素を削除する / ~caretが~text~nodeの始端にある場合に 段落を併合する ]意向を示したとき。 削除されるのが[ 符号位置, 書記素 ]のいずれになるかは、用字系により異なり得る。 書記素は、複数個の 1 個の符号位置に対応する何個かの文字からなり得る。 `getTargetRanges()$m ~methodを利用すれば、~text~nodeの中で削除する際に~browserが既定で除去する文字~数を見出せる。 ◎ Note ◎ If the selection is collapsed, "deleteContentBackward" will be used both when the user asks for text deletion within a text node, and when the user shows the intention to deletion of more complex elements or merge paragraphs if the caret is at the start of a text node. In some scripts, backward deletion within a text node with a collapsed selection will delete a code point rather than a grapheme. A grapheme can consist of several characters, where each character corresponds to a code point. The getTargetRanges() method can be used to find out how many characters the browser will remove by default if deleting within a text node.
- 注記: 上の `deleteContentBackward^l と同じ注記が `deleteContentBackward^l にも該当する — その記述の “始端” を “終端” に置き換えることを除いて。 ◎ Note ◎ If the selection is collapsed, "deleteContentForward" will be used both when the user asks for text deletion within a text node, and when the user shows the intention to deletion of more complex elements or merge paragraphs if the caret is at the end of a text node. In some scripts, forward deletion within a text node with a collapsed selection will delete a grapheme rather than a code point. A grapheme can consist of several characters, where each character corresponds to a code point. The getTargetRanges() method can be used to find out how many characters the browser will remove by default if deleting within a text node.
- `data$m
-
この属性は、文書に追加されるものに関係する~plaintext~data情報を保持する。 次の表の 1, 2 列目に与える [ `inputType$m の値, 編集中の~host ]に応じて,表の 3 列目に与える値になる: ◎ data holds information plaintext data related to what is to be added to the document.
`inputType$m 編集中の~host◎ Editing host `data$m `insertText^l, `insertCompositionText^l, `insertFromComposition^l 任意 挿入されようとしている~text文字列 ◎ the plain text string to be inserted `insertFromPaste^l, `insertFromDrop^l, `insertTranspose^l, `insertReplacementText^l, `insertFromYank^l `input$e / `textarea$e 挿入されようとしている~text文字列 ◎ the plain text string to be inserted `formatSetInlineTextDirection^l, `formatSetBlockTextDirection^l 任意 `ltr^l, `rtl^l, `auto^l, `null^l のいずれか `formatBackColor^l, `formatFontColor^l 任意 提された色に対応する, RGB 関数~形 の文字列 `CSS-COLOR-4$r ◎ a string containing an RGB function call [CSS-COLOR-4] corresponding to the proposed color `formatFontName^l 任意 `font-family^p ~prop値として提された値 ◎ the proposed value of the font-family CSS property `insertLink^l 任意 ~linkを与える~urlとして提された値 ◎ the url of the proposed link その他 ◎ All remaining 任意 ~NULL - `dataTransfer@m
- [ 文書から取り出される / 文書に追加される ]ような,関連する[ ~richtextや~plaintext ]の~dataがあれば、その情報を `DataTransfer$I ~obj `HTML$r 内に保持する。 ◎ dataTransfer holds information about richtext and plaintext data that is to be taken from or added to the document in a DataTransfer object if there is relevant data.
-
[ 次がいずれも満たされるならば その下に与える値/ ~ELSE_ ~NULL ]で拡充される:
- 編集中の~hostは`編集可能$である
- `inputType$m ~IN { `insertFromPaste^l, `insertFromDrop^l, `insertTranspose^l, `insertReplacementText^l, `insertFromYank^l }
拡充する値は、 `DataTransfer$I ~objであって,その`~item~list$dndは,次に与える[ %item1, %item2 ]からなる:
- %item1 の`実~data$dnd ~SET 追加される内容の~HTML~表現
- %item2 の`実~data$dnd ~SET 追加される内容の素の~text表現
- %item1, %item2 とも,その`型~文字列$dnd ~SET `text/html^l
- %item1, %item2 とも,その`種類$dnd ~SET `素の~Unicode文字列^i
追加される内容としては、例えば 次のものが挙げられる ⇒# ~clipboard内にあるもの / `~kill-buffer$内にあるもの / ~pasteされたもの / ~dropされたもの
◎ inputType | Editing host | dataTransfer "insertFromPaste", "insertFromDrop", "insertTranspose", "insertReplacementText" or "insertFromYank" | contenteditable | A prepopulated DataTransfer object so that: • The DataTransfer object's drag data store item list contains one entry with the drag data item type string "text/html", whose kind is Plain Unicode string, and whose data is a HTML representation of the content that is in the clipboard, or in the kill buffer, to be dropped or otherwise the content that is to be added. [HTML] • The DataTransfer object's drag data store item list contains one entry with the drag data item type string "text/plain", whose kind is Plain Unicode string, and whose data is a plain text representation of the content that is to be pasted, dropped or otherwise added. [HTML] ◎ All remaining | Any | null
5.1.3. ~method
- `getTargetRanges()@m
-
次がいずれも満たされるならば、この~eventに結付けられている一連の `StaticRange$I からなる Array を返す `DOM$r :
- `inputType$m ~NIN { `historyUndo^l, `historyRedo^l }
- `編集中の~host$は`編集可能$である
他の場合は 空 Array を返す。
◎ inputType | Editing host | Response of getTargetRanges() "historyUndo" or "historyRedo" | Any | empty Array All remaining | contenteditable | an Array of StaticRanges [DOM] associated with event All remaining | input or textarea | an empty Array ◎ returns , unless the inputType is "historyUndo" or "historyRedo" or the editing host is not a contenteditable element, in which case it returns an empty Array.
5.2 各種~eventの定義
◎イ型 `beforeinput@et ◎界面 `InputEvent$I ◎同期 あり ◎浮上 する ◎標的 `編集可能$である任意の要素 ◎ Any Element with contenteditable attribute enabled. ◎既定動作 文脈依存:- `contentEditable$m が `typing^l にされた`編集中の~host$においては、 `inputType$m ~IN[ `insertCompositionText^l / `deleteCompositionText^l ]ならば, “~DOMを更新する” 。
- `contentEditable$m が `true^l にされた`編集中の~host$においては、 `inputType$m が何であれ, “~DOM要素を更新する”
- 他の場合は、なし
- `data$m
- 要素に追加された~dataを包含している文字列。 適用されない場合は ~NULL になる。 ◎ InputEvent.data: the string containing the data that was added to the element, which MAY be null if it doesn't apply.
- `dataTransfer$m
- 要素[ に追加された/から削除された ]~richtextを包含している文字列。 適用されない場合は ~NULL になる。 ◎ InputEvent.dataTransfer: richtext data added or removed from element, which MAY be null if it doesn't apply.
- `getTargetRanges()$m
- 取消されなかった場合には、~DOMに対する変更により影響されることになる `StaticRange$I の配列を返す。 ◎ InputEvent.getTargetRanges(): returns an arrays of StaticRanges which will be affected by the change to the DOM if it is not canceled.
~UAは、利用者が`編集可能$な要素にて入力を試みたときに,この~eventを`配送-$し~MUST。 これは、~UAが~DOMを更新することを意味するとは限らない。 ◎ A user agent MUST dispatch [UI-EVENTS] this event when the user has attempted to input in a contenteditable element. It does not necessarily mean the user agent [UI-EVENTS] will then update the DOM.
~UAは、~system~eventなど,利用者により試みられた入力~以外に因る~eventに対しては、この~eventを`配送-$しては~MUST_NOT。 ◎ A user agent MUST NOT dispatch [UI-EVENTS] this event due to events that are not caused by attempted user input, such as system events.
◎イ型 `input@et ◎界面 `InputEvent$I ◎同期 あり ◎浮上 する ◎標的 `編集可能$である任意の要素 ◎ Any Element with contenteditable attribute enabled. ◎既定動作 なし ◎文脈- `data$m
- 要素に追加された~dataを包含している文字列。 適用されない場合は ~NULL になる。 ◎ InputEvent.data: the string containing the data that was added to the element, which MAY be null if it doesn't apply.
- `dataTransfer$m
- 要素[ に追加された/から削除された ]~richtextを包含している文字列。 適用されない場合は ~NULL になる。 ◎ InputEvent.dataTransfer: richtext data added or removed from element, which MAY be null if it doesn't apply.
~UAは、[ 利用者が[ ~browserが取扱った文書~内容 ]を変更する意向を表したことに因り,~DOMが更新された直後 ]に,この~eventを`配送-$し~MUST。 ◎ A user agent [UI-EVENTS] MUST dispatch [UI-EVENTS] this event immediately after the DOM has been updated due to a user expressed intention to change the document contents which the browser has handled.
6. ~IME 組成の間の~eventの順序
~IME~組成( composition )は,いくつかの `beforeinput$et ~eventを生じさせるが、それらすべてを取消せるとは限らない: ◎ An IME composition causes several beforeinput events, not all of which can be canceled.
-
~IF[ 初期~組成~文字列【組成~開始-時の選択~内容】 は空でない(すなわち,この組成は既存の~DOM範囲を再組成するものである) ]: ◎ If the composition is starting with an empty initial composition string (i.e. the composition is not recomposing an existing range of the DOM), this step is skipped.
- ~DOMから初期~組成~文字列を抽出する ◎ The UA extracts the initial composition string from the DOM.
- `beforeinput$et ~eventを次のように初期化した上で`配送-$する ⇒ `inputType$m ~SET `deleteByComposition^l ◎ A beforeinput event with the inputType "deleteByComposition" is dispatched [UI-EVENTS].
-
~IF[ 前~段の~eventは取消されなかった ]:
- ~DOMから初期~組成~文字列を除去する ◎ Unless the beforeinput event has been canceled, the initial composition string is removed from the DOM.
- `input$et ~eventを次のように初期化した上で`配送-$する ⇒ `inputType$m ~SET `deleteByComposition^l ◎ Unless the beforeinput event has been canceled, an input event with the inputType "deleteByComposition" is dispatched [UI-EVENTS].
注記: この~eventに対する既定~動作は、 `targetRanges$mI (初期~組成~文字列が占めていた部位)を~DOMから除去する。 この~eventは、取消せる — 取消した場合、前項の既定~動作は防止される。 ~eventを取消す/取扱うことにより,組成が終えられたり, 組成が初期~組成~文字列の内容に波及しなくなることはない。 ◎ This note is not normative. ◎ The default action for this beforeinput event is the removal of the targetRanges from the DOM (i.e. the initial composition string will be removed from the DOM). ◎ The beforeinput event can be canceled. Canceling the event will prevent the browser from removing the initial composition string from the DOM. Canceling or handling the event will not prevent the composition from taking place or influence the contents of the initial composition string.
- `beforeinput$et ~eventを`配送-$する ◎ A compositionstart event is dispatched. [UI-EVENTS].
-
~IF[ 初期~組成~文字列は空でない ]: ◎ If the composition has an empty initial composition string, this step is skipped.
-
`beforeinput$et ~eventを次のように初期化した上で`配送-$する
⇒
`inputType$m 属性 ~SET `insertCompositionText^l,
`data$m 属性 ~SET 初期~組成~文字列 ◎ A beforeinput event with the inputType "insertCompositionText" is dispatched [UI-EVENTS] with the data attribute set to the initial composition string. - 初期~組成~文字列を選択の始端に挿入して,~DOMを更新する ◎ The DOM is updated with the insertion of the initial composition string at the start of the selection.
- `input$et ~eventを次のように初期化した上で`配送-$する ⇒ `inputType$m 属性 ~SET `insertCompositionText^l ◎ An input event with the inputType "insertCompositionText" is dispatched [UI-EVENTS]
注記: この `beforeinput$et ~eventは取消せないことに注意。 ◎ Note ◎ This note is not normative. ◎ Notice that the beforeinput event cannot be canceled.
-
`beforeinput$et ~eventを次のように初期化した上で`配送-$する
⇒
`inputType$m 属性 ~SET `insertCompositionText^l,
-
組成~文字列による各~DOM更新-に対し: ◎ With each DOM update of the composition string:
-
`beforeinput$et ~eventを次のように初期化した上で`配送-$する
⇒
`inputType$m 属性 ~SET `insertCompositionText^l,
`data$m 属性 ~SET 更新された組成~textの内容 ◎ A beforeinput event with the inputType "insertCompositionText" is dispatched [UI-EVENTS] with the data attribute set to the updated contents of the composition text. - `compositionupdate$et ~eventを`配送-$する ◎ A compositionupdate event is dispatched. [UI-EVENTS].
- ~DOMを更新する ◎ The DOM is updated.
- `input$et ~eventを次のように初期化した上で`配送-$する ⇒ `inputType$m 属性 ~SET `insertCompositionText^l ◎ An input event with the inputType "insertCompositionText" is dispatched [UI-EVENTS].
注記: この段は、~DOMに~commitされることになる~text(すなわち、組成により制御される範囲の外側にあって,~DOMの一部になるもの)がある限り,繰り返される。 ◎ Note ◎ This step is repeated as long as no text is to be committed to the DOM (i.e. is made to be part of the DOM outside the range controlled by the composition).
-
`beforeinput$et ~eventを次のように初期化した上で`配送-$する
⇒
`inputType$m 属性 ~SET `insertCompositionText^l,
-
組成~文字列の一部または全部が~DOMに~commitされるときは: ◎ When a part or the entire composition string is to be committed to the DOM:
- %文字列 ~LET ~commitされる文字列
- `beforeinput$et ~eventを次のように初期化した上で`配送-$する ⇒ `inputType$m ~SET `deleteCompositionText^l ◎ A beforeinput event with the inputType "deleteCompositionText" is dispatched [UI-EVENTS].
- 組成~処理-により制御される範囲の内容を、~DOMから除去する ◎ The contents of the range controlled by the composition process is removed from the DOM.
-
`beforeinput$et ~eventを次のように初期化した上で`配送-$する
⇒
`inputType$m ~SET `insertFromComposition^l,
`data$m ~SET %文字列 ◎ A beforeinput event with the inputType "insertFromComposition" is dispatched [UI-EVENTS] with the data attribute set to the part of the final composition string that is to be committed to the DOM. -
~IF[ 前~段の~eventは取消されなかった ]:
- %文字列 を選択の始端に挿入して,~DOMを更新する
- `compositionend$et ~eventを`配送-$する
- `input$et ~eventを次のように初期化した上で`配送-$する ⇒ `inputType$m 属性 ~SET `insertFromComposition^l
- ~ELSE ⇒ `compositionend$et ~eventを`配送-$する ◎ ↑
- ~IF[ 組成~文字列の一部のみ,~DOMに~commitされた ] ⇒ 組成~文字列の まだ~commitされていない部分を新たな初期~組成~文字列とする下で,段 3 へ戻る。 ◎ If only a part of the composition string was committed to the DOM, while another part is not yet to be committed, the process starts over from step 3 with the non-committed part of the final composition string as the new initial composition string.
注記: `compositionstart$et ~eventは 組成ごとに 1 回だけだが、 `compositionend$et ~eventは 複数回あり得ることに注意。 ◎ Note ◎ This note is not normative. ◎ Note that while every composition only has one compositionstart event, it may have several compositionend events.
~security/~privacy上の考慮点
~INFORMATIVE`keydown^et や `keypress^et `UI-EVENTS$r ~eventなどの 既存の~eventを通してすでに可用な指紋収集 `fingerprinting-guidance$r 技法を超えるような、この特色機能による既知の[ ~security/~privacy ]上の~~影響はない。 ◎ There are no known security or privacy impacts of this feature beyond fingerprinting [fingerprinting-guidance] techniques that already are available through existing events, such as the keydown and keypress [UI-EVENTS] events.
この特色機能が,既存の~eventを置換する場合、可用な指紋収集~技法における decline をもたらし得る — [ 利用者の意向を表すために利用された,利用者が利用している特定0の~hardware ]の種別ではなく,その意向が記録されるので。 ◎ If this feature replaces existing events, it MAY lead to a decline in available fingerprinting [fingerprinting-guidance] techniques, as users' intentions are recorded, and not the particular type of hardware they used to express this intention.