| 1 |
#pattern
|
| 2 |
<span class=secno>* </span>Event
|
| 3 |
handler attributes
|
| 4 |
#ja
|
| 5 |
<span class=secno>$1 </span>事象取扱器属性
|
| 6 |
|
| 7 |
#en
|
| 8 |
<a href="#html-elements">HTML elements</a> can have <dfn id=event2>event
|
| 9 |
handler attributes</dfn> specified. These act as bubbling event listeners
|
| 10 |
for the element on which they are specified.
|
| 11 |
#ja
|
| 12 |
<a href="#html-elements">HTML 要素</a>には<dfn id=event2>事象取扱器属性</dfn>を指定することができます。
|
| 13 |
これは指定された属性に対する泡立ち事象聴取器として機能します。
|
| 14 |
|
| 15 |
#en
|
| 16 |
Each event handler attribute has two parts, an <a href="#event3"
|
| 17 |
title="event handler content attributes">event handler content
|
| 18 |
attribute</a> and an <a href="#event4" title="event handler DOM
|
| 19 |
attributes">event handler DOM attribute</a>. Event handler attributes must
|
| 20 |
initially be set to null. When their value changes (through the changing
|
| 21 |
of their event handler content attribute or their event handler DOM
|
| 22 |
attribute), they will either be null, or have an
|
| 23 |
<code>EventListener</code> object assigned to them.
|
| 24 |
#ja
|
| 25 |
各事象取扱器属性は、<a href="#event3"
|
| 26 |
title="event handler content attributes">事象取扱器内容属性</a>と<a href="#event4" title="event handler DOM
|
| 27 |
attributes">事象取扱器 DOM 属性</a>の2つの部分を持ちます。
|
| 28 |
事象取扱器属性は、はじめ、 null に設定されなければ[[MUST:なりません]]。
|
| 29 |
(事象取扱器内容属性または事象取扱器 DOM 属性の変更により) 値が変化した時は、
|
| 30 |
null となるか、または <code>EventListener</code>
|
| 31 |
オブジェクトが割り当てられるかのいずれかとなります。
|
| 32 |
|
| 33 |
#en
|
| 34 |
Objects other than <code>Element</code> objects, in particular <code><a
|
| 35 |
href="#window">Window</a></code>, only have <a href="#event4" title="event
|
| 36 |
handler DOM attributes">event handler DOM attribute</a> (since they have
|
| 37 |
no content attributes).
|
| 38 |
#ja
|
| 39 |
<code>Element</code> オブジェクト以外のオブジェクト、特に <code><a
|
| 40 |
href="#window">Window</a></code> は、<a href="#event4" title="event
|
| 41 |
handler DOM attributes">事象取扱器 DOM 属性</a>だけを持ちます (内容属性を持ちませんから)。
|
| 42 |
|
| 43 |
#en
|
| 44 |
<dfn id=event3>Event handler content attributes</dfn>, when specified,
|
| 45 |
must contain valid ECMAScript code matching the ECMAScript <code
|
| 46 |
title="">FunctionBody</code> production. <a
|
| 47 |
href="#refsECMA262">[ECMA262]</a>
|
| 48 |
#ja
|
| 49 |
<dfn id=event3>事象取扱器内容属性</dfn>は、指定された場合、
|
| 50 |
ECMAScript <code
|
| 51 |
title="">FunctionBody</code> 生成規則に一致する妥当な ECMAScript 符号を含まなければなりません。<a
|
| 52 |
href="#refsECMA262">[ECMA262]</a>
|
| 53 |
|
| 54 |
#en
|
| 55 |
When an event handler content attribute is set, its new value must be
|
| 56 |
interpreted as the body of an anonymous function with a single argument
|
| 57 |
called <code>event</code>, with the new function's scope chain being
|
| 58 |
linked from the activation object of the handler, to the element, to the
|
| 59 |
element's <code>form</code> element if it is a form control, to the
|
| 60 |
<code>Document</code> object, to the <code><a
|
| 61 |
href="#window">Window</a></code> object of the <a
|
| 62 |
href="#browsing1">browsing context</a> of that <code>Document</code>. The
|
| 63 |
function's <code>this</code> parameter must be the <code>Element</code>
|
| 64 |
object representing the element. The resulting function must then be set
|
| 65 |
as the value of the corresponding event handler attribute, and the new
|
| 66 |
value must be set as the value of the content attribute. If the given
|
| 67 |
function body fails to compile, then the corresponding event handler
|
| 68 |
attribute must be set to null instead (the content attribute must still be
|
| 69 |
updated to the new value, though).
|
| 70 |
#ja
|
| 71 |
事象取扱器内容属性が設定された時、新しい値を、
|
| 72 |
匿名関数であって <code>event</code> と呼ばれる引数を1つ持ち、
|
| 73 |
適用範囲鎖が取扱器の活性化オブジェクトから要素へ、
|
| 74 |
要素がフォーム制御子である場合フォームの <code>form</code>
|
| 75 |
要素へ、 <code>Document</code> オブジェクトへ、その <code>Document</code>
|
| 76 |
の<a
|
| 77 |
href="#browsing1">閲覧文脈</a>の <code><a
|
| 78 |
href="#window">Window</a></code> オブジェクトへと連結されているようなものの本体であるとして解釈しなければ[[MUST:なりません]]。
|
| 79 |
この関数は、対応する事象取扱器属性の値として設定されなければ[[MUST:ならず]]、
|
| 80 |
新しい値は内容属性の値として設定されなければ[[MUST:なりません]]。
|
| 81 |
与えられた関数本体がコンパイルに失敗する場合は、対応する事象取扱器属性は代わりに null
|
| 82 |
に設定されなければ[[MUST:なりません]]
|
| 83 |
(ただし、内容属性はそれでも新しい値に更新されなければ[[MUST:なりません]])。
|
| 84 |
|
| 85 |
#en
|
| 86 |
See ECMA262 Edition 3, sections 10.1.6 and 10.2.3, for more
|
| 87 |
details on activation objects. <a href="#refsECMA262">[ECMA262]</a>
|
| 88 |
#ja
|
| 89 |
活性化オブジェクトの詳細については、 ECMA 262 第3版の
|
| 90 |
10.1.6 節と 10.2.3 節を参照してください。
|
| 91 |
<a href="#refsECMA262">[ECMA262]</a>
|
| 92 |
|
| 93 |
#en
|
| 94 |
The <a href="#script2">script execution context</a> of the event handler
|
| 95 |
must be the <code><a href="#window">Window</a></code> object at the end of
|
| 96 |
the scope chain. The <a href="#script4">script document context</a> of the
|
| 97 |
event handler must be the <code>Document</code> object that owns the event
|
| 98 |
handler content attribute that was set.
|
| 99 |
#ja
|
| 100 |
事象取扱器の<a href="#script2">スクリプト実行文脈</a>は、
|
| 101 |
適用範囲鎖の最後の <code><a href="#window">Window</a></code>
|
| 102 |
オブジェクトでなければ[[MUST:なりません]]。事象取扱器の<a href="#script4">スクリプト文書文脈</a>は、
|
| 103 |
設定された事象取扱器内容属性を所有する <code>Document</code>
|
| 104 |
オブジェクトでなければ[[MUST:なりません]]。
|
| 105 |
|
| 106 |
#en
|
| 107 |
<dfn id=event4>Event handler DOM attributes</dfn>, on setting, must set
|
| 108 |
the corresponding event handler attribute to their new value, and on
|
| 109 |
getting, must return whatever the current value of the corresponding event
|
| 110 |
handler attribute is (possibly null).
|
| 111 |
#ja
|
| 112 |
<dfn id=event4>事象取扱器 DOM 属性</dfn>は、設定時、
|
| 113 |
対応する事象取扱器属性を新しい値に設定しなければ[[MUST:ならず]]、
|
| 114 |
取得時、対応する事象取扱器属性の値を何であっても (null であっても)
|
| 115 |
返さなければ[[MUST:なりません]]。
|
| 116 |
|
| 117 |
#en
|
| 118 |
The following are the event handler attributes that must be supported by
|
| 119 |
all <a href="#html-elements">HTML elements</a>, as both content attributes
|
| 120 |
and DOM attributes, and on <code><a href="#window">Window</a></code>
|
| 121 |
|
| 122 |
objects, as DOM attributes:
|
| 123 |
#ja
|
| 124 |
次に示すのは、すべての <a href="#html-elements">HTML 要素</a>で内容属性としても DOM
|
| 125 |
属性としても対応しなければ[[MUST:ならず]]、 <code><a href="#window">Window</a></code>
|
| 126 |
オブジェクトで DOM 属性として対応しなければ[[MUST:ならない]]事象取扱器属性です。
|
| 127 |
|
| 128 |
#pattern
|
| 129 |
Must be invoked whenever an * event is targeted at or bubbles through
|
| 130 |
the element.
|
| 131 |
#ja
|
| 132 |
$1 事象が当該要素を対象とするか、泡立ち当該要素を通過する時には常に呼び出されなければ[[MUST:なりません]]。
|
| 133 |
|