4.11 対話的~要素

【この訳に固有の表記規約】

この訳の,~algoの記述に利用されている各種記号( ~LET, ~IF, ~RET, 等々)の意味や定義の詳細は、~SYMBOL_DEF_REFを~~参照されたし。

4.11.1. ``details^e 要素

`25550^bug
`分類$
`~flow内容$/`~sectioning根$/`対話的~内容$/`可触~内容$ ◎ Flow content. ◎ Sectioning root. ◎ Interactive content. ◎ Palpable content.
`この要素を利用できる文脈$
`~flow内容$が期待される所。 ◎ Where flow content is expected.
`内容~model$
[ 1 個の `summary$e 要素, `~flow内容$ ]からなる並び ◎ One summary element followed by flow content.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
``open$a — 詳細は可視であるかどうか ◎ open — Whether the details are visible
`~DOM~interface$
[Exposed=Window,
`HTMLConstructor$I]
interface `HTMLDetailsElement@I : `HTMLElement$I {
  [`CEReactions$] attribute boolean ``open$m;
};

`details$e 要素は、利用者が追加の情報や~controlを得られるような,開閉式~widgetを`表現-$する。 ◎ The details element represents a disclosure widget from which the user can obtain additional information or controls.

注記: `details$e 要素は、脚注~等( footnote )には適切でない。 脚注を~mark-upする方法の詳細は、 脚注に関する節 を見られたし。 ◎ The details element is not appropriate for footnotes. Please see the section on footnotes for details on how to mark up footnotes.

要素の最初の子が `summary$e 要素であるならば、それが詳細の[ 要約( summary ) / ~legend ]を`表現-$する。 そのような子がなければ、~UAは,自前の~legend(例: “詳細” )を供するべきである。 ◎ The first summary element child of the element, if any, represents the summary or legend of the details. If there is no child summary element, the user agent should provide its own legend (e.g. "Details").

要素の残りの内容は、追加の[ 情報や~controlたち ]を`表現-$する。 ◎ The rest of the element's contents represents the additional information or controls.

``open@a 内容~属性は`真偽~属性$である。 在する場合、要約, 追加の情報の両者とも利用者に示すことを指示する。 不在の場合、要約のみが示される。 ◎ The open content attribute is a boolean attribute. If present, it indicates that both the summary and the additional information is to be shown to the user. If the attribute is absent, only the summary is to be shown.

追加の情報は、要素の作成-時には,この属性が[ 不在ならば 隠-される / 在するならば 示される ]べきである。 その後に,属性が[ 除去された / 追加された ]場合、情報は[ 隠-される / 示される ]べきである。 ◎ When the element is created, if the attribute is absent, the additional information should be hidden; if the attribute is present, that information should be shown. Subsequently, if the attribute is removed, then the information should be hidden; if the attribute is added, the information should be shown.

~UAは、利用者が,要素 %要素 に対し追加の情報を[ 示す / 隠す ]よう要請できるようにするべきである。 そのような要請を尊守するときは、~UAは,次を走らせ~MUST:

  • 示す場合 ⇒ %要素 の`属性~値を設定する$( `open^l, 空~文字列 )
  • 隠す場合 ⇒ %要素 から ``open$a `属性を除去する$
◎ The user agent should allow the user to request that the additional information be shown or hidden. To honor a request for the details to be shown, the user agent must set the open attribute on the element to the empty string. To honor a request for the information to be hidden, the user agent must remove the open attribute from the element.

この,追加の情報を示す/隠す能は、適切な `summary$e 要素が存在するならば,単純に その`作動化の挙動$になり得る。 しかしながら,そのような要素が存在しない場合でも、~UAは依然として,何らかの他の~UI~affordanceを通して この能を供せる。 ◎ This ability to request that additional information be shown or hidden may simply be the activation behavior of the appropriate summary element, in the case such an element exists. However, if no such element exists, user agents can still provide this ability through some other user interface affordance.

~UAは、 ``open$a 属性が `details$e 要素 %details[ に追加- / から除去- ]される度に,次に与える `~details通知~task手続き@ を走らす`~taskを~queueし$~MUST: ◎ Whenever the open attribute is added to or removed from a details element, the user agent must queue a task that runs the following steps, which are known as the details notification task steps, for this details element:

  1. ~IF[ %details に対し`~details通知~task手続き$を走らす別の`~task$が`~queueされ$ている ] ⇒ ~RET ◎ If another task has been queued to run the details notification task steps for this details element, then return.

    注記: ``open$a 属性が何回か続けて~toggleされたときは、この段は,本質的に ~eventが 1 回だけ発火されるように~~集約する。 ◎ When the open attribute is toggled several times in succession, these steps essentially get coalesced so that only one event is fired.

  2. %details に向けて,名前 `toggle$et の`~eventを発火する$ ◎ Fire an event named toggle at the details element.

この~taskの`~task源$は、`~DOM操作~task源$で~MUST。 ◎ The task source for this task must be the DOM manipulation task source.

``open@m
``open$a 内容~属性を`反映-$し~MUST。 ◎ The open IDL attribute must reflect the open content attribute.

`details$e 要素を利用して,進捗~報告-内の技術的~詳細を隠す例: ◎ The following example shows the details element being used to hide technical details in a progress report.

`details-1^xCode

`details$e 要素を利用して,~controlを既定で隠す例: ◎ The following shows how a details element can be used to hide some controls by default:

`details-2^xCode

これを ~list内で他の `details$e と併用すれば、[ それぞれが~~展開する能を伴う~fieldの集合を,利用者が小さい見出しの集合に縮約できるようにする ]こともできる。 ◎ One could use this in conjunction with other details in a list to allow the user to collapse a set of fields down to a small set of headings, with the ability to open each one.

`sample-details-1^dgm `sample-details-2^dgm

これらの例における `summary^e (要約)が要約-( summarize )するのは,~controlが何を変更できるかだけであり、実際の値まで~~示すのは,理想とは言えない。 ◎ In these examples, the summary really just summarizes what the controls can change, and not the actual values, which is less than ideal.

``open$a 属性は、利用者が~controlと対話するに伴って,自動的に[ 追加-/除去- ]されるので、その状態に基づいて,~CSSを用いて要素に異なる~styleをあてがうことに利用できる。 ここでは、要素が~~展開されたり~~畳まれたときに,要約の色を~animateする~stylesheetの例を~~示す: ◎ Because the open attribute is added and removed automatically as the user interacts with the control, it can be used in CSS to style the element differently based on its state. Here, a style sheet is used to animate the color of the summary when the element is opened or closed:

`details-3^xCode

4.11.2. `summary^e 要素

`分類$
~none。 ◎ None.
`この要素を利用できる文脈$
`details$e 要素の`最初の子$として。 ◎ As the first child of a details element.
`内容~model$
次のいずれかの一方 ⇒ `句内容$, または 1 個の`見出し内容$ 要素 ◎ Either: phrasing content. ◎ Or: one element of heading content.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
`~DOM~interface$
`HTMLElement$I を利用する。 ◎ Uses HTMLElement.

`summary$e 要素は、その親が `details$e 要素であれば,親の他の内容に対する[ 要約 / ~caption /~legend ]を`表現-$する。 ◎ The summary element represents a summary, caption, or legend for the rest of the contents of the summary element's parent details element, if any.

`summary$e 要素 %要素 の`作動化の挙動$は、次の手続きを走らす: ◎ The activation behavior of summary elements is to run the following steps:

  1. %親 ~LET %要素 の親~node ◎ ↓
  2. ~IF[ %親 は `details$e 要素である ]~AND[ %要素 は %親 の子である `summary$e 要素のうち最初のものである ]: ◎ If this summary element has no parent node, then return. ◎ Let parent be this summary element's parent node. ◎ If parent is not a details element, then return. ◎ If parent's first summary element child is not this summary element, then return.

    1. ~IF[ %親 は ``open$a 属性を有する ] ⇒ %親 から ``open$a `属性を除去する$ ◎ If the open attribute is present on parent, then remove it.
    2. ~ELSE ⇒ %親 の`属性~値を設定する$( `open^l, 空~文字列 ) ◎ Otherwise, set parent's open attribute to the empty string.

    注記: これは、`~details通知~task手続き$を走らすことになる。 ◎ This will then run the details notification task steps.

4.11.3. ~command

4.11.3.1. ~facet

`~command@ とは、[ ~menu~item / ~button / ~link ]の背後にある抽象化である。 ~commandが定義されたなら、~UIの他の各部品は,同じ~commandを指せるようになる。 それにより、`不能化~状態$cFなどの各種~facetからなる単独の特色機能に,複数箇所から~accessできるようになる。 ◎ A command is the abstraction behind menu items, buttons, and links. Once a command is defined, other parts of the interface can refer to the same command, allowing many access points to a single feature to share facets such as the Disabled State.

各~commandは、次の各種 `~facet@ ( facet )を持つように定義される: ◎ Commands are defined to have the following facets:

`~label@cF
この~commandの,利用者から見える名前。 ◎ The name of the command as seen by the user.
`~access~key@cF
この~commandを誘発する~keyの組合せであって,~UAにより選択される。 ない場合は ε とする。 ◎ A key combination selected by the user agent that triggers the command. A command might not have an Access Key.
`隠され状態@cF
~T または ~F 。 この~commandは隠-される( ~T のとき)かどうかを表す(基本的に,~menu内に示されるべきかどうか)。 ◎ Whether the command is hidden or not (basically, whether it should be shown in menus).
`不能化~状態@cF
~T または ~F 。 この~commandは、関連していて誘発できる( ~T のとき)かどうかを表す。 ◎ Whether the command is relevant and can be triggered or not.
`動作@cF
この~commandを誘発したときに実際に生じる効果。 これは、[ ~scriptによる~event~handler / `~navigate$先の`~URL$ / ~form提出 ]のいずれにもなり得る。 ◎ The actual effect that triggering the command will have. This could be a scripted event handler, a URL to which to navigate, or a form submission.

~UAは、次の判定基準すべてが満たされるならば,要素が定義する`~command$を公開して~MAY : ◎ User agents may expose the commands that match the following criteria:

  • ~commandの`隠され状態$cF ~EQ ~F(要素は可視) ◎ The Hidden State facet is false (visible)
  • 次を満たすような`文書$がある ⇒ [ 要素は`文書~内$にある ]~AND[ 文書が`属する閲覧文脈$ ~NEQ ε ] ◎ The element is in a document that has an associated browsing context.
  • 要素, および その どの先祖にも, `hidden$a 属性は指定されていない ◎ Neither the element nor any of its ancestors has a hidden attribute specified.

~UAには、これを行うことが奨励される — とりわけ`~access~key$cFを有する~commandに対し、利用者にそれらの~keyを告知する仕方として。 ◎ User agents are encouraged to do this especially for commands that have Access Keys, as a way to advertise those keys to the user.

例えば、そのような~commandを~UAの~menu~bar内に~listすることもできる。 ◎ For example, such commands could be listed in the user agent's menu bar.

4.11.3.2. `a^e 要素を用いて~commandを定義する

`a$e 要素は、 `href$a 属性を有するならば,`~commandを定義する$。 この~commandの各種`~facet$は、次で与えられる: ◎ An a element with an href attribute defines a command.

`~label$cF
要素の `textContent$m ~IDL属性が返す文字列になる。 ◎ The Label of the command is the string given by the element's textContent IDL attribute.
`~access~key$cF
要素に`割当てられている~access~key$があれば それになる。 ◎ The AccessKey of the command is the element's assigned access key, if any.
`隠され状態$cF
要素が `hidden$a 属性を有するならば ~T / ~ELSE_ ~F になる。 ◎ The Hidden State of the command is true (hidden) if the element has a hidden attribute, and false otherwise.
`不能化~状態$cF
要素, または その いずれかの先祖が`不活$ならば ~T / ~ELSE_ ~F になる。 ◎ The Disabled State facet of the command is true if the element or one of its ancestors is inert, and false otherwise.
`動作$cF
要素に向けて`~click~eventを発火する$。 ◎ The Action of the command is to fire a click event at the element.

4.11.3.3. `button^e 要素を用いて~commandを定義する

`button$e 要素は、常に`~commandを定義する$。 この~commandの各種`~facet$は、次で与えられる: ◎ A button element always defines a command.

`~label$cF
`~access~key$cF
`隠され状態$cF
`動作$cF
これらは、 `a^e 要素に対するとき と同様に決定される(前~節を見よ)。 ◎ The Label, Access Key, Hidden State, and Action facets of the command are determined as for a elements (see the previous section).
`不能化~状態$cF

要素が次のいずれかを満たすならば ~T / ~ELSE_ ~F になる:

  • 自身またはそのいずれかの先祖は`不活$である
  • `不能化され$ている
◎ The Disabled State of the command is true if the element or one of its ancestors is inert, or if the element's disabled state is set, and false otherwise.

4.11.3.4. ``input^e 要素を用いて~commandを定義する

`input$e 要素 %E は、[ ``type$a 属性の状態 ~IN { ``Submit$st, ``Reset$st, ``Image$st, ``Button$st, ``Radio$st, ``Checkbox$st } ]ならば,`~commandを定義する$。 この~commandの各種`~facet$は、次で与えられる: ◎ An input element whose type attribute is in one of the Submit Button, Reset Button, Image Button, Button, Radio Button, or Checkbox states defines a command.

`~label$cF

次に従って決定される: ◎ The Label of the command is determined as follows:

  1. ~IF[ %E の ``type$a 属性の状態 ~IN { ``Submit$st, ``Reset$st, ``Image$st, ``Button$st } ] ⇒ ~RET [ %E は ``value$a 属性を有するならば その値 / ~ELSE_ ~UAが~buttonに既定の~labelをあてがうときに利用する値 — 値は~UA, および~localeに依存する ] ◎ If the type attribute is in one of the Submit Button, Reset Button, Image Button, or Button states, then the Label is the string given by the value attribute, if any, and a UA-dependent, locale-dependent value that the UA uses to label the button itself if the attribute is absent.
  2. ~IF[ %E を`~label先~control$とする `label$e 要素はある ] ⇒ ~RET 該当するもののうち,`木~順序$で最初のもの( ~DOMで述べるなら %E`.labels[0]^c )の `textContent$m が返す値 ◎ Otherwise, if the element is a labeled control, then the Label is the string given by the textContent of the first label element in tree order whose labeled control is the element in question. (In DOM terms, this is the string given by element.labels[0].textContent.)
  3. ~RET [ %E は ``value$a 属性を有するならば その値 / ~ELSE_ 空~文字列 ] ◎ Otherwise, if the value attribute is present, then the Label is the value of that attribute. ◎ Otherwise, the Label is the empty string.
`~access~key$cF
要素に`割当てられている~access~key$があれば それになる。 ◎ The AccessKey of the command is the element's assigned access key, if any.
`隠され状態$cF
要素は `hidden$a 属性を有するならば ~T / ~ELSE_ ~F になる。 ◎ The Hidden State of the command is true (hidden) if the element has a hidden attribute, and false otherwise.
`不能化~状態$cF

要素が次のいずれかを満たすならば ~T / ~ELSE_ ~F になる:

  • 自身またはそのいずれかの先祖は`不活$である
  • `不能化され$ている
◎ The Disabled State of the command is true if the element or one of its ancestors is inert, or if the element's disabled state is set, and false otherwise.
`動作$cF
要素に向けて`~click~eventを発火する$。 ◎ The Action of the command is to fire a click event at the element.

4.11.3.5. ``option^e 要素を用いて~commandを定義する

`option$e 要素は、次をいずれも満たすならば,`~commandを定義する$:

  • 先祖に `select$e 要素がある
  • [ ``value$a 属性を有さない ]~OR[ ``value$a 属性を有していて その値 ~NEQ 空~文字列 ]

この~commandの各種`~facet$は、次で与えられる:

◎ An option element with an ancestor select element and either no value attribute or a value attribute that is not the empty string defines a command.
`~label$cF
要素は ``label$a 属性を有するならば その値になる。 ~ELSE_ 次の結果になる ⇒ `~ASCII空白を剥いで縮約する$( 要素の `textContent$m ~IDL属性が返す値 ) ◎ The Label of the command is the value of the option element's label attribute, if there is one, or else the value of option element's textContent IDL attribute, with ASCII whitespace stripped and collapsed.
`~access~key$cF
要素に`割当てられている~access~key$があれば それになる。 ◎ The AccessKey of the command is the element's assigned access key, if any.
`隠され状態$cF
要素は `hidden$a 属性を有するならば ~T / ~ELSE_ ~F になる。 ◎ The Hidden State of the command is true (hidden) if the element has a hidden attribute, and false otherwise.
`不能化~状態$cF

要素が次のいずれかを満たすならば ~T / ~ELSE_ ~F になる。

  • `不能化され$optている
  • 最も近い先祖 `select$e 要素は`不能化され$ている
  • 自身またはいずれかの先祖は `不活$である
◎ The Disabled State of the command is true if the element is disabled, or if its nearest ancestor select element is disabled, or if it or one of its ancestors is inert, and false otherwise.
`動作$cF
要素に最も近い先祖 `select$e 要素は、 `multiple$a 属性を有するならば,要素を`~toggleする$。 他の場合、要素を`選ぶ$。 ◎ If the option's nearest ancestor select element has a multiple attribute, the Action of the command is to toggle the option element. Otherwise, the Action is to pick the option element.

4.11.3.6. `legend^e 要素の `accesskey^a 属性を用いて~commandを定義する

次のすべてを満たす `legend$e 要素は、`~commandを定義する$

  • `割当てられている~access~key$はある
  • その親 %F は `fieldset$e 要素である
  • 次をすべて満たす要素の集合 %S は空でない
    • %F の子孫である
    • 自身, および どの先祖も `legend$e 要素でない
    • `label$e 要素でない
    • `~commandを定義する$

この~commandの各種`~facet$は、次で与えられる:

◎ A legend element that has an assigned access key and is a child of a fieldset element that has a descendant that is not a descendant of the legend element and is neither a label element nor a legend element but that defines a command, itself defines a command.
`~label$cF
要素の `textContent$m ~IDL属性が返す値になる。 ◎ The Label of the command is the string given by the element's textContent IDL attribute.
`~access~key$cF
要素に `割当てられている~access~key$になる。 ◎ The AccessKey of the command is the element's assigned access key.
`隠され状態$cF
`不能化~状態$cF
`動作$cF
それぞれ、[ 上で与えた集合 %S 内の要素のうち`木~順序$で最初の要素 ]の対応する~facetと同じになる。 ◎ The Hidden State, Disabled State, and Action facets of the command are the same as the respective facets of the first element in tree order that is a descendant of the parent of the legend element that defines a command but is not a descendant of the legend element and is neither a label nor a legend element.

4.11.3.7. 他の要素~上で `accesskey^a 属性を用いて~commandを定義する

要素は、`割当てられている~access~key$があるならば,`~commandを定義する$ — ただし ⇒ そのような要素に対し,これまでのいずれかの節にて[ 要素は`~commandを定義する$ものと定義される ]ならば、その節の規則が要素に適用される。 この節が適用されるのは、他の場合に限られる。 ◎ An element that has an assigned access key defines a command. ◎ If one of the earlier sections that define elements that define commands define that this element defines a command, then that section applies to this element, and this section does not. Otherwise, this section applies to that element.

この~commandの各種`~facet$は、次で与えられる:

`~label$cF

次で与えられる要素 %E の `textContent$m が返す値になる:

  1. 要素を`~label先~control$とする `label$e 要素があるならば、 %E は,それらのうち `木~順序$で最初のもの。 (これは,~DOMで述べるなら、要素~上の `labels[0].textContent^c が返す文字列になる。)
  2. 他の場合の %E は要素~自身
◎ The Label of the command depends on the element. If the element is a labeled control, the textContent of the first label element in tree order whose labeled control is the element in question is the Label (in DOM terms, this is the string given by element.labels[0].textContent). Otherwise, the Label is the textContent of the element itself.
`~access~key$cF
要素に`割当てられている~access~key$になる。 ◎ The AccessKey of the command is the element's assigned access key.
`隠され状態$cF
要素は `hidden$a 属性を有するならば ~T/ ~ELSE_ ~F になる。 ◎ The Hidden State of the command is true (hidden) if the element has a hidden attribute, and false otherwise.
`不能化~状態$cF
要素または,そのいずれかの先祖が`不活$であるならば ~T / ~ELSE_ ~F になる。 ◎ The Disabled State of the command is true if the element or one of its ancestors is inert, and false otherwise.
`動作$cF

次の手続きを走らす: ◎ The Action of the command is to run the following steps:

  1. `~objを~focusする$( 要素 ) ◎ Run the focusing steps for the element.
  2. 要素に向けて`~click~eventを発火する$ ◎ Fire a click event at the element.

4.11.4. ``dialog^e 要素

`分類$
`~flow内容$ / `~sectioning根$。 ◎ Flow content. ◎ Sectioning root.
`この要素を利用できる文脈$
`~flow内容$が期待される所。 ◎ Where flow content is expected.
`内容~model$
`~flow内容$ 。 ◎ Flow content.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
``open$a — ~dialog~boxを示しているかどうか ◎ open — Whether the dialog box is showing
`~DOM~interface$
[Exposed=Window,
`HTMLConstructor$I]
interface `HTMLDialogElement@I : `HTMLElement$I {
  [`CEReactions$] attribute boolean ``open$m;
  attribute DOMString ``returnValue$m;
  [`CEReactions$] void ``show$m();
  [`CEReactions$] void ``showModal$m();
  [`CEReactions$] void ``close$m(optional DOMString %returnValue);
};

`dialog$e 要素は、利用者がある~taskを遂行するために対話する ~appの一部を表現する — 例えば ~dialog~box / ~inspector / ~window など。 ◎ The dialog element represents a part of an application that a user interacts with to perform a task, for example a dialog box, inspector, or window.

`dialog$e 要素の ``open@a 属性は、`真偽~属性$であり、指定された場合,[ 要素は 作動中であり,利用者は それと対話できる ]ことを指示する。 ◎ The open attribute is a boolean attribute. When specified, it indicates that the dialog element is active and that the user can interact with it.

``open$a 属性を有さない `dialog$e 要素は、利用者に示されるべきでない。 この要件は、~style層を通して間接的に実装されても~MAY。 例えば,`示唆される既定の具現化を~support$する~UAは、この要件を 具現化~節 に述べられる~CSS規則を用いて実装する。 ◎ A dialog element without an open attribute specified should not be shown to the user. This requirement may be implemented indirectly through the style layer. For example, user agents that support the suggested default rendering implement this requirement using the CSS rules described in the rendering section.

~dialogから ``open$a 属性を除去した場合,通例的にそれを隠すことになるが、そうすると,いくつか奇異な結果も伴われる: ◎ Removing the open attribute will usually hide the dialog. However, doing so has a number of strange additional consequences:

  • `close$et ~eventは発火されない。 ◎ The close event will not be fired.
  • ``close()$m ~methodも,~UAが供する ~dialogを取消す~UIも、それ以降~dialogを閉じれなくなる。 ◎ The close() method, and any user-agent provided cancelation interface, will no longer be able to close the dialog.
  • ~dialogが ``showModal()$m ~methodを用いて示されていた場合、`文書$を`阻んでいる~modal~dialog$になる。 ◎ If the dialog was shown using its showModal() method, the Document will still be blocked.

これらの理由から、一般に, ``open$a 属性は 決して手動で除去しないほうが良い。 代わりに、~dialogを ``close()$m ~methodで閉じるか, `hidden$a 属性で隠すこと。 ◎ For these reasons, it is generally better to never remove the open attribute manually. Instead, use the close() method to close the dialog, or the hidden attribute to hide it.

`dialog$e 要素には、 `tabindex$a 属性は 指定されては~MUST_NOT。 ◎ The tabindex attribute must not be specified on dialog elements.

%dialog . ``show()$m
`dialog$e 要素を表示する。 ◎ Displays the dialog element.
%dialog . ``showModal()$m
`dialog$e 要素を表示して,それを最上端の~modal~dialogにする。 ◎ Displays the dialog element and makes it the top-most modal dialog.
この~methodは `autofocus$a 属性を尊守する。 ◎ This method honors the autofocus attribute.
%dialog . ``close$m( [ %result ] )
`dialog$e 要素を閉じる。 ◎ Closes the dialog element.
%result 引数は、 `dialog$e の`結果値$を与える。 ◎ The argument, if provided, provides a return value.
%dialog . ``returnValue$m [ = %result ]
`dialog$e の`結果値$を返す。 ◎ Returns the dialog's return value.
設定して,`結果値$を更新できる。 ◎ Can be set, to update the return value.
``show()@m

被呼出時には、次の手続きを走らせ~MUST: ◎ When the show() method is invoked, the user agent must run the following steps:

  1. ~IF[ 此れは ``open$a 属性を有する ] ⇒ ~RET ◎ If the element already has an open attribute, then return.
  2. 此れの ``open$a 属性 ~SET 空~文字列 ◎ Add an open attribute to the dialog element, whose value is the empty string.
  3. 此れを`通常の整列$~modeにする ◎ Set the dialog to the normal alignment mode.
  4. `~dialogを~focusする$( 此れ ) ◎ Run the dialog focusing steps for the dialog element.
``showModal()@m

被呼出時には、次の手続きを走らせ~MUST: ◎ When the showModal() method is invoked, the user agent must run the following steps:

  1. ~IF[ 此れは ``open$a 属性を有する ] ⇒ ~THROW `InvalidStateError$E ◎ Let subject be the dialog element on which the method was invoked. ◎ If subject already has an open attribute, then throw an "InvalidStateError" DOMException and return.
  2. ~IF[ 此れは`接続されて$いない ] ⇒ ~THROW `InvalidStateError$E ◎ If subject is not connected, then throw an "InvalidStateError" DOMException.
  3. 此れの ``open$a 属性 ~SET 空~文字列 ◎ Add an open attribute to subject, whose value is the empty string.
  4. 此れを`中央寄せ整列$~modeにする ◎ Set the dialog to the centered alignment mode.
  5. %文書 ~LET 此れの`~node文書$ ◎ ↓
  6. ~IF[ 此れ ~NIN %文書 の`上端層$ ] ⇒ 此れを %文書 の`上端層$に`追加する$tL — これにより、此れは %文書 を`阻んでいる~modal~dialog$になる ◎ Let subject's node document be blocked by the modal dialog subject. ◎ If subject's node document's top layer does not already contain subject, then add subject to subject's node document's top layer.
  7. `~dialogを~focusする$( 此れ ) ◎ Run the dialog focusing steps for subject.

`~dialogを~focusする@ ときは、所与の ( `dialog$e 要素 %dialog ) に対し,次を走らす: ◎ The dialog focusing steps for a dialog element subject are as follows:

  1. ~IF[ %dialog は`不活$である ] ⇒ ~RET ◎ If subject is inert, return.
  2. %L ~LET [ %dialog の子孫~要素のうち`不活$でないもの ]からなる `木~順序$による~list ◎ ↓
  3. %~control ~SET [ %L 内に `autofocus$a 属性を有するものは在るならば それらのうち最初のもの / ~ELSE_ %L は空でないならば %L の最初の要素 / ~ELSE_ %dialog ] ◎ Let control be the first descendant element of subject, in tree order, that is not inert and has the autofocus attribute specified. ◎ If there isn't one, then let control be the first non-inert descendant element of subject, in tree order. ◎ If there isn't one of those either, then let control be subject.
  4. `~objを~focusする$( %~control ) ◎ Run the focusing steps for control.

`dialog$e 要素 %dialog が`文書$ %文書 `から除去され$たときは、 %dialog を %文書 の`上端層$から`除去-$し~MUST。 ◎ If at any time a dialog element is removed from a Document, then if that dialog is in that Document's top layer, it must be removed from it.

``close(returnValue)@m

被呼出時には、次を走らせ~MUST:

  1. ~IF[ %returnValue 引数は与えられていない ] ⇒ %returnValue ~SET ε
  2. `~dialogを閉じる$( 此れ, %returnValue )
◎ When the close() method is invoked, the user agent must close the dialog that the method was invoked on. If the method was invoked with an argument, that argument must be used as the return value; otherwise, there is no return value.

~UAは, `~dialogを閉じる@ ときは、所与の ( `dialog$e 要素 %dialog, 結果値 %結果 (省略時は ε )) に対し,次の手続きを走らせ~MUST: ◎ When a dialog element subject is to be closed, optionally with a return value result, the user agent must run the following steps:

  1. ~IF[ %dialog は ``open$a 属性を有さない ] ⇒ ~RET ◎ If subject does not have an open attribute, then return.
  2. %dialog から ``open$a `属性を除去する$ ◎ Remove subject's open attribute.
  3. ~IF[ %結果 ~NEQ ε ] ⇒ %dialog の `結果値$ ~SET %結果 ◎ If the argument result was provided, then set the returnValue attribute to the value of result.
  4. %dialog を,その`~node文書$の`上端層$から`除去する$ ◎ If subject is in its Document's top layer, then remove it.
  5. 次を走らす`~taskを~queueする$ ⇒ %dialog に向けて,名前 `close$et の`~eventを発火する$ ◎ Queue a task to fire an event named close at subject.
``returnValue@m
取得子は、此れの`結果値$を返さ~MUST。 ◎ The returnValue IDL attribute, on getting, must return the last value to which it was set. On setting, it must be set to the new value. When the element is created, it must be set to the empty string.
設定子は、此れの`結果値$を所与の値に設定し~MUST。 ◎ ↑

各 `dialog$e 要素には,文字列である `結果値@ が結付けられ、要素の作成-時には,空~文字列にされ~MUST。

【 ( `dialog^e の) “結果値” は、この訳で導入した用語。 原文では、(~markupなしに) “return value” と記されていて, (~methodの) “返り値” と紛らわしいので。 それに伴い, 空~文字列の要件も ``returnValue$m ~IDL属性の記述からここに移している。 】


~dialogを取消すとき: [ `文書$を`阻んでいる~modal~dialog$ %dialog がある ]ときは、~UAは,[ %dialog の作動化-時に,次を走らす`~taskを~queueする$ ]ような~UIを供して~MAY: ◎ Canceling dialogs: When Document is blocked by a modal dialog dialog, user agents may provide a user interface that, upon activation, queues a task to run these steps:

  1. %close ~LET %dialog に向けて,名前 `cancel$et の`~eventを発火する$ — 次のように初期化して ⇒ `cancelable$m 属性 ~SET ~T ◎ Let close be the result of firing an event named cancel at dialog, with the cancelable attribute initialized to true.
  2. ~IF[ %close ~EQ ~T ]~AND[ %dialog は ``open$a 属性を有する ] ⇒ `~dialogを閉じる$( %dialog ) ◎ If close is true and dialog has an open attribute, then close the dialog with no return value.

注記: そのような~UIを与える仕組みの例としては、利用者が Escape ~keyを押下げるときが挙げられる。 ◎ An example of such a UI mechanism would be the user pressing the "Escape" key.


どの `dialog$e 要素も、[ `通常の整列@, `中央寄せ整列@ ]いずれかの~modeで配置される。 `dialog$e 要素の作成-時には、`通常の整列$~modeにされ~MUST。 この~mode下では、要素には通常の~CSS要件が適用される。 `中央寄せ整列$~modeが利用されるのは、`上端層$内にある `dialog$e 要素に限られる。 `FULLSCREEN$r `CSS$r ◎ A dialog element is in one of two modes: normal alignment or centered alignment. When a dialog element is created, it must be placed in the normal alignment mode. In this mode, normal CSS requirements apply to the element. The centered alignment mode is only used for dialog elements that are in the top layer. [FULLSCREEN] [CSS]

~UAは、`中央寄せ整列$~modeの `dialog$e 要素に対しては:

  • 以下の各項における,`塊~flow方向$, および[ 寸法, 始端, 終端 ]は、[ 要素~自身ではなく,要素の親 ]の 【内容の~layoutにおける】 `塊~flow方向$, およびその方向の[ 寸法, `始端$, `終端$ ]を指すとする。
  • 要素の描画~boxを新たに作成するときは、[[[ 要素の`~box~offset~prop$( `top^p 等々)のうち,`塊~flow方向$のもの ]の`使用値$を計算する目的 ]に用いる,要素の~boxの`静的位置$ ]を,[ ~boxが次を満たすように配置される値 ]に設定しておか~MUST:

    要素の寸法( `width$p / `height$p) ~LT `表示域$の寸法の場合
    [ `表示域$の始端~辺から~boxの始端`~margin辺$までの距離 ]~EQ[ `表示域$の終端~辺から~boxの終端`~margin辺$までの距離 ]
    他の場合
    ~boxの始端`~margin辺$と`表示域$の始端~辺は、一致する
    ◎ When an element subject is placed in centered alignment mode, and when it is in that mode and has new rendering boxes created, the user agent must set up the element such that its static position of the edge that corresponds to subject's parent's block-start edge, for the purposes of calculating the used value of the appropriate box offset property ('top', 'right', 'bottom', or 'left'), is the value that would place the element's margin edge on the side that corresponds to subject's parent's block-start side as far from the same-side edge of the viewport as the element's opposing side margin edge from that same-side edge of the viewport, if the element's dimension ('width' or 'height') in subject's parent's block flow direction is less than the same-axis dimension of the viewport, and otherwise is the value that would place the element's margin edge on the side that corresponds to subject's parent's block-start side at the same-side edge of the viewport.
  • 要素が`具現化されて$いる下で,次のいずれかが生じたときは、前項に従って静的位置を再~計算して,要素の~boxを作成し直さ~MUST ⇒# `表示域$の寸法が変化した / 要素の親の`塊~flow方向$が変化した ◎ If there is a dialog element with centered alignment and that is being rendered when its browsing context changes viewport dimensions (as measured in CSS pixels), or when this dialog element's parent changes block flow direction, then the user agent must recreate the element's boxes, recalculating its edge that corresponds to this dialog element's parent's block-start edge as in the previous paragraph.
  • 上述した静的位置は、要素の~boxが作成し直されるまで,保たれ~MUST。 ◎ This static position of a dialog element's edge with centered alignment must remain the element's static position of that edge until its boxes are recreated.\

    注記: 要素の`静的位置$は、[ ある種の状況で,要素の`~box~offset~prop$の`使用値$を計算するとき ]に限り,利用される — 具体例として、 `position$p ~propが `static^v に設定された要素を位置するときには,利用されない。 ◎ (The element's static position is only used in calculating the used value of the appropriate box offset property ('top', 'right', 'bottom', or 'left') in certain situations; it's not used, for instance, to position the element if its 'position' property is set to 'static'.)

視覚的かつ対話的な媒体の~UAは、利用者が `表示域$を~panして `dialog$e 要素の`~border~box$のすべての部位に~accessできるようにするべきである — 要素が `表示域$より大きく,`表示域$に~scrollの仕組みがないときでも(例:`表示域$の `overflow$p ~propが `hidden^v に設定されている)。 ◎ User agents in visual interactive media should allow the user to pan the viewport to access all parts of a dialog element's border box, even if the element is larger than the viewport and the viewport would otherwise not have a scroll mechanism (e.g. because the viewport's 'overflow' property is set to 'hidden').


``open@m
``open$a 内容~属性を`反映-$し~MUST。 ◎ The open IDL attribute must reflect the open content attribute.

次の~dialog~boxには、細則事項( `small$e )がある。 より重要な部位へ利用者の注目を引くため, `strong$e 要素が利用されている: ◎ This dialog box has some small print. The strong element is used to draw the user's attention to the more important part.

`dialog-1^xCode