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

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

4.10.1. 序論

【 この節の和訳は 別ページにて。 】

4.10.2. 分類

この節における各種~要素は,`~flow内容$, `句内容$, `対話的~内容$などの通例の分類に加えて,いくつかの重なり合う(が、微妙に異なる)分類に仕分けられる — その重なりは、ほぼ歴史的~理由によるものであるが。 ◎ Mostly for historical reasons, elements in this section fall into several overlapping (but subtly different) categories in addition to the usual ones like flow content, phrasing content, and interactive content.

次に挙げる要素は、 `~formに所有され得る要素@ とされ,ある~formに`所有され$得ることを意味する: ◎ A number of the elements are form-associated elements, which means they can have a form owner.

`~formに所有され得る要素$は、更にいくつかに分類される: ◎ The form-associated elements fall into several subcategories:

`~listされ@る要素

次に挙げる要素は、 `form.elements$m / `fieldset.elements$m ~API内に~listされる。 これらの要素には、作者が`~form所有者$を明示的に指定できるようにする,[ `form$a 内容~属性と対応する `form$m ~IDL属性 ]がある: ◎ Denotes elements that are listed in the form.elements and fieldset.elements APIs. These elements also have a form content attribute, and a matching form IDL attribute, that allow authors to specify an explicit form owner.

  • `button$e
  • `fieldset$e
  • `input$e
  • `object$e
  • `output$e
  • `select$e
  • `textarea$e
`提出-可能@ な要素

次に挙げる要素は、 `form$e 要素を`提出する$ために`~entry~listを構築する$ときに利用され得る: ◎ Denotes elements that can be used for constructing the entry list when a form element is submitted.

  • `button$e
  • `input$e
  • `object$e
  • `select$e
  • `textarea$e

`提出-可能$な要素には、その属性に依存して `~button@ になるものもある。 要素がいつ~buttonになるかは、関連する節の注釈文にて定義される。 ~buttonには、特に `提出-~button@ になるものもある。 ◎ Some submittable elements can be, depending on their attributes, buttons. The prose below defines when an element is a button. Some buttons are specifically submit buttons.

`再設定-可能@ な要素

次に挙げる要素は、 `form$e 要素が`再設定-$されるときに影響され得る: ◎ Denotes elements that can be affected when a form element is reset.

  • `input$e
  • `output$e
  • `select$e
  • `textarea$e
`自動頭字化-を継承-@ する要素 ◎ Autocapitalize-inheriting elements

次に挙げる要素は、`~form所有者$から `autocapitalize$a 属性を継承する: ◎ Denotes elements that inherit the autocapitalize attribute from their form owner.

  • `button$e
  • `fieldset$e
  • `input$e
  • `output$e
  • `select$e
  • `textarea$e

`~formに所有され得る要素$に限らず,一部の要素は、 `~label可能@ な要素に分類される。 これらは、 `label$e 要素に結び付け得る要素である: ◎ Some elements, not all of them form-associated, are categorized as labelable elements. These are elements that can be associated with a label element.

【上述の分類の要約】
要素 所有され得る `~listされ$る `提出-可能$ `再設定-可能$ `自動頭字化-を継承-$ `~label可能$

4.10.3. ``form^e 要素

`分類$
`~flow内容$ / `可触~内容$ ◎ Flow content. ◎ Palpable content.
`この要素を利用できる文脈$
`~flow内容$が期待される所。 ◎ Where flow content is expected.
`内容~model$
`~flow内容$であって、子孫には `form$e 要素を伴わないもの。 ◎ Flow content, but with no form element descendants.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$。 ◎ Global attributes
``accept-charset$a — `~form提出$に利用する文字~符号化法。 ◎ accept-charset — Character encodings to use for form submission
`action$a — `~form提出$に利用する`~URL$ ◎ action — URL to use for form submission
``autocomplete$a — この~form内の各~controlにおける既定の自動充填 特色機能を設定する。 ◎ autocomplete — Default setting for autofill feature for controls in the form
`enctype$a — `~form提出$に利用する~entry~list符号化法の種別。 ◎ enctype — Entry list encoding type to use for form submission
`method$a — `~form提出$にどの~methodを利用するか。 ◎ method — Variant to use for form submission
``name$a — `document.forms$m ~APIに利用する~formの名前。 ◎ name — Name of form to use in the document.forms API
`novalidate$a — `~form提出$に際し,~form~control検証を迂回する。 ◎ novalidate — Bypass form control validation for form submission
`target$a — `~form提出$用の 【それにより~navigateされる】 `閲覧文脈$。 ◎ target — Browsing context for form submission
`~DOM~interface$
[Exposed=Window,
 OverrideBuiltins,
 LegacyUnenumerableNamedProperties,
 `HTMLConstructor$I]
interface `HTMLFormElement@I : `HTMLElement$I {
  [`CEReactions$] attribute DOMString ``acceptCharset$m;
  [`CEReactions$] attribute USVString `action$m;
  [`CEReactions$] attribute DOMString ``autocomplete$m;
  [`CEReactions$] attribute DOMString `enctype$m;
  [`CEReactions$] attribute DOMString `encoding$m;
  [`CEReactions$] attribute DOMString `method$m;
  [`CEReactions$] attribute DOMString ``name$m;
  [`CEReactions$] attribute boolean `noValidate$m;
  [`CEReactions$] attribute DOMString `target$m;

  [SameObject] readonly attribute `HTMLFormControlsCollection$I ``elements$m;
  readonly attribute unsigned long ``length$m;
  ``getter$m `Element$I (unsigned long %index);
  ``~getterN$m (`RadioNodeList$I or `Element$I) (DOMString %name);

  void ``submit$m();
  [`CEReactions$] void ``reset$m();
  boolean ``checkValidity$m();
  boolean ``reportValidity$m();
};

`form$e 要素は、`~formに所有され得る要素$たちからなる~collectionを`表現-$する — その中に、編集-可能な値を表現し,処理~用に~serverへ提出され得るものも含ませ得るような。 ◎ The form element represents a collection of form-associated elements, some of which can represent editable values that can be submitted to a server for processing.

``accept-charset@a 属性は、提出に利用されることになる文字~符号化法を与える。 この属性に指定する値は、`空白区切りの一意な~tokenからなる有順序~集合$であって,その各~tokenは[ `~ASCII互換~符号化法$である `~label$x ]のいずれかに`~ASCII大小無視$で合致し~MUST。 `ENCODING$r ◎ The accept-charset attribute gives the character encodings that are to be used for the submission. If specified, the value must be an ordered set of unique space-separated tokens that are ASCII case-insensitive, and each token must be an ASCII case-insensitive match for one of the labels of an ASCII-compatible encoding. [ENCODING]

``name@a 属性は、 `forms$m ~collectionの中での `form$e の名前を表現する。 指定する値は、空でない文字列であって, `forms$m ~collection内の `form$e 要素たちの間で一意にされ~MUST。 ◎ The name attribute represents the form's name within the forms collection. The value must not be the empty string, and the value must be unique amongst the form elements in the forms collection that it is in, if any.

``autocomplete@a 属性は,`列挙ed属性$であり、次に挙げる~keywordをとり得る:

``on@v
`値なし用の既定$
`妥当でない値~用の既定$
`on@st 状態に対応付けられる。
この状態は、~form内の各~form~controlの`自動充填~欄~名$を,既定で `on$v に設定するよう指示する。
``off@v
`off@st 状態に対応付けられる。
この状態は、~form内の各~form~controlの`自動充填~欄~名$を,既定で `off$v に設定するよう指示する。
◎ The autocomplete attribute is an enumerated attribute. The attribute has two states. The on keyword maps to the on state, and the off keyword maps to the off state. The attribute may also be omitted. The missing value default and the invalid value default are the on state. The off state indicates that by default, form controls in the form will have their autofill field name set to "off"; the on state indicates that by default, form controls in the form will have their autofill field name set to "on".

`~form提出用の属性$として、[ `action$a, `enctype$a, `method$a, `novalidate$a, `target$a ]属性もある。 ◎ The action, enctype, method, novalidate, and target attributes are attributes for form submission.

%form . ``elements$m
この~form内の~form~controlたちからなる `HTMLFormControlsCollection$I を返す。 (ただし、歴史的~理由から,画像~buttonは除外される)。 ◎ Returns an HTMLFormControlsCollection of the form controls in the form (excluding image buttons for historical reasons).
%form . ``length$m
この~form内の~form~controlの個数を返す(ただし、歴史的~理由から,画像~buttonは除外される)。 ◎ Returns the number of form controls in the form (excluding image buttons for historical reasons).
%form[%index]
この~form内の %~index 番の要素を返す(ただし、歴史的~理由から,画像~buttonは除外される)。 ◎ Returns the indexth element in the form (excluding image buttons for historical reasons).
%form[%name]

この~form内の所与の `~ID$ または `name$a を伴う ~form~controlを返す — ただし:

  • 複数ある場合は それらの~form~controlからなる `RadioNodeList$I を返す。
  • 歴史的~理由から、画像~buttonは除外される。
  • 該当するものが無い場合は、所与の~IDを有する `img$e 要素を返す。
◎ Returns the form control (or, if there are several, a RadioNodeList of the form controls) in the form with the given ID or name (excluding image buttons for historical reasons); or, if there are none, returns the img element with the given ID.
要素が 特定0の名前を利用して 一度でも参照されたなら、その名前は,この~methodにて その要素を参照する仕方として 可用であり続けることになる — 要素の実際[ `~ID$ / `name$a ]が変化しても,要素が同じ`木$内にあり続ける限り。 ◎ Once an element has been referenced using a particular name, that name will continue being available as a way to reference that element in this method, even if the element's actual ID or name changes, for as long as the element remains in the tree.
合致する~itemが複数のある場合、それらの要素すべてを包含する `RadioNodeList$I ~objが返される。 ◎ If there are multiple matching items, then a RadioNodeList object containing all those elements is returned.
%form . ``submit()$m
この~formを提出する。 ◎ Submits the form.
%form . ``reset()$m
この~formを再設定する。 ◎ Resets the form.
%form . ``checkValidity()$m
[ この~formに属する~controlがすべて妥当~ならば ~T / ~ELSE_ ~F ]を返す。 ◎ Returns true if the form's controls are all valid; otherwise, returns false.
%form . ``reportValidity()$m
[ この~formに属する~controlがすべて妥当~ならば ~T / ~ELSE_ ~F ]を返すことに加え、 ~F を返す場合は,そのことを利用者に伝える。 ◎ Returns true if the form's controls are all valid; otherwise, returns false and informs the user.
``autocomplete@m
`既知の値のみに制限され$る下で, ``autocomplete$a 内容~属性を`反映-$し~MUST。 ◎ The autocomplete IDL attribute must reflect the content attribute of the same name, limited to only known values.
``name@m
``name$a 内容~属性を`反映-$し~MUST。 ◎ The name IDL attribute must reflect the content attribute of the same name.
``acceptCharset@m
``accept-charset$a 内容~属性を`反映-$し~MUST。 ◎ The acceptCharset IDL attribute must reflect the accept-charset content attribute.

``elements@m
取得子は、次のようにされた `HTMLFormControlsCollection$I を返さ~MUST ⇒ 根 ~SET 此れの`根$,
~filterは[ 此れに`所有され$ている, かつ`~listされ$る要素のうち,次に該当しないもの ]に合致する ⇒ `input$e 要素のうち,[ `type$a 属性の状態 ~EQ `Image$st ]であるもの — これは、歴史的~理由から除外されている ◎ The elements IDL attribute must return an HTMLFormControlsCollection rooted at the form element's root, whose filter matches listed elements whose form owner is the form element, with the exception of input elements whose type attribute is in the Image Button state, which must, for historical reasons, be excluded from this particular collection.
``length@m
取得子は、此れの ``elements$m が成す`~collectionにより表現され$る~nodeの個数を返さ~MUST。 ◎ The length IDL attribute must return the number of nodes represented by the elements collection.
``getter@m

この`有index~prop取得子$の挙動は、此れの ``elements$m ~collection %C に基づく:

  • 此れが`~supportする~prop~index$は、常に, %C のそれと同じとする。
  • 此れの`有index~propの値を決定する$ときは、所与の %index に対し[ %C 上の `item$m ~methodが、引数 %index に対し返す値 ]を返さ~MUST。
◎ The supported property indices at any instant are the indices supported by the object returned by the elements attribute at that instant. ◎ To determine the value of an indexed property for a form element, the user agent must return the value returned by the item method on the elements collection, when invoked with the given index as its argument.
``~getterN@m
この`有名~prop取得子$の挙動は、以下に与える `form$e 要素~用の[ ~supportする~prop名 / 有名~propの値を決定する手続き ]に従う。 ◎ ↓

各 `form$e 要素は、名前をある要素に対応付ける `過去~名~map@ を持つ。 それは、各~controlの名前を,その名前が変更されても 持続化させるために利用される。 ◎ Each form element has a mapping of names to elements called the past names map. It is used to persist names of controls even when they change names.

`form$e 要素 %F が`~supportする~prop名$は、次を走らせた結果で与えられる: ◎ The supported property names consist of the names obtained from the following algorithm, in the order obtained from this algorithm:

  1. %組~list ~LET 空~list — この~listの各~entryは、次のものが成す組で与えられる ⇒ ( 名前, 要素, 源 ~IN { `id^i, `name^i, `過去^i }, 齢 ) 【源は、何がこの~entryの源であるかを指示する】 ◎ Let sourced names be an initially empty ordered list of tuples consisting of a string, an element, a source, where the source is either id, name, or past, and, if the source is past, an age.
  2. %候補~集合 ~LET %F に`所有され$ている要素のうち,次のいずれかに該当するものからなる集合:

    • `~listされ$る要素であって,次を満たさないもの ⇒ `input$e 要素であって,その `type$a 属性の状態 ~EQ `Image$st
    • `img$e 要素である
    ◎ ↓
  3. %候補~集合 内の ~EACH( %候補 ) に対し【この時点では、順序は有意でない】:

    1. ~IF[ %候補 は `id$a 属性 %A を有する ] ⇒ %組~list に次に与える~entryを追加する ⇒ ( %A の値, %候補, `id^i, ε ) を追加する
    2. ~IF[ %候補 は `name$a 属性 %A を有する ] ⇒ %組~list に次の~entryを追加する ⇒ ( %A の値, %候補, `name^i, ε )
    ◎ For each listed element candidate whose form owner is the form element, with the exception of any input elements whose type attribute is in the Image Button state: • If candidate has an id attribute, add an entry to sourced names with that id attribute's value as the string, candidate as the element, and id as the source. • If candidate has a name attribute, add an entry to sourced names with that name attribute's value as the string, candidate as the element, and name as the source. ◎ For each img element candidate whose form owner is the form element: • If candidate has an id attribute, add an entry to sourced names with that id attribute's value as the string, candidate as the element, and id as the source. • If candidate has a name attribute, add an entry to sourced names with that name attribute's value as the string, candidate as the element, and name as the source.
  4. %~map ~LET %F の`過去~名~map$ ◎ ↓
  5. %~map を成す ~EACH( %過去~entry ) に対し ⇒ %組~list に次に与える~entryを追加する ⇒ ( %過去~entry の名前, %過去~entry の要素, `過去^i, [ %過去~entry が %~map 内に居続けた時間 ] ) ◎ For each entry past entry in the past names map add an entry to sourced names with the past entry's name as the string, past entry's element as the element, past as the source, and the length of time past entry has been in the past names map as the age.
  6. %組~list 内の~entryたちを 次に従って~sortする:

    1. ~entryの要素の`木~順序$で~sortする
    2. 要素が同じ~entryたちは、源が[ `id^i, `name^i, `過去^i ]の順になるように~sortする
    3. 要素が同じ, かつ[ 源 ~EQ `過去^i ]の~entryたちは、齢が最長のものが先に来るように~sortする
    ◎ Sort sourced names by tree order of the element entry of each tuple, sorting entries with the same element by putting entries whose source is id first, then entries whose source is name, and finally entries whose source is past, and sorting entries with the same element and source by their age, oldest first.
  7. %名前~list ~LET 空~list ◎ ↓
  8. %組~list 内の ~EACH( %~entry ) に対し

    1. %名前 ~LET %~entry の名前
    2. ~IF[ %名前 ~NEQ 空~文字列 ]~AND[ %名前 ~NIN %名前~list ] ⇒ %名前~list に %名前 を付加する
    ◎ Remove any entries in sourced names that have the empty string as their name. ◎ Remove any entries in sourced names that have the same name as an earlier entry in the map.
  9. ~RET %名前~list ◎ Return the list of names from sourced names, maintaining their relative order.

`form$e 要素 %F 上で`有名~propの値を決定する$ときは、所与の ( 【 %F が`~supportする~prop名$】 %名前 ) に対し,次を走らせ~MUST: ◎ To determine the value of a named property name for a form element, the user agent must run the following steps:

  1. %O ~LET %F に結付けられている `~live$な `RadioNodeList$I ~obj — それは、所与の時点で[[ 次の下位手続きが返す要素たち ]が成す,`木~順序$による~list ]を表現するものとして定義される:

    1. %候補~集合 ~LET 次をすべて満たす要素からなる集合

      • %F に`所有され$ている
      • `~listされ$る要素である
      • [ `id$a 属性を有していて,その値 ~EQ %名前 ]~OR[ `name$a 属性を有していて,その値 ~EQ %名前 ]
      • [ `input$e 要素でない ]~OR[ `input$e 要素であって,その `type$a 属性の状態 ~NEQ `Image$st ]
    2. ~IF[ %候補~集合 は空でない ] ⇒ ~RET %候補~集合
    3. ~RET 次をすべて満たす要素からなる集合:

      • %F に`所有され$ている
      • `img$e 要素である
      • [ `id$a 属性を有していて,その値 ~EQ %名前 ]~OR[ `~nameI$a 属性を有していて,その値 ~EQ %名前 ]
    ◎ Let candidates be a live RadioNodeList object containing all the listed elements, whose form owner is the form element, that have either an id attribute or a name attribute equal to name, with the exception of input elements whose type attribute is in the Image Button state, in tree order. ◎ If candidates is empty, let candidates be a live RadioNodeList object containing all the img elements, whose form owner is the form element, that have either an id attribute or a name attribute equal to name, in tree order.
  2. %過去~entry ~LET [ %F の`過去~名~map$内に %名前 をある要素に対応付ける~entryが在るならば それ / 無いならば ε ] ◎ ↓
  3. %O が表現する要素の個数に応じて: ◎ ↓

    • 0 個:

      1. ~Assert: %過去~entry ~NEQ ε
      2. ~RET %過去~entry の要素
      ◎ If candidates is empty, name is the name of one of the entries in the form element's past names map: return the object associated with name in that map.
    • 複数~個 ⇒ ~RET %O ◎ If candidates contains more than one node, return candidates.
    • 1 個:

      1. %要素 ~LET %O が表現する唯一の要素
      2. ~IF[ %過去~entry ~NEQ ε ] ⇒ %過去~entry の要素 ~SET %要素
      3. ~ELSE ⇒ %F の`過去~名~map$に[ %名前 を %要素 に対応付ける~entry ]を追加する
      4. ~RET %要素
      ◎ Otherwise, candidates contains exactly one node. Add a mapping from name to the node in candidates in the form element's past names map, replacing the previous entry with the same name, if any. ◎ Return the node in candidates.

`form$e 要素の`過去~名~map$を成すどの %~entry に対しても ⇒ %~entry の要素の`~form所有者$が変化したときは、 %~entry は,~mapから除去され~MUST。 ◎ If an element listed in a form element's past names map changes form owner, then its entries must be removed from that map.


``submit()@m
被呼出時には、次をし~MUST ⇒ この~methodから呼出す文脈の下で,此れを此れ自身から`提出する$ ◎ The submit() method, when invoked, must submit the form element from the form element itself, with the submitted from submit() method flag set.
``reset()@m

被呼出時には、次の手続きを走らせ~MUST: ◎ The reset() method, when invoked, must run the following steps:

  1. ~IF[ 此れ の`再設定~lock$ ~EQ ~ON ] ⇒ ~RET ◎ If the form element is marked as locked for reset, then return.
  2. 此れの `再設定~lock@ ~SET ~ON ◎ Mark the form element as locked for reset.
  3. 此れを`再設定$する ◎ Reset the form element.
  4. 此れの`再設定~lock$ ~SET ~OFF ◎ Unmark the form element as locked for reset.
``checkValidity()@m
被呼出時には、此れの`拘束を静的に検証-$した結果に応じて,[ `肯定的^i ならば ~T / `否定的^i ならば ~F ]を返さ~MUST。 ◎ If the checkValidity() method is invoked, the user agent must statically validate the constraints of the form element, and return true if the constraint validation return a positive result, and false if it returned a negative result.
``reportValidity()@m
被呼出時には、此れの`拘束を対話的に検証-$した結果に応じて,[ `肯定的^i ならば ~T / `否定的^i ならば ~F ]を返さ~MUST。 ◎ If the reportValidity() method is invoked, the user agent must interactively validate the constraints of the form element, and return true if the constraint validation return a positive result, and false if it returned a negative result.

例 — 2 つの探索~formがある: ◎ This example shows two search forms:

`form-1^xCode

4.10.4. ``label^e 要素

`分類$
`~flow内容$ /`句内容$ / `対話的~内容$ / `可触~内容$ ◎ Flow content. ◎ Phrasing content. ◎ Interactive content. ◎ Palpable content.
`この要素を利用できる文脈$
`句内容$が期待される所。 ◎ Where phrasing content is expected.
`内容~model$
`句内容$であって、子孫には,要素の`~label先~control$の他に[ `~label可能$な要素, `label$e 要素 ]を伴わないもの。 ◎ Phrasing content, but with no descendant labelable elements unless it is the element's labeled control, and no descendant label elements.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
``for$a — この~labelを~form~controlに結付ける。 ◎ for — Associate the label with form control
`~DOM~interface$
[Exposed=Window,
 `HTMLConstructor$I]
interface `HTMLLabelElement@I : `HTMLElement$I {
  readonly attribute `HTMLFormElement$I? ``form$m;
  [`CEReactions$] attribute DOMString ``htmlFor$m;
  readonly attribute `HTMLElement$I? ``control$m;
};

`label$e 要素は、~UI内の~captionを`表現-$する。 この~captionは、次のいずれかにより,特定の~form~controlに結付けれる:

  • ``for@a 属性を利用して~controlを指す — この属性に指定する値は、 `label$e 要素と同じ`木$内にある`~label可能$な要素の`~ID$で~MUST。
  • ~controlを要素の内側に置く

`label$e 要素に結付けられる~controlは,要素の `~label先~control@ と呼ばれ、次の手続きの結果として定義される:

  1. %S ~LET [ 要素は ``for$a 属性 %A を有するならば 要素と同じ`木$内の要素のうち,[ `~ID$ ~EQ %A の値 ]なるものからなる集合 / ~ELSE_ 要素の子孫~要素からなる集合 ]
  2. %S ~SET %S 内の`~label可能$な要素からなる集合
  3. ~IF[ %S は空である ] ⇒ ~RET ε (存在しない)
  4. ~RET %S 内の要素のうち,`木~順序$で最初のもの
◎ The label element represents a caption in a user interface. The caption can be associated with a specific form control, known as the label element's labeled control, either using the for attribute, or by putting the form control inside the label element itself. ◎ Except where otherwise specified by the following rules, a label element has no labeled control. ◎ The for attribute may be specified to indicate a form control with which the caption is to be associated. If the attribute is specified, the attribute's value must be the ID of a labelable element in the same tree as the label element. If the attribute is specified and there is an element in the tree whose ID is equal to the value of the for attribute, and the first such element in tree order is a labelable element, then that element is the label element's labeled control. ◎ If the for attribute is not specified, but the label element has a labelable element descendant, then the first such descendant in tree order is the label element's labeled control.

`label$e 要素の正確な既定の[ 呈示と挙動 ] — 特に、その`作動化の挙動$ — は、(もし在れば)~platformの~labelの挙動に合致するべきである。 `label$e 要素の`作動化の挙動$は、[ その子孫である`対話的~内容$ %C, および %C の子孫 ]を標的にする~eventに対しては,何もしては~MUST_NOT。 ◎ The label element's exact default presentation and behavior, in particular what its activation behavior might be, if anything, should match the platform's label behavior. The activation behavior of a label element for events targeted at interactive content descendants of a label element, and any descendants of those interactive content descendants, must be to do nothing.

例えば,[ ~checkboxの~labelを~clickすると ~checkboxが~checkされるような~platform ]上の~UAは、[ 次の~code片にて `label$e が~clickされた ]ときも — 利用者が要素を誘発したかのように — `input$e 要素に向けて`~click~eventを発火-$できる: ◎ For example, on platforms where clicking a checkbox label checks the checkbox, clicking the label in the following snippet could trigger the user agent to fire a click event at the input element, as if the element itself had been triggered by the user:

`label-1^xCode

他の~platformでの挙動は、~controlを~focusする他に何もしないかもしれない。 ◎ On other platforms, the behavior might be just to focus the control, or do nothing.

次の例に 3 個の~form~controlを示す。 それぞれは~labelを伴い、うち 2 個には,利用者が倣うべき形式を示す短い~textも含められている。 ◎ The following example shows three form controls each with a label, two of which have small text showing the right format for users to use.

`label-2^xCode
%label . ``control$m
この要素の`~label先~control$を返す。 ◎ Returns the form control that is associated with this element.
%label . ``form$m
この要素の`~label先~control$が[ 在るならば その `~form所有者$ / 無いならば ~NULL ]を返す。 ◎ Returns the form owner of the form control that is associated with this element. ◎ Returns null if there isn't one.
``htmlFor@m
``for$a 内容~属性を`反映-$し~MUST。 ◎ The htmlFor IDL attribute must reflect the for content attribute.
``control@m
取得子は、[ 此れの`~label先~control$ ~NEQ ε ならば それ / ~ELSE_ ~NULL ]を返さ~MUST。 ◎ The control IDL attribute must return the label element's labeled control, if any, or null if there isn't one.
``form@m

取得子は、次の手続きを走らせ~MUST: ◎ The form IDL attribute must run the following steps:

  1. %~control ~LET 此れの`~label先~control$ ◎ ↓
  2. ~IF[ %~control ~EQ ε ] ⇒ ~RET ~NULL ◎ If the label element has no labeled control, then return null.
  3. ~IF[ %~control は`~formに所有され得る要素$でない ] ⇒ ~RET ~NULL ◎ If the label element's labeled control is not a form-associated element, then return null.
  4. ~RET %~control の`~form所有者$ (これも ~NULL になり得る) ◎ Return the label element's labeled control's form owner (which can still be null).
注記: `label$e 要素の ``form$m ~IDL属性は、[ `~listされ$る`~formに所有され得る要素$ ]の `form$m ~IDL属性とは異なる。 また、 `label$e 要素には `form$a 内容~属性は適用されない。 ◎ The form IDL attribute on the label element is different from the form IDL attribute on listed form-associated elements, and the label element does not have a form content attribute.

%control . `labels$m
この~form~controlを`~label先~control$にしている `label$e 要素すべてからなる `NodeList$I を返す。 ◎ Returns a NodeList of all the label elements that the form control is associated with.

各[ `~label可能$な / `input$e ]要素には、[ それを`~label先~control$とする `label$e 要素たちからなる,`木~順序$による~list ]を表現する `NodeList$I ~objが結付けられる。 [ `~label可能$な / `input$e ]要素の `labels@m ~IDL属性の取得子は、常に,この同じ `NodeList$I ~objを返さ~MUST — ただし、要素が `input$e 要素であって, その `type$a ~属性は `Hidden$st 状態にある場合には, ~NULL を返さ~MUST。 ◎ Labelable elements and all input elements have a live NodeList object associated with them that represents the list of label elements, in tree order, whose labeled control is the element in question. The labels IDL attribute of labelable elements and input elements, on getting, must return that NodeList object, and that same value must always be returned, unless this element is an input element whose type attribute is in the Hidden state, in which case it must instead return null.

次の(適合していない)な例に、 `input$e ~要素の `type$a 属性が変更されたとき, `NodeList$I に何が起こるか, および `labels$m は何を返すかを示す: ◎ This (non-conforming) example shows what happens to the NodeList and what labels returns when an input element has its type attribute changed.

<!doctype html>
<p><label><input></label></p>
<script>
 const %input = document.querySelector('input');
 const %labels = %input.labels;
 console.assert(%labels.length === 1);

 %input.type = 'hidden';
 console.assert(%labels.length === 0); /* 
%input はもはや %label の`~label先~control$でない
◎
the input is no longer the label's labeled control
 */
 console.assert(%input.%labels === null);

 %input.type = 'checkbox';
 console.assert(%labels.length === 1); /* 
%input は再び %label の`~label先~control$になる
◎
the input is once again the label's labeled control
 */
 console.assert(%input.labels === %labels); /* 
元と同じ値が返される
◎
same value as returned originally
 */
</script>

4.10.5. ``input^e 要素

【 この節の和訳は 別ページにて。 】

4.10.6. ``button^e 要素

`分類$
`~flow内容$ /`句内容$ / `対話的~内容$ / `可触~内容$ / ◎ Flow content. ◎ Phrasing content. ◎ Interactive content. ◎ Listed, labelable, submittable, and autocapitalize-inheriting form-associated element. ◎ Palpable content.
`~formに所有され得る要素$のうち[ `~listされ$る / `~label可能$な / `提出-可能$な / `自動頭字化-を継承-$する ]もの。 ◎ ↑
`この要素を利用できる文脈$
`句内容$が期待される所。 ◎ Where phrasing content is expected.
`内容~model$
`句内容$ — ただし、子孫に`対話的~内容$が在ってはならない。 ◎ Phrasing content, but there must be no interactive content descendant.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
`autofocus$a — 頁が読込まれたときに,この~form~controlに自動的に~focusする。 ◎ autofocus — Automatically focus the form control when the page is loaded
`disabled$a — この~form~controlは不能化されるかどうか。 ◎ disabled — Whether the form control is disabled
`form$a — この~controlの所有者にする `form$e 要素を与える。 ◎ form — Associates the control with a form element
`formaction$a — `~form提出$に利用する`~URL$ ◎ formaction — URL to use for form submission
`formenctype$a — `~form提出$に利用する~entry~list符号化法の種別。 ◎ formenctype — Entry list encoding type to use for form submission
`formmethod$a — `~form提出$にどの~methodを利用するか。 ◎ formmethod — Variant to use for form submission
`formnovalidate$a — `~form提出$に際し,~form~control検証を迂回する。 ◎ formnovalidate — Bypass form control validation for form submission
`formtarget$a — `~form提出$に対する 【それにより~navigateされる】 `閲覧文脈$ ◎ formtarget — Browsing context for form submission
`name$a — [ `~form提出$ / `form.elements$m ~API ]において利用する~form~controlの名前。 ◎ name — Name of form control to use for form submission and in the form.elements API
``type$a — ~buttonの型 ◎ type — Type of button
``value$a — `~form提出$に利用される値。 ◎ value — Value to be used for form submission
`~DOM~interface$
[Exposed=Window,
 `HTMLConstructor$I]
interface `HTMLButtonElement@I : `HTMLElement$I {
  [`CEReactions$] attribute boolean `autofocus$m;
  [`CEReactions$] attribute boolean `disabled$m;
  readonly attribute `HTMLFormElement$I? `form$m;
  [`CEReactions$] attribute USVString `formAction$m;
  [`CEReactions$] attribute DOMString `formEnctype$m;
  [`CEReactions$] attribute DOMString `formMethod$m;
  [`CEReactions$] attribute boolean `formNoValidate$m;
  [`CEReactions$] attribute DOMString `formTarget$m;
  [`CEReactions$] attribute DOMString `name$m;
  [`CEReactions$] attribute DOMString ``type$m;
  [`CEReactions$] attribute DOMString ``value$m;

  readonly attribute boolean `willValidate$m;
  readonly attribute `ValidityState$I `validity$m;
  readonly attribute DOMString `validationMessage$m;
  boolean `checkValidity$m();
  boolean `reportValidity$m();
  void `setCustomValidity$m(DOMString %error);

  readonly attribute `NodeList$I `labels$m;
};

`button$e 要素は、その内容で~labelされた~buttonを`表現-$する。 ◎ The button element represents a button labeled by its contents.

要素は`~button$になる。 ◎ The element is a button.

``type@a 属性は、~buttonが作動化されたときの挙動を制御する,`列挙ed属性$である。 次の表に,この属性に対する各種~keywordと状態を挙げる — 1 列目の~keywordは、同じ行の 2 列目に示す状態に対応付けられる: ◎ The type attribute controls the behavior of the button when it is activated. It is an enumerated attribute. The following table lists the keywords and states for the attribute — the keywords in the left column map to the states in the cell in the second column on the same row as the keyword.

~keyword◎ Keyword 状態◎ State 概要◎ Brief description
`submit@v `Submit$st ~formを提出する ◎ Submits the form.
`reset@v `Reset$st ~formを再設定する ◎ Resets the form.
`button@v `Button$st 何もしない ◎ Does nothing.

[ `値なし用の既定$ / `妥当でない値~用の既定$ ]は、 `Submit$st 状態とする。 ◎ The missing value default and invalid value default are the Submit Button state.

要素は、その ``type$a 属性が `Submit$st 状態にあるときは,特に `提出-~button$になる。 ◎ If the type attribute is in the Submit Button state, the element is specifically a submit button.

拘束検証 ⇒ 要素が次を満たしている間は、`拘束検証の対象外$になる ⇒ ``type$a 属性の状態 ~IN { `Reset$st, `Button$st } ◎ Constraint validation: If the type attribute is in the Reset Button state or the Button state, the element is barred from constraint validation.

`button$e 要素 %B の`作動化の挙動$は、要素が`不能化-$されている場合は,何もしない。 他の場合は、要素の ``type$a 属性の現在の状態に応じて,次を走らす: ◎ A button element's activation behavior is to run the steps defined in the following list for the current state of this element's type attribute, if this element is not disabled, and do nothing otherwise:

`Submit@st
~IF[ %B の`~form所有者$ ~NEQ ~NULL ]~AND[ %B の`~node文書$は`全部的に作動中$である ] ⇒ %B の`~form所有者$を %B から`提出する$ ◎ If the element has a form owner and the element's node document is fully active, the element must submit the form owner from the button element.
`Reset@st
~IF[ %B の`~form所有者$ ~NEQ ~NULL ]~AND[ %B の`~node文書$は`全部的に作動中$である ] ⇒ %B の`~form所有者$を`再設定$する ◎ If the element has a form owner and the element's node document is fully active, the element must reset the form owner.
`Button@st
何もしない ◎ Do nothing.

`button$e 要素の: ◎ ↓

注記: `formnovalidate$a 属性は、提出-~buttonが拘束検証を誘発しないようにするために利用できる。 ◎ The formnovalidate attribute can be used to make submit buttons that do not trigger the constraint validation.

上に挙げた`~form提出用の属性$は、要素の ``type$a 属性が `Submit$st 状態にある場合を除いて,指定されては~MUST_NOT。 ◎ The formaction, formenctype, formmethod, formnovalidate, and formtarget must not be specified if the element's type attribute is not in the Submit Button state.

``value@a 属性は、~form提出の目的における要素の値を与える。 要素の`値$は[ 要素が ``value$a 属性を有するならば その値 / ~ELSE_ 空~文字列 ]になる。 ◎ The value attribute gives the element's value for the purposes of form submission. The element's value is the value of the element's value attribute, if there is one, or the empty string otherwise.

注記: ~button(および その値)は、 ~form提出を起動するために利用されたときに限り ~form提出に含される。 ◎ A button (and its value) is only included in the form submission if the button itself was used to initiate the form submission.


``value@m
``value$a 内容~属性を`反映-$し~MUST。 ◎ The value IDL attribute must reflect the content attribute of the same name.
``type@m
`既知の値のみに制限され$る下で, ``type$a 内容~属性を`反映-$し~MUST。 ◎ The type IDL attribute must reflect the content attribute of the same name, limited to only known values.

`button$e 要素の各種~IDL~member: ◎ ↓

"ヒントを示す" と~labelされている次の~buttonは、作動化-時には~dialog~boxを~pop-upする: ◎ The following button is labeled "Show hint" and pops up a dialog box when activated:

`button-1^xCode

4.10.7. ``select^e 要素

`分類$
`~flow内容$ /`句内容$ / `対話的~内容$ / `可触~内容$ / ◎ Flow content. ◎ Phrasing content. ◎ Interactive content. ◎ Listed, labelable, submittable, resettable, and autocapitalize-inheriting form-associated element. ◎ Palpable content.
`~formに所有され得る要素$のうち[ `~listされ$る / `提出-可能$な / `再設定-可能$な / `自動頭字化-を継承-$する ]もの。 ◎ ↑
`この要素を利用できる文脈$
`句内容$が期待される所。 ◎ Where phrasing content is expected.
`内容~model$
それぞれが[ `option$e, `optgroup$e, `~scriptを~supportする$ ]要素のいずれかである, 0 個~以上の要素。 ◎ Zero or more option, optgroup, and script-supporting elements.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
`autocomplete$a — ~form自動充填~特色機能~用の~hint。 ◎ autocomplete — Hint for form autofill feature
`autofocus$a — 頁が読込まれたときに,この~form~controlに自動的に~focusする。 ◎ autofocus — Automatically focus the form control when the page is loaded
`disabled$a — この~form~controlは不能化されるかどうか。 ◎ disabled — Whether the form control is disabled
`form$a — この~controlの所有者にする `form$e 要素を与える。 ◎ form — Associates the control with a form element
``multiple$a — 複数個の値を許容するかどうか。 ◎ multiple — Whether to allow multiple values
`name$a — [ `~form提出$ / `form.elements$m ~API ]において利用する~form~controlの名前。 ◎ name — Name of form control to use for form submission and in the form.elements API
``required$a — この~controlは`~form提出$に必須とされるかどうか。 ◎ required — Whether the control is required for form submission
``size$a — ~controlの~size。 ◎ size — Size of the control
`~DOM~interface$
[Exposed=Window,
 `HTMLConstructor$I]
interface `HTMLSelectElement@I : `HTMLElement$I {
  [`CEReactions$] attribute DOMString `autocomplete$m;
  [`CEReactions$] attribute boolean `autofocus$m;
  [`CEReactions$] attribute boolean `disabled$m;
  readonly attribute `HTMLFormElement$I? `form$m;
  [`CEReactions$] attribute boolean ``multiple$m;
  [`CEReactions$] attribute DOMString `name$m;
  [`CEReactions$] attribute boolean ``required$m;
  [`CEReactions$] attribute unsigned long ``size$m;

  readonly attribute DOMString ``type$m;

  [SameObject] readonly attribute `HTMLOptionsCollection$I ``options$m;
  [`CEReactions$] attribute unsigned long ``length$m;
  getter `Element$I? ``item$m(unsigned long %index);
  `HTMLOptionElement$I? ``namedItem$m(DOMString %name);
  [`CEReactions$] void ``add$m((`HTMLOptionElement$I or `HTMLOptGroupElement$I) element, optional (`HTMLElement$I or long)? %before = null);
  [`CEReactions$] void ``remove$m(); // ChildNode overload
  [`CEReactions$] void ``remove$m(long %index);
  [`CEReactions$] ``setter$m void (unsigned long %index, `HTMLOptionElement$I? %option);

  [SameObject] readonly attribute `HTMLCollection$I ``selectedOptions$m;
  attribute long ``selectedIndex$m;
  attribute DOMString ``value$m;

  readonly attribute boolean `willValidate$m;
  readonly attribute `ValidityState$I `validity$m;
  readonly attribute DOMString `validationMessage$m;
  boolean `checkValidity$m();
  boolean `reportValidity$m();
  void `setCustomValidity$m(DOMString %error);

  readonly attribute `NodeList$I `labels$m;
};

`select$e 要素は、選択肢( option )の集合から いくつかを選択するための~controlを表現する。 ◎ The select element represents a control for selecting amongst a set of options.

``multiple@a 属性は、`真偽~属性$である。 `select$e 要素は、この属性を[ 有する / 有さない ]ならば,要素の``選択肢~list$から[ 0 個~以上の選択肢 / 単独の選択肢 ]を選択するための~controlを`表現-$する。 ◎ The multiple attribute is a boolean attribute. If the attribute is present, then the select element represents a control for selecting zero or more options from the list of options. If the attribute is absent, then the select element represents a control for selecting a single option from the list of options.

``size@a 属性は、利用者に示す選択肢の個数を与える。 この属性に指定する値は、`妥当な非負~整数$であって,正数を表さ~MUST。 ◎ The size attribute gives the number of options to show to the user. The size attribute, if specified, must have a value that is a valid non-negative integer greater than zero.

`select$e 要素の ``表示~size@ は、要素が ``size$a 属性を[ 有するならば[ その値を`非負~整数として構文解析-$した結果 ~NIN { ~error, 0 } †ならば その結果 / ~ELSE_ 4 ] / 有さないならば 1 ]とする。 【† 原文は 結果が 0 になる場合の記述がおそらく抜けている — その場合も 4 にされるべきであろう。】 ◎ The display size of a select element is the result of applying the rules for parsing non-negative integers to the value of element's size attribute, if it has one and parsing it is successful. If applying those rules to the attribute's value is not successful, or if the size attribute is absent, then the element's display size is 4 if the element's multiple content attribute is present, and 1 otherwise.

`select$e 要素 %S の ``選択肢~list@ は、次のいずれかを満たす `option$e 要素すべてからなり、常に`木~順序$で~sortされるものとする:

  • %S の子である
  • %S の子である `optgroup$e 要素の子である
◎ The list of options for a select element consists of all the option element children of the select element, and all the option element children of all the optgroup element children of the select element, in tree order.

``required@a 属性は、`真偽~属性$である。 指定されたときは、利用者には,~formを提出する前に値を選択することが 要求されることになる。 ◎ The required attribute is a boolean attribute. When specified, the user will be required to select a value before submitting the form.

`select$e 要素 %S の `仮入力~label選択肢@ は、次に従って決定される[ `option$e 要素または ε ]である:

  1. ~IF[ %S は下の (A) に述べるいずれかの条件を満たさない ] ⇒ ~RET ε
  2. ~IF[ %S の``選択肢~list$は空である ] ⇒ ~RET ε
  3. %O ~LET %S の``選択肢~list$内の最初の要素
  4. ~IF[ %O の`値$opt ~EQ 空~文字列 ] ~RET ε
  5. ~IF[ %O の親~node ~NEQ %S (親~nodeは `optgroup$e 要素である) ] ~RET ε
  6. ~RET %O
◎ If a select element has a required attribute specified, does not have a multiple attribute specified, and has a display size of 1; and if the value of the first option element in the select element's list of options (if any) is the empty string, and that option element's parent node is the select element (and not an optgroup element), then that option is the select element's placeholder label option.

(A) 次をすべて満たす `select$e 要素 %S に対しては、[ %S の`仮入力~label選択肢$ ~NEQ ε ]で~MUST:

  • %S は ``required$a 属性を有する
  • %S は ``multiple$a 属性は有さない
  • %S の``表示~size$ ~EQ 1
◎ If a select element has a required attribute specified, does not have a multiple attribute specified, and has a display size of 1, then the select element must have a placeholder label option.

注記: 実施においては、上に言明された要件は、 `select$e 要素が[ 値 ~GT 1 にされた ``size$a 属性 ]を有さない場合に限り適用されている。 ◎ In practice, the requirement stated in the paragraph above can only apply when a select element does not have a size attribute with a value greater than 1.

拘束検証 ⇒ `select$e 要素 %S は、次を満たしている間は,`欠落の難あり$になる ⇒ [ %S は ``required$a 属性を有する ]~AND[ %S の``選択肢~list$内に次を満たす `option$e 要素 %O は無い ] ⇒ [ %O の`選択有無$opt ~EQ ~T ]~AND[ %O ~NEQ %S の`仮入力~label選択肢$ ] ◎ Constraint validation: If the element has its required attribute specified, and either none of the option elements in the select element's list of options have their selectedness set to true, or the only option element in the select element's list of options with its selectedness set to true is the placeholder label option, then the element is suffering from being missing.

`select$e 要素 %S が ``multiple$a 属性を有さない下では — 以下、 %L は %S の``選択肢~list$を表すとする — ~UAは: ◎ ↓

`select$e 要素 %S が[ `不能化-$されていない ]~AND[ ``multiple$a 属性を有する ]を満たしている下では、~UAは: ◎ If the multiple attribute is present, and the element is not disabled, then the user agent\

`選択-更新の通知を送信する@ ときは、所与の ( `select$e 要素 %S ) に対し,`利用者~対話~task源$から, 次を走らす`~taskを~queueし$~MUST: ◎ When the user agent is to send select update notifications, queue a task, using the user interaction task source, to run these steps:

  1. %S に向けて,名前 `input$et の`~eventを発火する$ — 次のように初期化して ⇒ `bubbles$m 属性 ~SET ~T ◎ Fire an event named input at the select element, with the bubbles attribute initialized to true.
  2. %S に向けて,名前 `change$et の`~eventを発火する$ — 次のように初期化して ⇒ `bubbles$m 属性 ~SET ~T ◎ Fire an event named change at the select element, with the bubbles attribute initialized to true.

`select$e 要素 %S 用の`再設定~algo$は、次を走らす:

  1. %L ~LET %S の``選択肢~list$
  2. %L 内の ~EACH( `option$e 要素 %O ) に対し:

    1. %O の`選択有無$opt ~SET [ %O は `selected^a 属性を有するならば ~T / ~ELSE_ ~F ]
    2. %O の`~dirtiness$opt ~SET ~F
  3. %L を`再設定するよう依頼-$する
◎ The reset algorithm for select elements is to go through all the option elements in the element's list of options, set their selectedness to true if the option element has a selected attribute, and false otherwise, set their dirtiness to false, and then have the option elements ask for a reset.

`select$e 要素の: ◎ ↓

`不能化-$されていない `select$e 要素は、`変異-可能$とする。 ◎ A select element that is not disabled is mutable.

%select . ``type$m
要素が ``multiple$a 属性を[ 有するならば `select-multiple^l / 有さないならば `select-one^l ]を返す。 ◎ Returns "select-multiple" if the element has a multiple attribute, and "select-one" otherwise.
%select . ``options$m
``選択肢~list$ を表現する `HTMLOptionsCollection$I を返す。 ◎ Returns an HTMLOptionsCollection of the list of options.
%select . ``length$m [ = %value ]
``選択肢~list$内の要素~数を返す。 ◎ Returns the number of elements in the list of options.
より少ない数に設定された場合、 `select$e 内の `option$e 要素たちを,その個数になるよう削る。 ◎ When set to a smaller number, truncates the number of option elements in the select.
より多い数に設定された場合、新たな空欄の `option$e 要素を `select$e に追加する。 ◎ When set to a greater number, adds new blank option elements to the select.
%element = %select . ``item$m(%index)
%select[%index]
``選択肢~list$内の %~index 番の~itemを返す。 ◎ Returns the item with index index from the list of options. The items are sorted in tree order.
%element = %select . ``namedItem$m(%name)
``選択肢~list$内に次を満たす~itemが[ 在るならば それらのうち最初のもの / 無いならば ~NULL ]返す ⇒ [ %name ~EQ `~ID$ ]~OR[ %name ~EQ `name^a ] ◎ Returns the first item with ID or name name from the list of options. ◎ Returns null if no element with that ID could be found.
%select . ``add$m(%element [, %before ] )
%before で所与の ~nodeの前に %element を挿入する。 ◎ Inserts element before the node given by before.
%before 引数は、数か ``選択肢~list$内の要素をとり得る。 前者の場合の %before は ``選択肢~list$ 内の %before 番~itemと解釈される。 ◎ The before argument can be a number, in which case element is inserted before the item with that number, or an element from the list of options, in which case element is inserted before that element.
%before が[ 省略されている / ~NULL / 範囲外の数 ]の場合、 %element は ~listの末尾に追加されることになる。 ◎ If before is omitted, null, or a number out of range, then element will be added at the end of the list.
%element が %select の先祖である場合、 `HierarchyRequestError$E 例外が投出される。 ◎ This method will throw a "HierarchyRequestError" DOMException if element is an ancestor of the element into which it is to be inserted.
%select . ``selectedOptions$m
``選択肢~list$内の選択されているものからなる `HTMLCollection$I を返す。 ◎ Returns an HTMLCollection of the list of options that are selected.
%select . ``selectedIndex$m [ = %value ]
選択されている~itemが[ 在るならば それらのうち最初のものの~index / 無いならば −1 ]を返す。 ◎ Returns the index of the first selected item, if any, or −1 if there is no selected item.
設定して,選択を変更できる。 ◎ Can be set, to change the selection.
%select . ``value$m [ = %value ]
選択されている~itemが[ 在るならば それらのうち最初のものの`値$opt / 無いならば 空~文字列 ]を返す。 ◎ Returns the value of the first selected item, if any, or the empty string if there is no selected item.
設定して,選択を変更できる。 ◎ Can be set, to change the selection.
``type@m
取得子は、此れが ``multiple$a 属性を[ 有するならば `select-multiple^l / 有さないならば `select-one^l ]を返さ~MUST。 ◎ The type IDL attribute, on getting, must return the string "select-one" if the multiple attribute is absent, and the string "select-multiple" if the multiple attribute is present.
``options@m
取得子は、次のようにされた `HTMLOptionsCollection$I ~objを返さ~MUST ⇒# 根 ~SET 此れ, ~filterは 此れの``選択肢~list$内の要素に合致する。 ◎ The options IDL attribute must return an HTMLOptionsCollection rooted at the select node, whose filter matches the elements in the list of options.

以下、 `~options@ は ``options$m 属性が返す~objを表すとする。 ◎ ↓

`HTMLSelectElement$I ~objは `~options$を そのまま映し出す。 それが`~supportする~prop~index$は、常に,`~options$のそれと同じとする。 ◎ The options collection is also mirrored on the HTMLSelectElement object. The supported property indices at any instant are the indices supported by the object returned by the options attribute at that instant.

``length@m
取得子は、此れの`~options$が成す`~collectionにより表現され$る~nodeの個数を返さ~MUST。 ◎ The length IDL attribute must return the number of nodes represented by the options collection.\
設定子は、此れの`~options$上の同じ名前の属性と同じに動作し~MUST。 ◎ On setting, it must act like the attribute of the same name on the options collection.
`getter^m
``item(index)@m
被呼出時には、此れの`~options$上の `item()$m ~methodを同じ引数で~callした結果を返さ~MUST。 ◎ The item(index) method must return the value returned by the method of the same name on the options collection, when invoked with the same argument.
``namedItem(name)@m
被呼出時には、此れの`~options$上の `namedItem()$m ~methodを同じ引数で~callした結果を返さ~MUST。 ◎ The namedItem(name) method must return the value returned by the method of the same name on the options collection, when invoked with the same argument.
``setter@m
此れ上で[ `新たな有index~propの値を設定する$ / `既存の有index~propの値を設定する$ ]ときは、代わりに,此れの`~options$上の 対応する~algo を走らせ~MUST。 ◎ When the user agent is to set the value of a new indexed property or set the value of an existing indexed property for a select element, it must instead run the corresponding algorithm on the select element's options collection.
``add()@m
被呼出時には、此れの`~options$上の同名の~methodと同じに動作し~MUST。 ◎ Similarly, the add() method must act like its namesake method on that same options collection.
``remove(index)@m

被呼出時には:

  • %index が与えられている場合、此れの`~options$上の同名の~methodと同じに動作し~MUST。
  • %index が与えられていない場合、[ 此れが実装する `ChildNode$I ~interface( `HTMLSelectElement$I ~interfaceが継承する `Element$I ~interfaceが実装する それ) ]上の同名の~methodと同じに動作し~MUST。
◎ The remove() method must act like its namesake method on that same options collection when it has arguments, and like its namesake method on the ChildNode interface implemented by the HTMLSelectElement ancestor interface Element when it has no arguments.
``selectedOptions@m
取得子は、次のようにされた `HTMLCollection$I ~objを返さ~MUST。 ⇒# 根 ~SET 此れ, ~filterは 此れの``選択肢~list$内の[ `選択有無$opt ~EQ ~T ]なる要素に合致する。 ◎ The selectedOptions IDL attribute must return an HTMLCollection rooted at the select node, whose filter matches the elements in the list of options that have their selectedness set to true.
``selectedIndex@m
取得子は、此れの``選択肢~list$内に[ `選択有無$opt ~EQ ~T ]なるものが[ 在るならば それらのうち最初の `option$e 要素の`~index$opt / 無いならば −1 ]を返さ~MUST。 ◎ The selectedIndex IDL attribute, on getting, must return the index of the first option element in the list of options in tree order that has its selectedness set to true, if any. If there isn't one, then it must return −1.

設定子は、次を走らせ~MUST:

  1. 此れの``選択肢~list$内の ~EACH( %option ) に対し:

    1. %option の`選択有無$opt ~SET ~F
    2. ~IF[ %option の`~index$opt ~EQ 所与の値 ] ⇒ %option の ⇒# `選択有無$opt ~SET ~T; `~dirtiness$opt ~SET ~T
◎ On setting, the selectedIndex attribute must set the selectedness of all the option elements in the list of options to false, and then the option element in the list of options whose index is the given new value, if any, must have its selectedness set to true and its dirtiness set to true.
注記: これは、 `select$e 要素~内の どの要素も[ `選択有無$opt ~NEQ ~T ]にさせ得る — 要素が[ ``multiple$a 属性を有さない ]~AND[ ``表示~size$ ~EQ 1 ]の場合でも。 ◎ This can result in no element having a selectedness set to true even in the case of the select element having no multiple attribute and a display size of 1.
``value@m
取得子は、此れの``選択肢~list$内に[ `選択有無$opt ~EQ ~T ]なるものが[ 在るならば それらのうち最初の `option$e 要素の`値$opt / 無いならば 空~文字列 ]を返さ~MUST。 ◎ The value IDL attribute, on getting, must return the value of the first option element in the list of options in tree order that has its selectedness set to true, if any. If there isn't one, then it must return the empty string.

設定子は、次を走らせ~MUST:

  1. 此れの``選択肢~list$内の ~EACH( %option ) に対し ⇒ %option の`選択有無$opt ~SET ~F
  2. ~IF[ 此れの``選択肢~list$内に[ `値$opt ~EQ 所与の値 ]を満たす `option$e 要素はある ] ⇒ それらのうち,最初のものの ⇒# `選択有無$opt ~SET ~T; `~dirtiness$opt ~SET ~T
◎ On setting, the value attribute must set the selectedness of all the option elements in the list of options to false, and then the first option element in the list of options, in tree order, whose value is equal to the given new value, if any, must have its selectedness set to true and its dirtiness set to true.
注記: これは、 `select$e 要素~内の どの要素も[ `選択有無$opt ~NEQ ~T ]にさせ得る — 要素が[ ``multiple$a 属性を有さない ]~AND[ ``表示~size$ ~EQ 1 ]の場合でも。 ◎ This can result in no element having a selectedness set to true even in the case of the select element having no multiple attribute and a display size of 1.
``multiple@m
``required@m
``size@m
順に, ``multiple$a, ``required$a, ``size$a 内容~属性を`反映-$し~MUST。 ◎ The multiple, required, and size IDL attributes must reflect the respective content attributes of the same name.\
``size$m ~IDL属性の既定の値は 0 とする。 ◎ The size IDL attribute has a default value of zero.
注記: 歴史的~理由から、 ``size$m ~IDL属性の値の既定の値は,利用されている実際の~sizeを返さない。 ``size$a 内容~属性が無い場合、それは, ``multiple$a 属性が[ 在るならば 4 / 無いならば 1 ]になる。 ◎ For historical reasons, the default value of the size IDL attribute does not return the actual size used, which, in the absence of the size content attribute, is either 1 or 4 depending on the presence of the multiple attribute.

`select$e 要素の各種~IDL~member: ◎ ↓

`select$e 要素を利用して,利用者が単独の選択肢を選択できるような選択肢の集合を利用者に提供する例 — 予め,既定の選択肢が選択されている: ◎ The following example shows how a select element can be used to offer the user with a set of options from which the user can select a single option. The default option is preselected.

`select-1^xCode

既定の選択肢が無い場合、代わりに`仮入力~label選択肢$を利用できる: ◎ When there is no default option, a placeholder can be used instead:

`select-2^xCode

利用者が、提供された選択肢の集合から いくつでも選択できるようにする例 — すべての選択肢が,既定で選択されている: ◎ Here, the user is offered a set of options from which they can select any number. By default, all five options are selected.

`select-3^xCode

利用者が 1 個~以上の~itemを選択する必要がある~UI例: ◎ Sometimes, a user has to select one or more items. This example shows such an interface.

`select-4^xCode

4.10.8. ``datalist^e 要素

`分類$
`~flow内容$ / `句内容$ ◎ Flow content. ◎ Phrasing content.
`この要素を利用できる文脈$
`句内容$が期待される所。 ◎ Where phrasing content is expected.
`内容~model$
次のいずれか一方:
  • `句内容$
  • それぞれが[ `option$e, `~scriptを~supportする$ ]要素のいずれかである, 0 個~以上の要素。
◎ Either: phrasing content. ◎ Or: Zero or more option and script-supporting elements.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
`~DOM~interface$
[Exposed=Window,
 `HTMLConstructor$I]
interface `HTMLDataListElement@I : `HTMLElement$I {
  [SameObject] readonly attribute `HTMLCollection$I ``options$m;
};

`datalist$e 要素は、[[ 他の~control用の 定義済みの選択肢 ]を表現する[ `option$e 要素の集合 ]]を表現する。 描画においては、 `datalist$e 要素は,何も`表現-$しない — それらの子も含め,隠されされるべきである。 ◎ The datalist element represents a set of option elements that represent predefined options for other controls. In the rendering, the datalist element represents nothing and it, along with its children, should be hidden.

`datalist$e 要素は、 2 つの仕方で利用できる: ◎ ↓

`datalist$e 要素は、 `input$e 要素に,その `list$a 属性を通して結び付けられる。 ◎ The datalist element is hooked up to an input element using the list attribute on the input element.

`datalist$e 要素の子孫である各 `option$e 要素のうち[ `不能化-$optされていない ]~AND[ `値$opt は空でない文字列である ]ものは、示唆を表現する。 各 示唆は ( `値$opt, `~label$opt ) を持つ。 ◎ Each option element that is a descendant of the datalist element, that is not disabled, and whose value is a string that isn't the empty string, represents a suggestion. Each suggestion has a value and a label.

%datalist . ``options$m
`datalist$e 要素の `option$e 要素からなる `HTMLCollection$I を返す。 ◎ Returns an HTMLCollection of the option elements of the datalist element.
``options@m
取得子は、次のようにされた `HTMLCollection$I を返さ~MUST ⇒# 根 ~SET 此れ, ~filterは `option$e 要素に合致する。 ◎ The options IDL attribute must return an HTMLCollection rooted at the datalist node, whose filter matches option elements.

拘束検証 ⇒ 要素が次を満たしている間は、`拘束検証の対象外$になる ⇒ 要素の先祖に `datalist$e 要素がある。 ◎ Constraint validation: If an element has a datalist element ancestor, it is barred from constraint validation.

4.10.9. ``optgroup^e 要素

`分類$
なし。 ◎ None.
`この要素を利用できる文脈$
`select$e 要素の子として。 ◎ As a child of a select element.
`内容~model$
それぞれが[ `option$e, `~scriptを~supportする$ ]要素のいずれかである, 0 個~以上の要素。 ◎ Zero or more option and script-supporting elements.
`text/html における~tag省略$
`optgroup$e 要素の`終了tag$は、[ 直後に別の `optgroup$e 要素が来る ]~OR[ 親~要素~内に後続する内容が無い ]ならば,省略できる。 ◎ An optgroup element's end tag can be omitted if the optgroup element is immediately followed by another optgroup element, or if there is no more content in the parent element.
`内容~属性$
`大域~属性$ ◎ Global attributes
``disabled$a — この~form~controlは不能化されるかどうか。 ◎ disabled — Whether the form control is disabled
``label$a — 利用者から可視な~label。 ◎ label — User-visible label
`~DOM~interface$
[Exposed=Window,
 `HTMLConstructor$I]
interface `HTMLOptGroupElement@I : `HTMLElement$I {
  [`CEReactions$] attribute boolean ``disabled$m;
  [`CEReactions$] attribute DOMString ``label$m;
};

`optgroup$e 要素は、共通の~labelを伴う `option$e 要素たちの~groupを`表現-$する。 ◎ The optgroup element represents a group of option elements with a common label.

この~groupは、 `optgroup$e 要素の子である `option$e 要素たちからなる。 ◎ The element's group of option elements consists of the option elements that are children of the optgroup element.

~UAは、[ そのような `option$e 要素~groupを `select$e 要素~内に示すとき ]は、互いに関係しているように,他の `option$e 要素から分離して示すべきである。 ◎ When showing option elements in select elements, user agents should show the option elements of such groups as being related to each other and separate from other option elements.

``disabled@a 属性は、`真偽~属性$であり、 `option$e 要素~groupをまとめて`不能化-$optすることに利用できる。 ◎ The disabled attribute is a boolean attribute and can be used to disable a group of option elements together.

``label@a 属性は、指定され~MUST。 その値は,~groupの名前を与える。 ~UIの目的においては、~UAは,この属性の値を利用して `select$e 要素~内の `option$e 要素~groupに~labelを与えるべきである。 ◎ The label attribute must be specified. Its value gives the name of the group, for the purposes of the user interface. User agents should use this attribute's value when labeling the group of option elements in a select element.

``disabled@m
``label@m
順に, ``disabled$a, ``label$a 内容~属性を`反映-$し~MUST。 ◎ The disabled and label attributes must reflect the respective content attributes of the same name.

注記: `optgroup$e 要素を選択する仕方は無い。 選択できるのは `option$e 要素に限られる。 `optgroup$e 要素は、単に`option$e 要素~groupに~labelを供するに過ぎない。 ◎ There is no way to select an optgroup element. Only option elements can be selected. An optgroup element merely provides a label for a group of option elements.

`select$e ~drop-down ~widget内に 3 種の課程からなる講義を提供する例: ◎ The following snippet shows how a set of lessons from three courses could be offered in a select drop-down widget:

`optgroup-1^xCode

4.10.10. ``option^e 要素

`分類$
なし。 ◎ None.
`この要素を利用できる文脈$
`select$e 要素の子として。 ◎ As a child of a select element.
`datalist$e 要素の子として。 ◎ As a child of a datalist element.
`optgroup$e 要素の子として。 ◎ As a child of an optgroup element.
`内容~model$
要素は[ ``label$a 属性を有する ]~AND[ ``value$a 属性を有する ]場合に限り ⇒ `なし$。 ◎ If the element has a label attribute and a value attribute: Nothing.
要素は[ ``label$a 属性を有する ]~AND[ ``value$a 属性を有さない ]場合に限り ⇒ `~text$。 ◎ If the element has a label attribute but no value attribute: Text.
要素は[ ``label$a 属性を有さない ]~AND[ `datalist$e 要素の子でない ]場合に限り ⇒ `要素間~空白$でない`~text$。 ◎ If the element has no label attribute and is not a child of a datalist element: Text that is not inter-element whitespace.
要素は[ ``label$a 属性を有する ]~AND[ `datalist$e 要素の子である ]場合に限り ⇒ `~text$。 ◎ If the element has no label attribute and is a child of a datalist element: Text.
`text/html における~tag省略$
`option$e 要素の`終了tag$は、[ 直後に[ 別の `option$e / `optgroup$e ]要素が来る ]~OR[ 親~要素~内に後続する内容が無い ]ならば,省略できる。 ◎ An option element's end tag can be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element.
`内容~属性$
`大域~属性$ ◎ Global attributes
``disabled$a — この~form~controlは不能化されるかどうか。 ◎ disabled — Whether the form control is disabled
``label$a — 利用者から可視な~label。 ◎ label — User-visible label
``selected$a — この選択肢が既定ので選択されるかどうか。 ◎ selected — Whether the option is selected by default
``value$a — `~form提出$に利用される値。 ◎ value — Value to be used for form submission
`~DOM~interface$
[Exposed=Window,
 `HTMLConstructor$I,
NamedConstructor=``Option$m(optional DOMString %text = "", optional DOMString %value, optional boolean %defaultSelected = false, optional boolean %selected = false)]
interface `HTMLOptionElement@I : `HTMLElement$I {
  [`CEReactions$] attribute boolean ``disabled$m;
  readonly attribute `HTMLFormElement$I? ``form$m;
  [`CEReactions$] attribute DOMString ``label$m;
  [`CEReactions$] attribute boolean ``defaultSelected$m;
  attribute boolean ``selected$m;
  [`CEReactions$] attribute DOMString ``value$m;

  [`CEReactions$] attribute DOMString ``text$m;
  readonly attribute long ``index$m;
};

`option$e 要素は、[ `select$e 要素~内の選択肢 ], または[ `datalist$e 要素~内の示唆~listの一部 ]を`表現-$する。 ◎ The option element represents an option in a select element or as part of a list of suggestions in a datalist element.

`select$e 要素の定義にて述べた一定の状況下では、 `option$e 要素は `select$e 要素の`仮入力~label選択肢$になり得る。 `仮入力~label選択肢$は、実際の選択肢を表現しない代わりに `select$e ~controlの~labelを表現する。 ◎ In certain circumstances described in the definition of the select element, an option element can be a select element's placeholder label option. A placeholder label option does not represent an actual option, but instead represents a label for the select control.

``disabled@a 属性は、`真偽~属性$である。 `option$e 要素は、次のいずれかを満たすとき, `不能化-@opt される:

  • ``disabled$a 属性を有する
  • `disabled^a 属性を有する `optgroup$e 要素の子である
◎ The disabled attribute is a boolean attribute. An option element is disabled if its disabled attribute is present or if it is a child of an optgroup element whose disabled attribute is present.

`option$e 要素が`不能化-$optされている間は、`利用者~対話~task源$から`~queueされ$る どの `click$et ~eventも,要素に配送されないようにし~MUST。 ◎ An option element that is disabled must prevent any click events that are queued on the user interaction task source from being dispatched on the element.

``label@a 属性は、要素の~labelを供する。 `option$e 要素の `~label@opt は、[[ 要素は ``label$a 内容~属性を有していて,その値 ~NEQ 空~文字列 ]ならば その値 / ~ELSE_ 要素の``text$m ~IDL属性の値 ]になる。 ◎ The label attribute provides a label for element. The label of an option element is the value of the label content attribute, if there is one and its value is not the empty string, or, otherwise, the value of the element's text IDL attribute.

``label$a 内容~属性に指定する値は、空であっては~MUST_NOT。 ◎ The label content attribute, if specified, must not be empty.

``value@a 属性は、要素の値を供する。 `option$e 要素の `値@opt は、[ 要素は ``value$a 内容~属性を有するならば その値 / ~ELSE_ 要素の ``text$m ~IDL属性の値 ]になる。 ◎ The value attribute provides a value for element. The value of an option element is the value of the value content attribute, if there is one, or, if there is not, the value of the element's text IDL attribute.

``selected@a 属性は、`真偽~属性$である。 それは、要素の既定の`選択有無$optを表現する。 ◎ The selected attribute is a boolean attribute. It represents the default selectedness of the element.

`option$e 要素の `~dirtiness@opt は、真偽~状態であり,初期~時には ~F とする。 それは ``selected$a 内容~属性を[ 追加する/除去する ]ことが効果を及ぼすかどうかを制御する。 ◎ The dirtiness of an option element is a boolean state, initially false. It controls whether adding or removing the selected content attribute has any effect.

`option$e 要素の `選択有無@opt は、真偽~状態であり,初期~時には ~F とする。 他が指定されない限り,要素の作成-時には、要素の`選択有無$optは,[ 要素が ``selected$a 属性を有する ]ならば ~T に設定され~MUST。 [ `~dirtiness$opt ~EQ ~F ]の下では、 ``selected$a 属性が `option$e 要素[ に追加される / から除去される ]度に、その`選択有無$optは,[ ~T / ~F ]に設定され~MUST。 ◎ The selectedness of an option element is a boolean state, initially false. Except where otherwise specified, when the element is created, its selectedness must be set to true if the element has a selected attribute. Whenever an option element's selected attribute is added, if its dirtiness is false, its selectedness must be set to true. Whenever an option element's selected attribute is removed, if its dirtiness is false, its selectedness must be set to false.

注記: ``Option()$m 構築子は、 3 個~以下の引数で~callされたときは、`選択有無$optの初期~状態を上書きして — [ 3 個目の引数 ~EQ ~T ]の場合( ``selected$a 属性は設定されることを含意する)であっても — 状態は 常に ~F になるようにする。 4 個目の引数を利用すれば、初期の`選択有無$opt状態を明示的に設定できる。 ◎ The Option() constructor, when called with three or fewer arguments, overrides the initial state of the selectedness state to always be false even if the third argument is true (implying that a selected attribute is to be set). The fourth argument can be used to explicitly set the initial selectedness state when using the constructor.

`select$e 要素が `multiple^a 属性を有さない場合、その子孫に[ ``selected$a 属性を有する ]ような `option$e 要素が複数~在っては~MUST_NOT。 ◎ A select element whose multiple attribute is not specified must not have more than one descendant option element with its selected attribute set.

`option$e 要素 %O の `~index@opt は、[ %O が ある`選択肢~list$内に含まれるならば その~list内で %O より前に来る `option$e 要素の個数 / ~ELSE_ 0 † ]とする。 【† ~listの先頭にあるときと区別がつかないことになる。】 ◎ An option element's index is the number of option elements that are in the same list of options but that come before it in tree order. If the option element is not in a list of options, then the option element's index is zero.

%option . ``selected$m
[ 要素が選択されているならば~T / ~ELSE_ ~F ]を返す。 ◎ Returns true if the element is selected, and false otherwise.
設定して,この要素の現在の状態を上書きできる。 ◎ Can be set, to override the current state of the element.
%option . ``index$m
`select$e 要素の`~options$における要素の~indexを返す。 ◎ Returns the index of the element in its select element's options list.
%option . ``form$m
要素が属する `form$e 要素が[ 在るならば それ / 無いならば ~NULL ]を返す。 ◎ Returns the element's form element, if any, or null otherwise.
%option . ``text$m
~ASCII空白は縮約され, `script$e 要素は飛ばされることを除いて、 `textContent$m と同じ。 ◎ Same as textContent, except that spaces are collapsed and script elements are skipped.
%option = new ``Option( [ text [, value [, defaultSelected [, selected ] ] ] ] )$m
新たな `option$e 要素を返す。 ◎ Returns a new option element.
%text 引数は、要素の内容を設定する。 ◎ The text argument sets the contents of the element.
%value 引数は ``value$a 属性を設定する。 ◎ The value argument sets the value attribute.
%defaultSelected 引数は ``selected$a 属性を設定する。 ◎ The defaultSelected argument sets the selected attribute.
%selected 引数は、要素が選択されるかどうかを設定する。 省略された場合、[ %defaultSelected 引数 ~EQ ~T ]であっても,要素は選択されない。 ◎ The selected argument sets whether or not the element is selected. If it is omitted, even if the defaultSelected argument is true, the element is not selected.
``disabled@m
``disabled$a 内容~属性を`反映-$し~MUST。 ◎ The disabled IDL attribute must reflect the content attribute of the same name.
``defaultSelected@m
``selected$a 内容~属性を`反映-$し~MUST。 ◎ The defaultSelected IDL attribute must reflect the selected content attribute.
``label@m
取得子は、[ 此れは ``label$a 内容~属性を有するならば その値 / ~ELSE_ 要素の`~label$opt ]を返さ~MUST。 ◎ The label IDL attribute, on getting, if there is a label content attribute, must return that attribute's value; otherwise, it must return the element's label.\
設定子は、此れの ``label$a 内容~属性を所与の値に設定し~MUST。 ◎ On setting, the element's label content attribute must be set to the new value.
``value@m
取得子は、此れの`値$optを返さ~MUST。 ◎ The value IDL attribute, on getting, must return the element's value.\
設定子は、此れの ``value$a 内容~属性を所与の値に設定し~MUST。 ◎ On setting, the element's value content attribute must be set to the new value.
``selected@m
取得子は、此れの`選択有無$optに応じて[ ~T ならば ~T / ~F ならば ~F ]を返さ~MUST。 ◎ The selected IDL attribute, on getting, must return true if the element's selectedness is true, and false otherwise.\

設定子は、次を走らせ~MUST:

  1. 此れの`選択有無$opt ~SET 所与の値
  2. 此れの`~dirtiness$opt ~SET ~T
  3. 此れを`再設定するよう依頼-$する
◎ On setting, it must set the element's selectedness to the new value, set its dirtiness to true, and then cause the element to ask for a reset.
``index@m
取得子は、此れの`~index$optを返さ~MUST。 ◎ The index IDL attribute must return the element's index.
``text@m

取得子は、次を走らせ~MUST:

  1. %結果 ~LET 次に該当する `Text$I ~nodeすべてを`木~順序$で連結した結果 ⇒ 此れの子孫であって,此れの子孫である[ `script$e / SVG `script^e 要素 ]の子孫ではない
  2. ~RET `~ASCII空白を剥いで縮約する$( %結果 )
◎ The text IDL attribute, on getting, must return the result of stripping and collapsing ASCII whitespace from the concatenation of data of all the Text node descendants of the option element, in tree order, excluding any that are descendants of descendants of the option element that are themselves script or SVG script elements.
設定子は、[ 此れの `textContent$m ~IDL属性に 所与の値が設定された ]かのように動作し~MUST。 ◎ On setting, the text attribute must act as if the textContent IDL attribute on the element had been set to the new value.
``form@m

取得子は、次を走らせ~MUST:

  1. %S ~LET 此れの親
  2. ~IF[ %S は `optgroup$e 要素である ] ⇒ %S ~SET %S の親
  3. ~IF[ %S は `select$e 要素である ] ⇒ ~RET %S の `form$m ~IDL属性と同じ値
  4. ~RET ~NULL
◎ The form IDL attribute's behavior depends on whether the option element is in a select element or not. If the option has a select element as its parent, or has an optgroup element as its parent and that optgroup element has a select element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that select element. Otherwise, it must return null.
``Option(text, value, defaultSelected, selected)@m
`HTMLOptionElement$I ~objを作成する構築子を供する ( ~DOMの `createElement()$m などの~factory~methodに加えて)。 ◎ A constructor is provided for creating HTMLOptionElement objects (in addition to the factory methods from DOM such as createElement()): Option(text, value, defaultSelected, selected).\

被呼出時には、次を走らせ~MUST: ◎ When invoked, the constructor must perform the following steps:

  1. %文書 ~LET `現在の大域~obj$に`結付けられている文書$ ◎ Let document be the current global object's associated Document.
  2. %option ~LET `要素を作成する$( %文書, `option^l, `~HTML名前空間$ ) ◎ Let option be the result of creating an element given document, option, and the HTML namespace.
  3. ~IF[ %text ~NEQ 空~文字列 ] ⇒ %option に次のようにされた新たな `Text$I ~nodeを付加する ⇒ ~data ~SET %text ◎ If text is not the empty string, then append to option a new Text node whose data is text.
  4. ~IF[ %value は与えられている ] ⇒ %option の`属性~値を設定する$( "``value$a", %value ) ◎ If value is given, then set an attribute value for option using "value" and value.
  5. ~IF[ %defaultSelected ~EQ ~T ] ⇒ %option の`属性~値を設定する$( "``selected$a", 空~文字列 ) ◎ If defaultSelected is true, then set an attribute value for option using "selected" and the empty string.
  6. %option の`選択有無$opt ~SET [ %selected ~EQ ~T ならば ~T / ~ELSE_ ~F ( %defaultSelected ~EQ ~T であっても) ] ◎ If selected is true, then set option's selectedness to true; otherwise set its selectedness to false (even if defaultSelected is true).
  7. ~RET %option ◎ Return option.

4.10.11. ``textarea^e 要素

`分類$
`~flow内容$ /`句内容$ / `対話的~内容$ / `可触~内容$ / ◎ Flow content. ◎ Phrasing content. ◎ Interactive content. ◎ Listed, labelable, submittable, resettable, and autocapitalize-inheriting form-associated element. ◎ Palpable content.
`~formに所有され得る要素$のうち[ `~listされ$る / `提出-可能$な / `再設定-可能$な / `自動頭字化-を継承-$する ]もの。 ◎ ↑
`この要素を利用できる文脈$
`句内容$が期待される所。 ◎ Where phrasing content is expected.
`内容~model$
`~text$。 ◎ Text.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
`autocomplete$a — ~form自動充填~特色機能~用の~hint。 ◎ autocomplete — Hint for form autofill feature
`autofocus$a — 頁が読込まれたときに,この~form~controlに自動的に~focusする。 ◎ autofocus — Automatically focus the form control when the page is loaded
``cols$a — 行あたりの最大~文字~数 ◎ cols — Maximum number of characters per line
`dirname$a — `~form提出$時に要素の`方向性$を送信するために利用される,~form~controlの名前。 ◎ dirname — Name of form control to use for sending the element's directionality in form submission
`disabled$a — この~form~controlは不能化されるかどうか。 ◎ disabled — Whether the form control is disabled
`form$a — この~controlの所有者にする `form$e 要素を与える。 ◎ form — Associates the control with a form element
``maxlength$a — 値の最大~長さ。 ◎ maxlength — Maximum length of value
``minlength$a — 値の最小~長さ ◎ minlength — Minimum length of value
`name$a — [ `~form提出$ / `form.elements$m ~API ]において利用する~form~controlの名前。 ◎ name — Name of form control to use for form submission and in the form.elements API
``placeholder$a — この~form~controlに配置され,利用者から可視になる~label。 ◎ placeholder — User-visible label to be placed within the form control
``readonly$a — 利用者が値を編集できなくするかどうか ◎ readonly — Whether to allow the value to be edited by the user
``required$a — この~controlは`~form提出$に必須とされるかどうか。 ◎ required — Whether the control is required for form submission
``rows$a — 示す行l数 ◎ rows — Number of lines to show
``wrap$a — `~form提出$時に ~form~controlの値がどう折返されるか ◎ wrap — How the value of the form control is to be wrapped for form submission
`~DOM~interface$
[Exposed=Window,
 `HTMLConstructor$I]
interface `HTMLTextAreaElement@I : `HTMLElement$I {
  [`CEReactions$] attribute DOMString `autocomplete$m;
  [`CEReactions$] attribute boolean `autofocus$m;
  [`CEReactions$] attribute unsigned long ``cols$m;
  [`CEReactions$] attribute DOMString ``dirName$m;
  [`CEReactions$] attribute boolean `disabled$m;
  readonly attribute `HTMLFormElement$I? `form$m;
  [`CEReactions$] attribute long ``maxLength$m;
  [`CEReactions$] attribute long ``minLength$m;
  [`CEReactions$] attribute DOMString `name$m;
  [`CEReactions$] attribute DOMString ``placeholder$m;
  [`CEReactions$] attribute boolean ``readOnly$m;
  [`CEReactions$] attribute boolean ``required$m;
  [`CEReactions$] attribute unsigned long ``rows$m;
  [`CEReactions$] attribute DOMString ``wrap$m;

  readonly attribute DOMString ``type$m;
  [`CEReactions$] attribute DOMString ``defaultValue$m;
  [`CEReactions$] attribute [TreatNullAs=EmptyString] DOMString ``value$m;
  readonly attribute unsigned long ``textLength$m;

  readonly attribute boolean `willValidate$m;
  readonly attribute `ValidityState$I `validity$m;
  readonly attribute DOMString `validationMessage$m;
  boolean `checkValidity$m();
  boolean `reportValidity$m();
  void `setCustomValidity$m(DOMString %error);

  readonly attribute `NodeList$I `labels$m;

  void `select$m();
  attribute unsigned long `selectionStart$m;
  attribute unsigned long `selectionEnd$m;
  attribute DOMString `selectionDirection$m;
  void `setRangeText$m(DOMString %replacement);
  void `setRangeText$m(DOMString %replacement, unsigned long %start, unsigned long %end, optional `SelectionMode$I %selectionMode = "preserve");
  void `setSelectionRange$m(unsigned long %start, unsigned long %end, optional DOMString %direction);
};

この節においては:

`textarea$e 要素は、[ 要素の ``生の値@ を与える,複数行からなる素の~text ]用の編集~controlを`表現-$する。 この~controlの内容は、~controlの既定の値を表現する。 ◎ The textarea element represents a multiline plain text edit control for the element's raw value. The contents of the control represent the control's default value.

`textarea$e ~controlの``生の値$は、初期~時には空~文字列で~MUST。 ◎ The raw value of a textarea control must be initially the empty string.

注記: この要素には、 双方向的~algoを孕む描画~要件がある 。 ◎ This element has rendering requirements involving the bidirectional algorithm.

``readonly@a 属性は、`真偽~属性$であり,利用者が~textを編集できなくするかどうかを制御するために利用される。 ◎ The readonly attribute is a boolean attribute used to control whether the text can be edited by the user or not.

この例では、~text~controlは読専~fileの中身を表現するので `readonly^a が付与されている: ◎ In this example, a text control is marked read-only because it represents a read-only file:

`textarea-1^xCode

拘束検証 ⇒ 要素が次を満たしている間は、`拘束検証の対象外$になる ⇒ `textarea$e 要素は ``readonly$a 属性を有する ◎ Constraint validation: If the readonly attribute is specified on a textarea element, the element is barred from constraint validation.

`textarea$e 要素は、[ `不能化-$されていない ]~AND[ ``readonly$a 属性を有さない ]ならば,`変異-可能$とする。 ◎ A textarea element is mutable if it is neither disabled nor has a readonly attribute specified.

`textarea$e 要素が`変異-可能$である下では、~UAは: ◎ When a textarea is mutable,\

`textarea$e 要素の`~dirty値~flag$は、[ 利用者が~controlと対話して その``生の値$を変更する ]度に, ~T に設定され~MUST。 ◎ A textarea element's dirty value flag must be set to true whenever the user interacts with the control in a way that changes the raw value.

`textarea$e 要素~用の`~clone時の手続き$は、[ ``生の値$, `~dirty値~flag$ ]も~clone先の~nodeに複製し~MUST。 ◎ The cloning steps for textarea elements must propagate the raw value and dirty value flag from the node being cloned to the copy.

`textarea$e 要素~用の`子~text内容~変更-時の手続き$は、次を走らせ~MUST ⇒ ~IF[ 要素の`~dirty値~flag$ ~EQ ~F ] ⇒ 要素の``生の値$ ~SET 要素の`子~text内容$ ◎ The child text content change steps for textarea elements must, if the element's dirty value flag is false, set the element's raw value to its child text content.

`textarea$e 要素~用の`再設定~algo$は、次を走らす:

  1. 要素の`~dirty値~flag$ ~SET ~F
  2. 要素の``生の値$ ~SET 要素の`子~text内容$
◎ The reset algorithm for textarea elements is to set the dirty value flag back to false, and set the raw value of element to its child text content.

`textarea$e 要素が[ `~HTML構文解析器$ / `~XML構文解析器$ ]の`~open要素~stack$から~popされたときは、~UAは 要素の`再設定~algo$を呼び出さ~MUST。 ◎ When a textarea element is popped off the stack of open elements of an HTML parser or XML parser, then the user agent must invoke the element's reset algorithm.

要素は`変異-可能$である下では、~UAは,利用者が要素の書字~方向を[ 左横書き/ 右横書き ]変更できるようにするべきである。 利用者がそうしたときは、~UAは,次の手続きを走らせ~MUST: ◎ If the element is mutable, the user agent should allow the user to change the writing direction of the element, setting it either to a left-to-right writing direction or a right-to-left writing direction. If the user does so, the user agent must then run the following steps:

  1. 要素の`dir$a 属性 ~SET 利用者が選択した書字~方向に応じて[ 左横書きならば `ltr$v / 右横書き ならば `rtl$v ] ◎ Set the element's dir attribute to "ltr" if the user selected a left-to-right writing direction, and "rtl" if the user selected a right-to-left writing direction.
  2. 次を走らす`~taskを~queueする$ ⇒ `textarea$e 要素に向けて,名前 `input$et の`~eventを発火する$ — 次のように初期化して ⇒ `bubbles$m 属性 ~SET ~T ◎ Queue a task to fire an event named input at the textarea element, with the bubbles attribute initialized to true.

``cols@a 属性は、`一行分の字数$ — 期待される,行あたりの最大~文字~数 — を指定する。 この属性に指定する値は、`妥当な非負~整数$であって,正数を表さ~MUST。 ◎ The cols attribute specifies the expected maximum number of characters per line. If the cols attribute is specified, its value must be a valid non-negative integer greater than zero.\

`textarea$e 要素の `一行分の字数@† は、[ 要素は ``cols$a 属性を有していて,[ その値を`非負~整数として構文解析-$した結果 ~NIN { ~error, 0 } ]ならば その結果 / ~ELSE_ 20 ]とする。 ◎ If applying the rules for parsing non-negative integers to the attribute's value results in a number greater than zero, then the element's character width is that value; otherwise, it is 20.

【† 原文では “character width” と記されている(そのまま訳すと “文字横幅” になり,紛らわしい)。 下の “`行数$( character height )” も同様。 】

~UAは、`一行分の字数$を[ ~serverが選好する 各~行lごとの文字~数を表す,利用者への~hint ]として利用して~MAY(例: 視覚的~UAにおいては、~controlの横幅を その文字~数にするなど)。 視覚的~描画においては、~UAは,描画~時に 各~行lが この文字~数を超えないように 利用者の入力を折返すべきである。 ◎ The user agent may use the textarea element's character width as a hint to the user as to how many characters the server prefers per line (e.g. for visual user agents by making the width of the control be that many characters). In visual renderings, the user agent should wrap the user's input in the rendering so that each line is no wider than this number of characters.

【 全角と半角の違いに関しては、この仕様には述べられていない。 】

``rows@a 属性は、`行数$ — 利用者に示す行l数 — を指定する。 この属性に指定する値は、`妥当な非負~整数$であって,正数を表さ~MUST。 ◎ The rows attribute specifies the number of lines to show. If the rows attribute is specified, its value must be a valid non-negative integer greater than zero.\

`textarea$e 要素の `行数@ は、[ 要素は ``rows$a 属性を有していて,[ その値を`非負~整数として構文解析-$した結果 ~NIN { ~error, 0 } ]ならば その結果 / ~ELSE_ 2 ]とする。 ◎ If applying the rules for parsing non-negative integers to the attribute's value results in a number greater than zero, then the element's character height is that value; otherwise, it is 2.

視覚的~UAは、~controlの縦幅を`行数$で与えられる行l数に設定するべきである。 ◎ Visual user agents should set the height of the control to the number of lines given by character height.

``wrap@a 属性は,`列挙ed属性$であり、次に挙げる~keywordをとり得る:

`soft@v
`値なし用の既定$
`妥当でない値~用の既定$
`Soft@st 状態に対応付けられる。
この状態は、[ `textarea$e 内の~textは、提出-時には,折返されない ]ことを指示する(それでも,描画-時には折返され得るが)。
`hard@v
`Hard@st 状態に対応付けられる。
この状態は、[ `textarea$e 内の~textは、提出-時には,~textが折返されるよう~UAにより改行文字が追加される ]ことを指示する。
この状態にある下では、要素には ``cols$a 属性も指定され~MUST。
◎ The wrap attribute is an enumerated attribute with two keywords and states: the soft keyword which maps to the Soft state, and the hard keyword which maps to the Hard state. The missing value default and invalid value default are the Soft state. ◎ The Soft state indicates that the text in the textarea is not to be wrapped when it is submitted (though it can still be wrapped in the rendering). ◎ The Hard state indicates that the text in the textarea is to have newlines added by the user agent so that the text is wrapped when it is submitted. ◎ If the element's wrap attribute is in the Hard state, the cols attribute must be specified.

歴史的~理由から、要素の値は,それぞれ目的が異なる 3 種類の仕方で正規化される: ◎ For historical reasons, the element's value is normalized in three different ways for three different purposes.\

要素の`~API値$を得るための~algoは、要素の``生の値$を `~textarea用に改行を正規化-@ した結果を返す — それは、所与の %文字列 に対し,次の~algoを適用する: ◎ The algorithm for obtaining the element's API value is to return the element's raw value with the textarea line break normalization transformation applied. The textarea line break normalization transformation is the following algorithm, as applied to a string:

  1. %文字列 内の~CRLFすべてを,それぞれ 1 個の~LFに置換する ◎ Replace every U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair with a single U+000A LINE FEED (LF) character.
  2. %文字列 内に残された~CRすべてを,それぞれ 1 個の~LFに置換する ◎ Replace every remaining U+000D CARRIAGE RETURN character with a single U+000A LINE FEED (LF) character.

要素の`値$は、要素の``生の値$を `~textarea用に行lを折返した@ 結果として定義される — それは、所与の %文字列 に対し,次の~algoを適用する: ◎ The element's value is defined to be the element's raw value with the textarea wrapping transformation applied. The textarea wrapping transformation is the following algorithm, as applied to a string:

  1. %文字列 内の[ 直後の文字が~LFでない ~CR ]すべて, および[ 直前の文字が~CRでない ~LF ]すべてを,それぞれ~CRLFに置換する。 ◎ Replace every occurrence of a U+000D CARRIAGE RETURN (CR) character not followed by a U+000A LINE FEED (LF) character, and every occurrence of a U+000A LINE FEED (LF) character not preceded by a U+000D CARRIAGE RETURN (CR) character, by a two-character string consisting of a U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair.
  2. ~IF[ 要素の ``wrap$a 属性の状態 ~EQ `Hard$st ] ⇒ ~UAにより定義される~algoを利用して、[ 各~行lの文字~数 ~LTE `一行分の字数$ ]になるように, %文字列 の中に~CRLF を挿入する。 この要件の目的においては、各~行lは[ %文字列 の始端, %文字列 の終端, ~CRLF ]で区切られるとする。 ◎ If the element's wrap attribute is in the Hard state, insert U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pairs into the string using a UA-defined algorithm so that each line has no more than character width characters. For the purposes of this requirement, lines are delimited by the start of the string, the end of the string, and U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pairs.

``maxlength@a 属性は、 ~form~control `maxlength^a 属性 である。 ◎ The maxlength attribute is a form control maxlength attribute.

[ `textarea$e 要素の`値に許容される最大~長さ$ ~NEQ ε ]の場合、要素の子たちは,次を満たすようにされ~MUST ⇒ [ 要素の `textContent$m ~IDL属性の値を,`~textarea用に改行を正規化-$した結果 ]の`~JS文字列~長さ$ ~LTE 要素の`値に許容される最大~長さ$ ◎ If the textarea element has a maximum allowed value length, then the element's children must be such that the JavaScript string length of the value of the element's textContent IDL attribute with the textarea line break normalization transformation applied is equal to or less than the element's maximum allowed value length.

``minlength@a 属性は、 ~form~control `minlength^a 属性 である。 ◎ The minlength attribute is a form control minlength attribute.

``required@a 属性は、`真偽~属性$である。 指定されたときは、利用者には,~formを提出する前に値を手入力することが 要求されることになる。 ◎ The required attribute is a boolean attribute. When specified, the user will be required to enter a value before submitting the form.

拘束検証 ⇒ 要素が次を満たしている間は、`欠落の難あり$になる ⇒ [ 要素は ``required$a を有する ]~AND[ 要素は`変異-可能$ ]~AND[ 要素の`値$ ~EQ 空~文字列 ] ◎ Constraint validation: If the element has its required attribute specified, and the element is mutable, and the element's value is the empty string, then the element is suffering from being missing.

``placeholder@a 属性は、短い ~hint(または単語や短い句)を表現し、~controlが値を持たないときに,利用者を援助する~dataを与えるために意図される。 ~hintは、見本の値や,期待される形式についての概略的な記述にすることもできる。 ◎ The placeholder attribute represents a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.

``placeholder$a 属性は `label$e の代替として利用されるべきでない。 より長い~hintや他の助言的~textには、 `title$a 属性がより適切になる。 ◎ The placeholder attribute should not be used as an alternative to a label. For a longer hint or other advisory text, the title attribute is more appropriate.

注記: これらの仕組みは互いに よく似るが、微妙に相違する:

  • ~controlの `label$e で与えられる~hintは,いつでも示される。
  • ``placeholder$a 属性が与える短い~hintは,利用者が値を手入力する前に示される。
  • `title$a 属性~内の~hintは,利用者が更なる~helpを要請したときに示される。
◎ These mechanisms are very similar but subtly different: the hint given by the control's label is shown at all times; the short hint given in the placeholder attribute is shown before the user enters a value; and the hint in the title attribute is shown when the user requests further help.

~UAは、要素の`値$が空~文字列で ~controlが`~focusされて$いないときには、この~hintを(当の~controlの内側に表示するなどして)利用者に呈示するべきである。 ~hintの描画-時には,~hint内の各[ ~CRLF, および 他の ~CR, ~LF ]は,改行として扱われ~MUST。 ◎ User agents should present this hint to the user when the element's value is the empty string and the control is not focused (e.g. by displaying it inside a blank unfocused control). All U+000D CARRIAGE RETURN U+000A LINE FEED character pairs (CRLF) in the hint, as well as all other U+000D CARRIAGE RETURN (CR) and U+000A LINE FEED (LF) characters in the hint, must be treated as line breaks when rendering the hint.

`textarea$e 要素の: ◎ ↓

%textarea . ``type$m
文字列 `textarea^l を返す。 ◎ Returns the string "textarea".
%textarea . ``value$m
この要素の現在の値を返す。 ◎ Returns the current value of the element.
設定して値を変更できる。 ◎ Can be set, to change the value.
``placeholder@m
``required@m
``wrap@m
順に, ``placeholder$a, ``required$a, ``wrap$a 内容~属性を`反映-$し~MUST。 ◎ The cols, placeholder, required, rows, and wrap IDL attributes must reflect the respective content attributes of the same name.
``cols@m
``rows@m
`非~zero数に制限され$る下で,順に, ``cols$a, ``cols$a 内容~属性を`反映-$し~MUST。 ◎ The cols and rows attributes are limited to only non-negative numbers greater than zero with fallback.\
``cols$m 属性の既定の値は 20 とする。 ◎ The cols IDL attribute's default value is 20.\
``rows$m 属性の既定の値は 2 とする。 ◎ The rows IDL attribute's default value is 2.\
``dirName@m
`dirname$a 内容~属性を`反映-$し~MUST。 ◎ The dirName IDL attribute must reflect the dirname content attribute.\
``maxLength@m
``minLength@m
`非負~数のみに制限され$る下で,順に, ``maxlength$a, ``minlength$a 内容~属性を`反映-$し~MUST。 ◎ The maxLength IDL attribute must reflect the maxlength content attribute, limited to only non-negative numbers.\ The minLength IDL attribute must reflect the minlength content attribute, limited to only non-negative numbers.\
``readOnly@m
``readonly$a 内容~属性を`反映-$し~MUST。 ◎ The readOnly IDL attribute must reflect the readonly content attribute.
``type@m
取得子は、文字列 `textarea^l を返さ~MUST。 ◎ The type IDL attribute must return the value "textarea".
``defaultValue@m
取得子は、此れの`子~text内容$を返さ~MUST。 ◎ The defaultValue IDL attribute must, on getting, return the element's child text content.
設定子は、此れの `textContent$m ~IDL属性の設定子と同じに動作し~MUST。 ◎ On setting, it must act as the setter for the element's textContent IDL attribute.
``value@m
取得子は、此れの`~API値$を返さ~MUST ◎ The value IDL attribute must, on getting, return the element's API value.

設定子は、次を走らせ~MUST: ◎ On setting, it must perform the following steps:

  1. %旧~API値 ~LET 此れの`~API値$ ◎ Let oldAPIValue be this element's API value.
  2. 此れの``生の値$ ~SET 所与の値 ◎ Set this element's raw value to the new value.
  3. 此れの`~dirty値~flag$ ~SET ~T ◎ Set this element's dirty value flag to true.
  4. ~IF[ 此れの`~API値$ ~NEQ %旧~API値 ]:

    1. `~text手入力~cursor位置$を終端へ移動する
    2. 選択されている~textは未~選択-にする
    3. 此れの`選択~方向を設定する$( `none^l )
    ◎ If the new API value is different from oldAPIValue, then move the text entry cursor position to the end of the text control, unselecting any selected text and resetting the selection direction to "none".
``textLength@m
取得子は、此れの`~API値$の`~JS文字列~長さ$を返さ~MUST。 ◎ The textLength IDL attribute must return the JavaScript string length of the element's API value.

`textarea$e 要素の各種~IDL~member: ◎ ↓

`textarea$e を利用して,~form内に制約されない自由形の~text入力を与える例: ◎ Here is an example of a textarea being used for unrestricted free-form text input in a form:

`textarea-2^xCode

``maxlength$a 属性を利用すれば、~commentの最大~長さを指定できる: ◎ To specify a maximum length for the comments, one can use the maxlength attribute:

`textarea-3^xCode

既定の値を与えるには、要素の内側に~textを含する: ◎ To give a default value, text can be included inside the element:

`textarea-4^xCode

最小の長さも与えれる。 ここでの手紙には,(最小の長さより短い)雛形が供されているが、~formを提出するには不十分であり,利用者はもっと埋める必要がある: ◎ You can also give a minimum length. Here, a letter needs to be filled out by the user; a template (which is shorter than the minimum length) is provided, but is insufficient to submit the form:

`textarea-5^xCode

明示的な雛形を供せずとも、利用者に基本形を示唆する仮入力を与えれる: ◎ A placeholder can be given as well, to suggest the basic form to the user, without providing an explicit template:

`textarea-6^xCode

`dirname$a 属性を指定すれば、要素の`方向性$も値に伴わせるように,~browserに提出させられる: ◎ To have the browser submit the directionality of the element along with the value, the dirname attribute can be specified:

`textarea-7^xCode

4.10.12. ``output^e 要素

`分類$
`~flow内容$ / `句内容$ / `可触~内容$ / ◎ Flow content. ◎ Phrasing content. ◎ Listed, labelable, resettable, and autocapitalize-inheriting form-associated element. ◎ Palpable content.
`~formに所有され得る要素$のうち[ `~listされ$る / `~label可能$な / `再設定-可能$な / `自動頭字化-を継承-$する ]もの。 ◎ ↑
`この要素を利用できる文脈$
`句内容$が期待される所。 ◎ Where phrasing content is expected.
`内容~model$
`句内容$。 ◎ Phrasing content.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
``for$a — この出力を計算させた~controlを指定する。 ◎ for — Specifies controls from which the output was calculated
`form$a — この~controlの所有者にする `form$e 要素を与える。 ◎ form — Associates the control with a form element
`name$a — `form.elements$m ~APIに利用する~form~controlの名前 ◎ name — Name of form control to use in the form.elements API
`~DOM~interface$
[Exposed=Window,
 `HTMLConstructor$I]
interface `HTMLOutputElement@I : `HTMLElement$I {
  [SameObject, PutForwards=`value$m] readonly attribute `DOMTokenList$I ``htmlFor$m;
  readonly attribute `HTMLFormElement$I? `form$m;
  [`CEReactions$] attribute DOMString `name$m;

  readonly attribute DOMString ``type$m;
  [`CEReactions$] attribute DOMString ``defaultValue$m;
  [`CEReactions$] attribute DOMString ``value$m;

  readonly attribute boolean `willValidate$m;
  readonly attribute `ValidityState$I `validity$m;
  readonly attribute DOMString `validationMessage$m;
  boolean `checkValidity$m();
  boolean `reportValidity$m();
  void `setCustomValidity$m(DOMString %error);

  readonly attribute `NodeList$I `labels$m;
};

`output$e 要素は、[ ~appにより遂行された計算の結果 / 利用者~動作の結果 ]を`表現-$する。 ◎ The output element represents the result of a calculation performed by the application, or the result of a user action.

注記: この要素は、 `samp$e 要素と対照をなす — それは、以前に走らせた他の~programの出力を引用するときに,適切な要素になる。 ◎ This element can be contrasted with the samp element, which is the appropriate element for quoting the output of other programs run previously.

``for@a 内容~属性は、計算の結果と, [ 計算に[ 取り込まれた/波及した ]値を表現する要素 ]との間に,明示的な関係性を与えれるようにする。 この属性に指定する値は、`空白区切りの一意な~tokenからなる無順序~集合$であって,その各~tokenは 同じ`木$内のある要素の`~ID$の値と合致して~MUST。 ◎ The for content attribute allows an explicit relationship to be made between the result of a calculation and the elements that represent the values that went into the calculation or that otherwise influenced the calculation. The for attribute, if specified, must contain a string consisting of an unordered set of unique space-separated tokens that are case-sensitive, each of which must have the value of an ID of an element in the same tree.

`output$e 要素の: ◎ ↓

各 `output$e 要素には、~form~controlの~event~handlerから容易に`参照-$できるように,~formが結付けられるが、この要素の値が,~formの提出-時に提出されることはない。 ◎ The output element is associated with a form so that it can be easily referenced from the event handlers of form controls; the element's value itself is not submitted when the form is submitted.

各 `output$e 要素は、次のものを持つ:

``既定~値@
初期~時には 空~文字列にされ~MUST。
``値~mode~flag@

次のいずれかをとり得る:

``既定@i
初期~時にはこの~modeに設定され~MUST。
この~modeの下では、要素の内容は,要素の[ 値, ``既定~値$ ]の両者を表現する。
この~modeの下で,要素の子孫が何らかの仕方で変化したときは、要素の``既定~値$は 要素の `textContent$m ~IDL属性の値に設定され~MUST。
``値@i
この~modeの下では、要素の内容は,要素の値のみを表現する — ``既定~値$は、要素の ``defaultValue$m ~IDL属性を利用してのみ~accessし得る。
◎ The element has a value mode flag which is either value or default. Initially, the value mode flag must be set to default. ◎ The element also has a default value. Initially, the default value must be the empty string. ◎ When the value mode flag is in mode default, the contents of the element represent both the value of the element and its default value. When the value mode flag is in mode value, the contents of the element represent the value of the element only, and the default value is only accessible using the defaultValue IDL attribute. ◎ Whenever the element's descendants are changed in any way, if the value mode flag is in mode default, the element's default value must be set to the value of the element's textContent IDL attribute.

`output$e 要素~用の`再設定~algo$は、次を走らす:

  1. 要素の``値~mode~flag$ ~SET ``既定$i
  2. 要素の `textContent$m ~IDL属性 ~SET 要素の``既定~値$ (したがって、要素の子~nodeは置換される。)
◎ The reset algorithm for output elements is to set the element's value mode flag to default and then to set the element's textContent IDL attribute to the value of the element's default value (thus replacing the element's child nodes).
%output . ``value$m [ = %value ]
この要素の現在の値を返す。 ◎ Returns the element's current value.
設定して,値を変更できる。 ◎ Can be set, to change the value.
%output . ``defaultValue$m [ = %value ]
この要素の現在の既定の値を返す。 ◎ Returns the element's current default value.
設定して,既定の値を変更できる。 ◎ Can be set, to change the default value.
%output . ``type$m
文字列 `output^l を返す。 ◎ Returns the string "output".
``value@m
[ 取得子/設定子 ]は、此れの `textContent$m ~IDL属性と同じに動作し~MUST。 加えて,設定子は、その前(子~nodeたちが変更される前)に[ 此れの``値~mode~flag$ ~SET ``値$i ]とし~MUST。 ◎ The value IDL attribute must act like the element's textContent IDL attribute, except that on setting, in addition, before the child nodes are changed, the element's value mode flag must be set to value.
``defaultValue@m
取得子は、此れの``既定~値$を返さ~MUST。 ◎ The defaultValue IDL attribute, on getting, must return the element's default value.\

設定子は、次を走らせ~MUST:

  1. 此れの``既定~値$ ~SET 所与の値
  2. ~IF[ 此れの``値~mode~flag$ ~EQ ``既定$i ] ⇒ 此れの`textContent$m ~IDL属性 ~SET 所与の値
◎ On setting, the attribute must set the element's default value, and, if the element's value mode flag is in the mode default, set the element's textContent IDL attribute as well.
``type@m
取得子は、文字列 `output^l を返さ~MUST。 ◎ The type attribute must return the string "output".
``htmlFor@m
``for$a 内容~属性を`反映-$し~MUST。 ◎ The htmlFor IDL attribute must reflect the for content attribute.

`output$e 要素の各種~IDL~member: ◎ ↓

`output$e を利用して,単純な計算機の計算-結果を表示する例: ◎ A simple calculator could use output for its display of calculated results:

`output-1^xCode

次の例では,ある計算が遠隔~serverにより遂行され、 `output$e 要素を利用して,返されて来た結果を報告する: ◎ In this example, an output element is used to report the results of a calculation performed by a remote server, as they come in:

<output id="result"></output>
<script>
 var %primeSource = new WebSocket('ws://primes.example.net/');
 %primeSource.onmessage = function (%event) {
   document.getElementById('result').value = %event.data;
 }
</script>

4.10.13. ``progress^e 要素

`分類$
`~flow内容$ / `句内容$ / `可触~内容$ / `~label可能$な要素 ◎ Flow content. ◎ Phrasing content. ◎ Labelable element. ◎ Palpable content.
`この要素を利用できる文脈$
`句内容$が期待される所。 ◎ Where phrasing content is expected.
`内容~model$
`句内容$ — ただし、子孫に `progress$e 要素が在ってはならない。 ◎ Phrasing content, but there must be no progress element descendants.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
``value$a — 要素の現在の値 ◎ value — Current value of the element
``max$a — 範囲の上界 ◎ max — Upper bound of range
`~DOM~interface$
[Exposed=Window,
 `HTMLConstructor$I]
interface `HTMLProgressElement@I : `HTMLElement$I {
  [`CEReactions$] attribute double ``value$m;
  [`CEReactions$] attribute double ``max$m;
  readonly attribute double ``position$m;
  readonly attribute `NodeList$I `labels$m;
};

`progress$e 要素は、~taskの完了~進捗を`表現-$する。 進捗は、[ `不定^i, `確定的^i ]のいずれかになる。 前者は、進捗は ~taskが完了するまで どの程度~仕事が残っているか明らかでないことを指示する(例:~taskは遠隔~hostからの応答を待機しているなど)。 後者は、それまでに完了した仕事の進捗~率を { 0 〜 ある最大 } の範囲に入る数として与える。 ◎ The progress element represents the completion progress of a task. The progress is either indeterminate, indicating that progress is being made but that it is not clear how much more work remains to be done before the task is complete (e.g. because the task is waiting for a remote host to respond), or the progress is a number in the range zero to a maximum, giving the fraction of work that has so far been completed.

要素により表現される現在の~task完了を決定する 2 個の属性がある: ◎ There are two attributes that determine the current task completion represented by the element.\

注記: 進捗~barを `確定的^i にするためには、 ``value$a 属性に現在の進捗( 0.0 〜 ``最大~値$ に入る数)を伴わせて追加する。 進捗~barを `不定^i にするためには、 ``value$a 属性を除去する。 ◎ To make a determinate progress bar, add a value attribute with the current progress (either a number from 0.0 to 1.0, or, if the max attribute is specified, a number from 0 to the value of the max attribute). To make an indeterminate progress bar, remove the value attribute.

作者には、進捗が旧来の~UAの利用者からも可用になるように,要素の内側に 現在の値と最大~値を~textとして~inlineに含ませることも奨励される。 ◎ Authors are encouraged to also include the current value and the maximum value inline as text inside the element, so that the progress is made available to users of legacy user agents.

ある自動化~taskの進捗を示す~Web~appの例: ◎ Here is a snippet of a Web application that shows the progress of some automated task:

<section>
 <h2>Task Progress</h2>
 <p>Progress: <progress id="p" max=100><span>0</span>%</progress></p>
 <script>
  var %progressBar = document.getElementById('p');
  function updateProgress(%newValue) {
    progressBar.value = %newValue;
    progressBar.getElementsByTagName('span')[0].textContent = %newValue;
  }
 </script>
</section>

(この例の `updateProgress()^m ~methodは、実際の進捗~barを更新するためにあり、~taskが進捗するに伴い,頁~上の他の~codeから~callされることになる。) ◎ (The updateProgress() method in this example would be called by some other code on the page to update the actual progress bar as the task progressed.)

[ ``value$a / ``max$a ]属性に指定する値は、`妥当な浮動小数点数$で~MUST。 加えて、 %V, %M を次で与える値とするとき[ 0 ~LTE %V ~LTE %M ]~AND[ 0 ~LT %M ]を満たさ~MUST:

  • %V は、要素が ``value$a 属性を有するならば それが表現する実数 / ~ELSE_ 0
  • %M は、要素が ``max$a 属性を有するならば それが表現する実数 / ~ELSE_ 1.0
◎ The value and max attributes, when present, must have values that are valid floating-point numbers. The value attribute, if present, must have a value equal to or greater than zero, and less than or equal to the value of the max attribute, if present, or 1.0, otherwise. The max attribute, if present, must have a value greater than zero.

注記: `progress$e 要素を、~task進捗でない,単なる計器などの何かに利用するのは間違いである。 具体例として、 `progress$e を利用して~disk消費量を指示するのは適切でない。 その種の事例には、 `meter$e 要素が用意されている。 ◎ The progress element is the wrong element to use for something that is just a gauge, as opposed to task progress. For instance, indicating disk space usage using progress would be inappropriate. Instead, the meter element is available for such use cases.

~UA要件 ⇒ 進捗~barは、[ ``value$a 属性が省略されたならば `不定^i / ~ELSE_ `確定的^i ]にする。 ◎ User agent requirements: If the value attribute is omitted, then the progress bar is an indeterminate progress bar. Otherwise, it is a determinate progress bar.

進捗~barが `確定的^i ならば、~UAは,その[ ``最大~値$, ``値$ ]を次に従って得~MUST: ◎ ↓

``最大~値@
  1. ~IF[ 要素は ``max$a 属性を有さない ] ⇒ ~RET 1.0
  2. %最大 ~LET ``max$a 属性を`浮動小数点数として構文解析-$した結果
  3. ~IF[ %最大 ~EQ ~error ] ⇒ ~RET 1.0
  4. ~IF[ %最大 ~LTE 0 ] ⇒ ~RET 1.0
  5. ~RET %最大
◎ If the progress bar is a determinate progress bar and the element has a max attribute, the user agent must parse the max attribute's value according to the rules for parsing floating-point number values. If this does not result in an error, and if the parsed value is greater than zero, then the maximum value of the progress bar is that value. Otherwise, if the element has no max attribute, or if it has one but parsing it resulted in an error, or if the parsed value was less than or equal to zero, then the maximum value of the progress bar is 1.0.
``値@
  1. %値 ~LET ``value$a 属性を`浮動小数点数として構文解析-$した結果
  2. ~IF[ %値 ~NEQ ~error ]~AND[ %値 ~GT 0 ] ⇒ ~RET %値
  3. ~RET 0
◎ If the progress bar is a determinate progress bar, user agents must parse the value attribute's value according to the rules for parsing floating-point number values. If this does not result in an error and the parsed value is greater than zero, then the value of the progress bar is that parsed value. Otherwise, if parsing the value attribute's value resulted in an error or a number less than or equal to zero, then the value of the progress bar is zero.

進捗~barが `確定的^i ならば、その ``現在の値@ は,[[ ``値$ ~LTE ``最大~値$ ]ならば``値$ / ~ELSE_ ``最大~値$ ]とする。 ◎ If the progress bar is a determinate progress bar, then the current value is the maximum value, if value is greater than the maximum value, and value otherwise.

進捗~barを示すときの~UA要件 ⇒ `progress$e 要素を利用者に表現するときは、~UAは,次を指示するべきである:

  • `確定的^i, `不定^i のいずれであるか
  • `確定的^i の場合は、``最大~値$に相対的な``現在の値$の位置
◎ UA requirements for showing the progress bar: When representing a progress element to the user, the UA should indicate whether it is a determinate or indeterminate progress bar, and in the former case, should indicate the relative position of the current value relative to the maximum value.
%progress . ``position$m
`確定的^i な進捗~bar(現在の最大~値が既知であるもの)に対しては[ 現在の値 ÷ 最大~値 ]を返す。 ◎ For a determinate progress bar (one with known current and maximum values), returns the result of dividing the current value by the maximum value.
`不定^i な進捗~barに対しては −1 を返す。 ◎ For an indeterminate progress bar, returns −1.
``position@m
[ 此れが `不定^i な進捗~barならば −1 / ~ELSE_[ 此れの``現在の値$ ÷ 此れの``最大~値$ ]]を返さ~MUST。 ◎ If the progress bar is an indeterminate progress bar, then the position IDL attribute must return −1. Otherwise, it must return the result of dividing the current value by the maximum value.
``value@m
取得子は、[ 此れが `不定^i な進捗~barならば 0 / ~ELSE_ ``現在の値$ ]を返さ~MUST。 ◎ If the progress bar is an indeterminate progress bar, then the value IDL attribute, on getting, must return 0. Otherwise, it must return the current value.\
設定子は、此れの ``value$m 内容~属性を[ 所与の値を`浮動小数点数として最良の表現$に変換した結果 ]に設定し~MUST。 ◎ On setting, the given value must be converted to the best representation of the number as a floating-point number and then the value content attribute must be set to that string.
注記: 対応する内容~属性が不在のときに ``value$m ~IDL属性を自身に設定すると、進捗~barは `不定^i から 進捗なしの `確定的^i に変化することになる。 ◎ Setting the value IDL attribute to itself when the corresponding content attribute is absent would change the progress bar from an indeterminate progress bar to a determinate progress bar with no progress.
``max@m
`正数に制限され$る下で, ``max$a 内容~属性を`反映-$し~MUST。 ◎ The max IDL attribute must reflect the content attribute of the same name, limited to numbers greater than zero.\
``max$m 用の既定の値は 1.0 とする。 ◎ The default value for max is 1.0.

`progress$e 要素の `labels$m ~IDL属性は、要素を指している `label$e からなる~listを供する。 ◎ The labels IDL attribute provides a list of the element's labels.

4.10.14. ``meter^e 要素

`分類$
`~flow内容$ / `句内容$ / `可触~内容$ / `~label可能$な要素 ◎ Flow content. ◎ Phrasing content. ◎ Labelable element. ◎ Palpable content.
`この要素を利用できる文脈$
`句内容$が期待される所。 ◎ Where phrasing content is expected.
`内容~model$
`句内容$ — ただし、子孫に `meter$e 要素が在ってはならない。 ◎ Phrasing content, but there must be no meter element descendants.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
``value$a — 要素の現在の値 ◎ value — Current value of the element
``min$a — 範囲の下界 ◎ min — Lower bound of range
``max$a — 範囲の上界 ◎ max — Upper bound of range
``low$a — 低域の上限 ◎ low — High limit of low range
``high$a — 高域の下限 ◎ high — Low limit of high range
``optimum$a — 計器における最適~値 ◎ optimum — Optimum value in gauge
`~DOM~interface$
[Exposed=Window,
 `HTMLConstructor$I]
interface `HTMLMeterElement@I : `HTMLElement$I {
  [`CEReactions$] attribute double ``value$m;
  [`CEReactions$] attribute double ``min$m;
  [`CEReactions$] attribute double ``max$m;
  [`CEReactions$] attribute double ``low$m;
  [`CEReactions$] attribute double ``high$m;
  [`CEReactions$] attribute double ``optimum$m;
  readonly attribute `NodeList$I `labels$m;
};

`meter$e 要素は、ある有界な範囲における一次元の計測~値や割合~値を`表現-$する。 例えば: ~disk消費量 / ~query結果の関連度 / 特定候補に対する投票割合 ◎ The meter element represents a scalar measurement within a known range, or a fractional value; for example disk usage, the relevance of a query result, or the fraction of a voting population to have selected a particular candidate.

これは、計器( `gauge^en )とも呼ばれる。 ◎ This is also known as a gauge.

`meter$e 要素は、(進捗~barのような)進捗を指示するために利用されるべきでない。 その役割には、 `progress$e 要素が別途~用意されている。 ◎ The meter element should not be used to indicate progress (as in a progress bar). For that role, HTML provides a separate progress element.

注記: `meter$e 要素は、有界でない範囲の一次元の値は表現しない — 既知の最大~値がない限り、例えばこれを,体重や身長を報告するために利用するのは間違いである。 ◎ The meter element also does not represent a scalar value of arbitrary range — for example, it would be wrong to use this to report a weight, or height, unless there is a known maximum value.

要素により表現される計器の意味論を決定する 6 個の属性がある: ◎ There are six attributes that determine the semantics of the gauge represented by the element.

  • [ ``min@a / ``max@a ]属性は、範囲の[ 下界 / 上界 ]を指定する。
  • ``value@a 属性は、計器の “計測された値” を指示する値を指定する。
◎ The min attribute specifies the lower bound of the range, and the max attribute specifies the upper bound. The value attribute specifies the value to have the gauge indicate as the "measured" value.

他の 3 個の属性は、計器の範囲を[ “低域”, “中域”, “高域” ]に区分し,計器のどの域が “最適な域” になるかを指示するために利用できる: ◎ The other three attributes can be used to segment the gauge's range into "low", "medium", and "high" parts, and to indicate which part of the gauge is the "optimum" part.\

著作~要件 ⇒ ``value$a 属性は、指定され~MUST。 [ ``value$a / ``min$a / ``low$a / ``high$a / ``max$a / ``optimum$a ]属性に指定する値は、`妥当な浮動小数点数$で~MUST。 ◎ Authoring requirements: The value attribute must be specified. The value, min, low, high, max, and optimum attributes, when present, must have values that are valid floating-point numbers.

加えて、これらの属性の値は,更に拘束される: ◎ In addition, the attributes' values are further constrained:

注記: 最小も最大も指定されない場合の範囲は, { 0 〜 1 } と見做されるので、値は その範囲に入る必要がある。 ◎ If no minimum or maximum is specified, then the range is assumed to be 0..1, and the value thus has to be within that range.

作者には、 `meter$e 要素を~supportしない~UAの利用者のために,要素の内容に計器の状態の~textによる表現を含ませることが奨励される。 ◎ Authors are encouraged to include a textual representation of the gauge's state in the element's contents, for users of user agents that do not support the meter element.

`~microdata$と併用されるとき `meter$e 要素の ``value$a 属性は,要素の機械読取可能な値を供する。 ◎ When used with microdata, the meter element's value attribute provides the element's machine-readable value.

次の例に 3 個の計器を示す — いずれも割合として 75% を指している: ◎ The following examples show three gauges that would all be three-quarters full:

`meter-1^xCode

要素の不正な利用~例 — それは範囲を与えてないので(加えて,既定の最大は 1 になるので、両~計器とも最大に振り切れた見かけになる): ◎ The following example is incorrect use of the element, because it doesn't give a range (and since the default maximum is 1, both of the gauges would end up looking maxed out):

`meter-2^xCode

代わりに、 `meter^e 要素を含ませないか,または 範囲を定義した `meter^e 要素を利用して,他のパイと比較される文脈における寸法を与える: ◎ Instead, one would either not include the meter element, or use the meter element with a defined range to give the dimensions in context compared to other pies:

`meter-3^xCode

`meter$e 要素に明示的に単位を指定する仕方は無いが、単位は `title$a 属性~内に自由形の~textとして指定されて~MAY。 ◎ There is no explicit way to specify units in the meter element, but the units may be specified in the title attribute in free-form text.

上~例は、次のように拡張して,単位を示すこともできる: ◎ The example above could be extended to mention the units:

`meter-4^xCode

~UA要件 ⇒ ~UAは、[ ``min$a / ``max$a / ``value$a / ``low$a / ``high$a / ``optimum$a ]属性を`浮動小数点数として構文解析-$し~MUST。 ◎ User agent requirements: User agents must parse the min, max, value, low, high, and optimum attributes using the rules for parsing floating-point number values.

~UAは、これらすべての実数を利用して,次に従って,計器~上の 6 点pを与える値を得~MUST(評価される順序は重要になる — 一部の値は、先に得られた結果に基づくので): ◎ User agents must then use all these numbers to obtain values for six points on the gauge, as follows. (The order in which these are evaluated is important, as some of the values refer to earlier ones.)

  1. 以下においては:

    • N( %属性, %既定~値 ) という表記は、[ 要素が %属性 を有していて その値を`浮動小数点数として構文解析-$した結果 ~NEQ ~error ならば その結果 / ~ELSE_ %既定~値 ]とする。
    • MIN(…), MAX(…) は、順に,所与の引数たちの最小, 最大をとる関数とする。
    ◎ ↓
  2. ``最小~値@ は、次で与えられる ⇒ N( ``min$a, 0 ) ◎ The minimum value ◎ If the min attribute is specified and a value could be parsed out of it, then the minimum value is that value. Otherwise, the minimum value is zero.
  3. ``最大~値@ は、次で与えられる ⇒ MAX ( ``最小~値$, N( ``max$a, 1.0 ) ) ◎ The maximum value ◎ If the max attribute is specified and a value could be parsed out of it, then the candidate maximum value is that value. Otherwise, the candidate maximum value is 1.0. ◎ If the candidate maximum value is greater than or equal to the minimum value, then the maximum value is the candidate maximum value. Otherwise, the maximum value is the same as the minimum value.
  4. ``実際の値@ は、次で与えられる ⇒ MIN( MAX( ``最小~値$, N( ``value$a, 0 ) ), ``最大~値$ ) ◎ The actual value ◎ If the value attribute is specified and a value could be parsed out of it, then that value is the candidate actual value. Otherwise, the candidate actual value is zero. ◎ If the candidate actual value is less than the minimum value, then the actual value is the minimum value. ◎ Otherwise, if the candidate actual value is greater than the maximum value, then the actual value is the maximum value. ◎ Otherwise, the actual value is the candidate actual value.
  5. ``下界@ は、次で与えられる ⇒ MIN( MAX( ``最小~値$, N( ``low$a, ``最小~値$ ) ), ``最大~値$ ) ◎ The low boundary ◎ If the low attribute is specified and a value could be parsed out of it, then the candidate low boundary is that value. Otherwise, the candidate low boundary is the same as the minimum value. ◎ If the candidate low boundary is less than the minimum value, then the low boundary is the minimum value. ◎ Otherwise, if the candidate low boundary is greater than the maximum value, then the low boundary is the maximum value. ◎ Otherwise, the low boundary is the candidate low boundary.
  6. ``上界@ は、次で与えられる ⇒ MIN( MAX( ``下界$, N( ``value$a, ``最大~値$ ) ), ``最大~値$ ) ◎ The high boundary ◎ If the high attribute is specified and a value could be parsed out of it, then the candidate high boundary is that value. Otherwise, the candidate high boundary is the same as the maximum value. ◎ If the candidate high boundary is less than the low boundary, then the high boundary is the low boundary. ◎ Otherwise, if the candidate high boundary is greater than the maximum value, then the high boundary is the maximum value. ◎ Otherwise, the high boundary is the candidate high boundary.
  7. ``最適~点p@ は、次で与えられる ⇒ MIN( MAX( ``最小~値$, %N ) ), ``最大~値$ ) — ここで ⇒ %N ~EQ N( ``optimum$a, ( ( ``最小~値$ + ``最大~値$ ) ÷ 2 ) ) ◎ The optimum point ◎ If the optimum attribute is specified and a value could be parsed out of it, then the candidate optimum point is that value. Otherwise, the candidate optimum point is the midpoint between the minimum value and the maximum value. ◎ If the candidate optimum point is less than the minimum value, then the optimum point is the minimum value. ◎ Otherwise, if the candidate optimum point is greater than the maximum value, then the optimum point is the maximum value. ◎ Otherwise, the optimum point is the candidate optimum point.

これらすべての結果は、次の不等式を満たす: ◎ All of which will result in the following inequalities all being true:

計器の各~域に対する~UA要件: ◎ UA requirements for regions of the gauge:\

計器を示すときの~UA要件 ⇒ `meter$e 要素を利用者~向けに表現するときは、~UAは,[ 最小/最大 ]値から相対的な実際の値の位置, および 実際の値と計器の 3 域との関係性を指示するべきである。 ◎ UA requirements for showing the gauge: When representing a meter element to the user, the UA should indicate the relative position of the actual value to the minimum and maximum values, and the relationship between the actual value and the three regions of the gauge.

次の~markupは…: ◎ The following markup:

<h3>Suggested groups</h3>
<menu>
 <li><a href="?cmd=hsg" onclick="hideSuggestedGroups()">Hide suggested groups</a></li>
</menu>
<ul>
 <li>
  <p><a href="/group/comp.infosystems.www.authoring.stylesheets/view">comp.infosystems.www.authoring.stylesheets</a> -
     <a href="/group/comp.infosystems.www.authoring.stylesheets/subscribe">join</a></p>
  <p>Group description: <strong>Layout/presentation on the WWW.</strong></p>
  <p><meter value="0.5">Moderate activity,</meter> Usenet, 618 subscribers</p>
 </li>
 <li>
  <p><a href="/group/netscape.public.mozilla.xpinstall/view">netscape.public.mozilla.xpinstall</a> -
     <a href="/group/netscape.public.mozilla.xpinstall/subscribe">join</a></p>
  <p>Group description: <strong>Mozilla XPInstall discussion.</strong></p>
  <p><meter value="0.25">Low activity,</meter> Usenet, 22 subscribers</p>
 </li>
 <li>
  <p><a href="/group/mozilla.dev.general/view">mozilla.dev.general</a> -
     <a href="/group/mozilla.dev.general/subscribe">join</a></p>
  <p><meter value="0.25">Low activity,</meter> Usenet, 66 subscribers</p>
 </li>
</ul>

…次のように描画されるであろう: ◎ Might be rendered as follows:

種々の長さの緑色~barで~inlineに描画される `meter$e 要素 ◎ With the <meter> elements rendered as inline green bars of varying lengths.

~UAは、 `title$a 属性や他の属性の値を組合せて,文脈に応じた~helpや実際の値の詳細を~~述べる~textを~inlineに供して~MAY。 ◎ User agents may combine the value of the title attribute and the other attributes to provide context-sensitive help or inline text detailing the actual values.

例えば、次の~code片に対しては…: ◎ For example, the following snippet:

`meter-6^xCode

… ~UAは、表示する計器に次のような 2 行の~tooltipを伴わせ得る ⇒# “値は 23.2 です(範囲 0 〜 60 )。” “秒数” ◎ ...might cause the user agent to display a gauge with a tooltip saying "Value: 23.2 out of 60." on one line and "seconds" on a second line.

``value@m
取得子は、此れの``実際の値$を返さ~MUST。 ◎ The value IDL attribute, on getting, must return the actual value.\
設定子は、此れの ``value$a 内容~属性を[ 所与の値を`浮動小数点数として最良の表現$に変換した結果 ]に設定し~MUST。 ◎ On setting, the given value must be converted to the best representation of the number as a floating-point number and then the value content attribute must be set to that string.
``min@m
取得子は、此れの``最小~値$を返さ~MUST。 ◎ The min IDL attribute, on getting, must return the minimum value.\
設定子は、此れの ``min$a 内容~属性を[ 所与の値を`浮動小数点数として最良の表現$に変換した結果 ]に設定し~MUST。 ◎ On setting, the given value must be converted to the best representation of the number as a floating-point number and then the min content attribute must be set to that string.
``max@m
取得子は、此れの``最大~値$を返さ~MUST。 ◎ The max IDL attribute, on getting, must return the maximum value.\
設定子は、此れの ``max$a 内容~属性を[ 所与の値を`浮動小数点数として最良の表現$に変換した結果 ]に設定し~MUST。 ◎ On setting, the given value must be converted to the best representation of the number as a floating-point number and then the max content attribute must be set to that string.
``low@m
取得子は、此れの``下界$を返さ~MUST。 ◎ The low IDL attribute, on getting, must return the low boundary.\
設定子は、此れの ``low$a 内容~属性を[ 所与の値を`浮動小数点数として最良の表現$に変換した結果 ]に設定し~MUST。 ◎ On setting, the given value must be converted to the best representation of the number as a floating-point number and then the low content attribute must be set to that string.
``high@m
取得子は、此れの``上界$を返さ~MUST。 ◎ The high IDL attribute, on getting, must return the high boundary.\
設定子は、此れの ``high$a 内容~属性を[ 所与の値を`浮動小数点数として最良の表現$に変換した結果 ]に設定し~MUST。 ◎ On setting, the given value must be converted to the best representation of the number as a floating-point number and then the high content attribute must be set to that string.
``optimum@m
取得子は、此れの``最適~点p$を返さ~MUST。 ◎ The optimum IDL attribute, on getting, must return the optimum value.\
設定子は、此れの ``optimum$a 内容~属性を[ 所与の値を`浮動小数点数として最良の表現$に変換した結果 ]に設定し~MUST。 ◎ On setting, the given value must be converted to the best representation of the number as a floating-point number and then the optimum content attribute must be set to that string.

`meter$e 要素の `labels$m ~IDL属性は、要素を指している `label$e からなる~listを供する。 ◎ The labels IDL attribute provides a list of the element's labels.

計器を[ 地域化された/平文による ]~textに~fall-backできるようにもする例: ◎ The following example shows how a gauge could fall back to localized or pretty-printed text.

`meter-7^xCode

4.10.15. ``fieldset^e 要素

`分類$
`~flow内容$ / `~sectioning根$ / `可触~内容$ / ◎ Flow content. ◎ Sectioning root. ◎ Listed and autocapitalize-inheriting form-associated element. ◎ Palpable content.
`~formに所有され得る要素$のうち[ `~listされ$る / `自動頭字化-を継承-$する ]もの。 ◎ ↑
`この要素を利用できる文脈$
`~flow内容$が期待される所。 ◎ Where flow content is expected.
`内容~model$
[[ 0 〜 1 個の `legend$e 要素 ], `~flow内容$ ]の並び。 ◎ Optionally a legend element, followed by flow content.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
``disabled$a — この~form~controlは不能化されるかどうか。 ◎ disabled — Whether the form control is disabled
`form$a — この~controlの所有者にする `form$e 要素を与える。 ◎ form — Associates the control with a form element
`name$a — `form.elements$m ~APIに利用する~form~controlの名前。 ◎ name — Name of form control to use in the form.elements API
`~DOM~interface$
[Exposed=Window,
 `HTMLConstructor$I]
interface `HTMLFieldSetElement@I : `HTMLElement$I {
  [`CEReactions$] attribute boolean ``disabled$m;
  readonly attribute `HTMLFormElement$I? `form$m;
  [`CEReactions$] attribute DOMString `name$m;

  readonly attribute DOMString ``type$m;

  [SameObject] readonly attribute `HTMLCollection$I ``elements$m;

  readonly attribute boolean `willValidate$m;
  [SameObject] readonly attribute `ValidityState$I `validity$m;
  readonly attribute DOMString `validationMessage$m;
  boolean `checkValidity$m();
  boolean `reportValidity$m();
  void `setCustomValidity$m(DOMString %error);
};

`fieldset$e 要素は、~form~controlの集合を`表現-$する — 任意選択で,~groupに共通の名前も付与できるような。 ◎ The fieldset element represents a set of form controls optionally grouped under a common name.

~groupの名前は[ `fieldset$e 要素の`~legend$ ~NEQ ε ]ならば,それで与えられる。 `~legend$以外の子孫が~groupを形成する。

`fieldset$e 要素の `~legend@ は、要素の子に `legend$e 要素は[ 在るならば それらのうち`木~順序$で最初のもの / 無いならば ε(存在しない) ]とする。

◎ The name of the group is given by the first legend element that is a child of the fieldset element, if any. The remainder of the descendants form the group.

`fieldset$e 要素が ``disabled@a 属性を有する場合、要素の`~legend$を除く,要素~内のすべての~form~controlを`不能化-$する。 ◎ The disabled attribute, when specified, causes all the form control descendants of the fieldset element, excluding those that are descendants of the fieldset element's first legend element child, if any, to be disabled.

`fieldset$e 要素は、次のいずれかを満たすとき ``不能化-@ されているとされる: ◎ A fieldset element is a disabled fieldset if it matches any of the following conditions:

`fieldset$e 要素の: ◎ ↓

%fieldset . ``type$m
文字列 `fieldset^l を返す。 ◎ Returns the string "fieldset".
%fieldset . ``elements$m
この要素~内にある~form~controlからなる `HTMLCollection$I を返す。 ◎ Returns an HTMLCollection of the form controls in the element.
``disabled@m
``disabled$a 内容~属性を`反映-$し~MUST。 ◎ The disabled IDL attribute must reflect the content attribute of the same name.
``type@m
取得子は、文字列 `fieldset^l を返さ~MUST。 ◎ The type IDL attribute must return the string "fieldset".
``elements@m
取得子は、次のようにされた `HTMLCollection$I を返さ~MUST。 ⇒# 根 ~SET 此れ, ~filterは`~listされ$る要素に合致する。 ◎ The elements IDL attribute must return an HTMLCollection rooted at the fieldset element, whose filter matches listed elements.

`fieldset$e 要素の各種~IDL~member: ◎ ↓

`fieldset$e 要素を利用して、関係する一連の~controlを~groupにまとめる例: ◎ This example shows a fieldset element being used to group a set of related controls:

`fieldset-1^xCode

次の~code片に, `fieldset^e の `legend^e 内に[ `fieldset^e が可能化されるかどうかを制御する~checkbox ]を伴わせる例を示す。 `fieldset^e の内容は、[ 2 個の必須の~text~controlと, 省略可能な年月t~control ]からなる。 ◎ The following snippet shows a fieldset with a checkbox in the legend that controls whether or not the fieldset is enabled. The contents of the fieldset consist of two required text controls and an optional year/month control.

`fieldset-2^xCode

`fieldset$e 要素は入子にできる。 前の例を~~拡張してそうする例: ◎ You can also nest fieldset elements. Here is an example expanding on the previous one that does so:

`fieldset-3^xCode

この例では、外縁の "会員カードを利用" ~checkboxは,~checkされておらず、外縁 `fieldset$e の内側にある すべては, 2 個の~radio~button — それぞれは入子の `fieldset$e の `legend^e 内にある — も含め,不能化されることになるが、その~checkboxが~checkされた場合,両~radio~buttonとも可能化され、 2 個の内縁 `fieldset$e のどちらかを可能化させるよう,選択できるようにする。 ◎ In this example, if the outer "Use Club Card" checkbox is not checked, everything inside the outer fieldset, including the two radio buttons in the legends of the two nested fieldsets, will be disabled. However, if the checkbox is checked, then the radio buttons will both be enabled and will let you select which of the two inner fieldsets is to be enabled.

4.10.16. ``legend^e 要素

`分類$
なし。 ◎ None.
`この要素を利用できる文脈$
`fieldset$e 要素の`最初の子$として。 ◎ As the first child of a fieldset element.
`内容~model$
`句内容$。 ◎ Phrasing content.
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
`~DOM~interface$
[Exposed=Window,
 `HTMLConstructor$I]
interface `HTMLLegendElement@I : `HTMLElement$I {
  readonly attribute `HTMLFormElement$I? ``form$m;
};

`legend$e 要素は、その親が `fieldset$e 要素ならば,親の他の内容に対する ~captionを`表現-$する。 ◎ The legend element represents a caption for the rest of the contents of the legend element's parent fieldset element, if any.

%legend . ``form$m
要素が属する `form$e 要素が[ 在るならば それ / 無いならば ~NULL ]を返す。 ◎ Returns the element's form element, if any, or null otherwise.
``form@m
取得子は、[ 此れの親は `fieldset$e 要素であるならば 親の `form$m ~IDL属性と同じ値 / ~ELSE_ ~NULL ]を返さ~MUST。 ◎ The form IDL attribute's behavior depends on whether the legend element is in a fieldset element or not. If the legend has a fieldset element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that fieldset element. Otherwise, it must return null.