3. ~HTML文書の意味論, 構造, ~API

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

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

3.1 文書

~HTML~UAにおける どの[ ~XML/~HTML ]文書も, `Document$I ~obj — 以下,単に`文書$と略記する — により表現される。 `DOM$r ◎ Every XML and HTML document in an HTML UA is represented by a Document object. [DOM]

`文書$ %文書 の `~URL@doc は、~DOM標準 `DOM$r に定義される, %文書 の ~URL である。 それは、 %文書 の作成-時に設定されるが, %文書 が存続する間に変化し得る — 例えば、利用者が頁~上の 素片へ `~navigate$するときや,新たな`~URL$を渡して `pushState()$m ~methodが~callされるときに、変更される。 ◎ The Document object's URL is defined in the WHATWG DOM standard. It is initially set when the Document object is created, but can change during the lifetime of the Document object; for example, it changes when the user navigates to a fragment on the page and when the pushState() method is called with a new URL. [DOM]

対話的~UAは、概して,自身の~UIにて`文書$の`~URL$docを公開する。 これは、~siteが別の何かになりすまそうと試みたとき,そのことが利用者に判るようにする第一の仕組みである。 ◎ Interactive user agents typically expose the Document object's URL in their user interface. This is the primary mechanism by which a user can tell if a site is attempting to impersonate another.

`文書$が`~script$により[ `createDocument()$m / `createHTMLDocument()$m ]~APIを利用して作成されたときは、即時に,`読込後~taskは準備済み$になる, かつ`完全に読込まれる$。 ◎ When a Document is created by a script using the createDocument() or createHTMLDocument() the Document is both ready for post-load tasks and completely loaded immediately.

`文書$の `~referrer@doc とは、( `~URL$を表現する)文字列であり,`文書$の作成-時に設定され得る。 明示的に設定されない場合の値は、空~文字列とする。 ◎ The document's referrer is a string (representing a URL) that can be set when the Document is created. If it is not explicitly set, then its value is the empty string.

各 `文書$は、 `再読込み上書き~flag@ を持つ(初期~時~OFF)。 この~flagは、ある種の状況においては,`文書$の `open(type, replace)$m / `write()$m ~methodにより ~ON にされる。 この~flagが ~ON にされたときは、 `文書$は, `再読込み上書き~buffer@ も持つ — それは、~Unicode文字列であり,文書の再読込み時に~sourceとして利用される。 ◎ Each Document object has a reload override flag that is originally unset. The flag is set by the document.open(type, replace) and document.write() methods in certain situations. When the flag is set, the Document also has a reload override buffer which is a Unicode string that is used as the source of the document when it is reloaded.

~UAは、`~source閲覧文脈$ %S が与えられた下で `上書きされる再読込み@ を遂行するときは、次に従って動作し~MUST: ◎ When the user agent is to perform an overridden reload, given a source browsing context, it must act as follows:

  1. %文書 ~LET %S にて`作動中の文書$ ◎ ↓
  2. %~source ~LET %文書 の`再読込み上書き~buffer$の値 ◎ Let source be the value of the browsing context's active document's reload override buffer.
  3. %~address ~LET %文書 の`~URL$doc ◎ Let address be the browsing context's active document's URL.
  4. %~HTTPS状態 ~LET %文書 の`~HTTPS状態$doc ◎ Let HTTPS state be the HTTPS state of the browsing context's active document.
  5. %~referrer施策 ~LET %文書 の`~referrer施策$doc ◎ Let referrer policy be the referrer policy of the browsing context's active document.
  6. %~CSP~list ~LET %文書 の`~CSP~list$doc ◎ Let CSP list be the CSP list of the browsing context's active document.
  7. %応答 ~LET 次のようにされた,新たな`応答$

    • `本体$rs ~SET %~source
    • `~header~list$rs ~SET ( `Referrer-Policy$h / %~referrer施策 ) のみからなる~list
    • `~CSP~list$rs ~SET %~CSP~list
    • `~HTTPS状態$rs ~SET %~HTTPS状態
    ◎ ↓
  8. 次を与える下で, %S を %応答 へ`~navigate$する(例外投出あり):

    • `例外~可能化~flag$ ~SET ~ON
    • `置換~可能化~flag$ ~SET ~ON
    • `~source閲覧文脈$ ~SET %S
    ◎ Navigate the browsing context to a new response whose body is source, header list is `Referrer-Policy`/referrer policy, CSP list is CSP list and HTTPS state is HTTPS state, with the exceptions enabled flag set and replacement enabled. The source browsing context is that given to the overridden reload algorithm.\

    この~naviの目的において,新たな`文書$ %新~文書 を作成したときは、次のようにする: ◎ When the navigate algorithm creates a Document object for this purpose,\

    • %新~文書 の`再読込み上書き~flag$ ~SET ~ON ◎ set that Document's reload override flag and \
    • %新~文書 の`再読込み上書き~buffer$ ~SET %~source ◎ set its reload override buffer to source. Rethrow any exceptions.
    • %新~文書 の`~addressを設定する$所では、`上書き~URL$に %~address を利用する ◎ When it comes time to set the document's address in the navigation algorithm, use address as the override URL.

3.1.1. `Document^I ~obj

この仕様は、 WHATWG DOM 標準にて定義される `Document^I ~interfaceを有意に拡張する。 ◎ The WHATWG DOM standard defines a Document interface, which this specification extends significantly.

【 この訳では、ここに定義される `Document$I ~interfaceを実装する~objを単に 文書 とも略記する。 この略記は、この頁に限らず,この仕様の他の頁の和訳でも利用される — この節を指す~linkが付与された “`文書$” は、 `Document$I ~objを表すとする(~HTML/~XML構文で書かれた資源としての文書ではなく)。 】

enum `DocumentReadyState@I { "loading", "interactive", "complete" };
typedef (`HTMLScriptElement$I or `SVGScriptElement$I) `HTMLOrSVGScriptElement@I;

[OverrideBuiltins]
partial interface `Document@I {
  // 
資源~metadata管理
◎
// resource metadata management

  [PutForwards=`href$m, Unforgeable] readonly attribute `Location$I? `location$m;
  attribute USVString `domain$m;
  readonly attribute USVString `referrer$m;
  attribute USVString `cookie$m;
  readonly attribute DOMString `lastModified$m;
  readonly attribute `DocumentReadyState$I `readyState$m;

  // 
~DOM~木~accessor
◎
// DOM tree accessors

  `getter$m object (DOMString name);
  [`CEReactions$] attribute DOMString `title$m;
  [`CEReactions$] attribute DOMString `dir$m;
  [`CEReactions$] attribute `HTMLElement$I? `body$m;
  readonly attribute `HTMLHeadElement$I? `head$m;
  [SameObject] readonly attribute `HTMLCollection$I `images$m;
  [SameObject] readonly attribute `HTMLCollection$I `embeds$m;
  [SameObject] readonly attribute `HTMLCollection$I `plugins$m;
  [SameObject] readonly attribute `HTMLCollection$I `links$m;
  [SameObject] readonly attribute `HTMLCollection$I `forms$m;
  [SameObject] readonly attribute `HTMLCollection$I `scripts$m;
  NodeList `getElementsByName$m(DOMString %elementName);
  readonly attribute `HTMLOrSVGScriptElement$I? `currentScript$m;  // 
文書~木~内の`~classic~script$のみ
◎
classic scripts in a document tree only


  // 
動的~markup挿入
◎
// dynamic markup insertion

  [`CEReactions$] `Document$I `open$m(optional DOMString %type, optional DOMString %replace = ""); /* 
%type は無視される
◎
type is ignored
 */
  `WindowProxy$I `~openW$m(USVString %url, DOMString %name, DOMString %features);
  [`CEReactions$] void `close$m();
  [`CEReactions$] void `write$m(DOMString... %text);
  [`CEReactions$] void `writeln$m(DOMString... %text);

  // 
利用者~対話

  readonly attribute `WindowProxy$I? `defaultView$m;
  readonly attribute `Element$I? `activeElement$m;
  boolean `hasFocus$m();
  [`CEReactions$] attribute DOMString `designMode$m;
  [`CEReactions$] boolean `execCommand$m(DOMString %commandId, optional boolean %showUI = false, optional DOMString %value = "");
  boolean `queryCommandEnabled$m(DOMString %commandId);
  boolean `queryCommandIndeterm$m(DOMString %commandId);
  boolean `queryCommandState$m(DOMString %commandId);
  boolean `queryCommandSupported$m(DOMString %commandId);
  DOMString `queryCommandValue$m(DOMString %commandId);


  /* 
`文書$のみに適用される特別な`~event~handler~IDL属性$
◎
special event handler IDL attributes that only apply to Document objects
 */
  [LenientThis] attribute `EventHandler$I `onreadystatechange$m;
};
`Document$I includes `GlobalEventHandlers$I;
`Document$I includes `DocumentAndElementEventHandlers$I;

各 `文書$は、次のものを持つ: ◎ ↓

`~HTTPS状態@doc
`~HTTPS状態~値$。 初期~時は `none^l とする。 これは、`文書$の~dataを送達するときに利用される~network~channelの,保安~上の特性を表現する。 ◎ The Document has an HTTPS state (an HTTPS state value), initially "none", which represents the security properties of the network channel used to deliver the Document's data.
`~referrer施策@doc
`~referrer施策$。 初期~時は空~文字列とする。 `文書$から起動される`~fetch$に利用される,既定の`~referrer施策$を表現する。 ◎ The Document has a referrer policy (a referrer policy), initially the empty string, which represents the default referrer policy used by fetches initiated by the Document.
`~CSP~list@doc
この文書~用に作動中のすべての`~CSP~obj$を包含している`~CSP~list$。 他から指定されない限り、空とする。 ◎ The Document has a CSP list, which is a CSP list containing all of the Content Security Policy objects active for the document. The list is empty unless otherwise specified.
`特色機能~施策@doc
`特色機能~施策$。 初期~時は空とする。 ◎ The Document has a feature policy, which is a feature policy, which is initially empty.
`~module~map@doc
`~module~map$。 初期~時は空とする。 ◎ The Document has a module map, which is a module map, initially empty.

3.1.2. 資源~metadataの管理

%document . `referrer$m
利用者がこの文書へ~navigateした元の`文書$の`~URL$docを返す。 ~navigateが阻止されていたときや,そのような文書がなければ空~文字列を返す。 ◎ Returns the URL of the Document from which the user navigated to this one, unless it was blocked or there was no such document, in which case it returns the empty string.
~referrerを阻止したければ `noreferrer$v ~link型を利用できる。 ◎ The noreferrer link type can be used to block the referrer.
`referrer@m
取得子は、文書の`~referrer$docを返さ~MUST ◎ The referrer attribute must return the document's referrer.

%document . `cookie$m [ = %value ]
`文書$に適用されている一連の~HTTP~cookieを返す。 ~cookieが無い, もしくはこの資源に適用できない場合、空~文字列が返される。 ◎ Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned.
設定して,要素の~HTTP~cookieの集合に新たな~cookieを追加できる。 ◎ Can be set, to add a new cookie to the element's set of HTTP cookies.
内容が`一意~生成元に~sandbox化され$ている場合(例: `sandbox$a 属性を有する `iframe$e の中)、取得子, 設定子のいずれに対しても, `SecurityError$E 例外が投出されることになる。 ◎ If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting.
`cookie@m
この属性は、文書の`~URL$docで識別される資源の~cookieを表現する。 ◎ The cookie attribute represents the cookies of the resource identified by the document's URL.

次のいずれかの条件を満たすような`文書$ %文書 は、 `反cookie文書@ とされる: ◎ A Document object that falls into one of the following conditions is a cookie-averse Document object:

  • %文書 が`属する閲覧文脈$ ~EQ ε ◎ A Document that has no browsing context.
  • %文書 の`~URL$docの`~scheme$urlは、`~network~scheme$ではない ◎ A Document whose URL's scheme is not a network scheme.

取得子は、次を走らせ~MUST ~FINGERPRINTING ◎ On getting,\

  1. ~IF[ 此れは`反cookie文書$である ] ⇒ ~RET 空~文字列 ◎ if the document is a cookie-averse Document object, then the user agent must return the empty string.\
  2. ~IF[ 此れの`生成元$は`不透明な生成元$である ] ⇒ ~THROW `SecurityError$E ◎ Otherwise, if the Document's origin is an opaque origin, the user agent must throw a "SecurityError" DOMException.\
  3. %~cookie値 ~LET “非~HTTP” ~APIに対する,[ 此れの`~URL$docに対する `cookie-string$P ] `COOKIES$r ◎ Otherwise, the user agent must return the cookie-string for the document's URL for a "non-HTTP" API,\
  4. ~RET `~BOMはそのままに~UTF-8復号する$( %~cookie値 ) ◎ decoded using UTF-8 decode without BOM. [COOKIES] (This is a fingerprinting vector.)

設定子は、次を走らせ~MUST: ◎ On setting,\

  1. ~IF[ 此れは`反cookie文書$である ] ⇒ ~RET ◎ if the document is a cookie-averse Document object, then the user agent must do nothing.\
  2. ~IF[ 此れの`生成元$は`不透明な生成元$である ] ⇒ ~THROW `SecurityError$E ◎ Otherwise, if the Document's origin is an opaque origin, the user agent must throw a "SecurityError" DOMException.\
  3. %~cookie値 ~LET `~UTF-8符号化する$( 所与の値 ) `ENCODING$r ◎ ↓
  4. “非~HTTP” ~APIを介して,[ 此れの`~URL$docに対する, %~cookie値 からなる `set-cookie-string^P を受信した ]かのように動作する `COOKIES$r ◎ Otherwise, the user agent must act as it would when receiving a set-cookie-string for the document's URL via a "non-HTTP" API, consisting of the new value encoded as UTF-8. [COOKIES] [ENCODING]

注記: `cookie$m 属性は,~frame間をまたがって~access可能なので、~cookieに対する~path制約は,~cookieが~siteのどの部分に送信されたか管理する一助になるに過ぎない — それは,どのような保安~上の特色機能でもない。 ◎ Since the cookie attribute is accessible across frames, the path restrictions on cookies are only a tool to help manage which cookies are sent to which parts of the site, and are not in any way a security feature.

`cookie$m 属性の取得子/設定子は、共有される状態に同期的に~accessする。 ~lockするための仕組みはないので、並列処理~UAにおいては,他の閲覧文脈が~scriptを走らせている間に~cookieを改変し得る。 具体例として、~siteは,~sessionの一意~識別子として ~cookieを読取って, 値を増分してから, ~cookieの新たな値として書き戻そうと試行することもできるが、その~siteがこれを 2 つの~browser~windowで同時に行った場合、両~sessionに同じ “一意” 識別子を利用する結果になり,破壊的な効果をもたらし得る。 ◎ The cookie attribute's getter and setter synchronously access shared state. Since there is no locking mechanism, other browsing contexts in a multiprocess user agent can modify cookies while scripts are running. A site could, for instance, try to read a cookie, increment its value, then write it back out, using the new value of the cookie as a unique identifier for the session; if the site does this twice in two different browser windows at the same time, it might end up using the same "unique" identifier for both sessions, with potentially disastrous effects.


%document . `lastModified$m
~serverから報告された文書の最終改変~日時を 利用者の地域標準時に換算した結果を, `MM/DD/YYYY hh:mm:ss^l の形にして返す。 ◎ Returns the date of the last modification to the document, as reported by the server, in the form "MM/DD/YYYY hh:mm:ss", in the user's local time zone.
最終改変~日時が既知でない場合、代わりに現在の時刻が返される。 ◎ If the last modification date is not known, the current time is returned instead.
`lastModified@m

取得子は、`文書$の~source~fileの最終改変~日時を 利用者の地域標準時に換算した結果を,次の並びによる形式にして返さ~MUST: ◎ The lastModified attribute, on getting, must return the date and time of the Document's source file's last modification, in the user's local time zone, in the following format:

  1. 日付の月t成分
  2. `002F^U `/^smb
  3. 日付の日t成分
  4. `002F^U `/^smb
  5. 日付の年t成分
  6. `0020^U SPACE
  7. 時刻の時t成分
  8. `003A^U `:^smb
  9. 時刻の分t成分
  10. `003A^U `:^smb
  11. 時刻の秒t成分
◎ • The month component of the date. • A U+002F SOLIDUS character (/). • The day component of the date. • A U+002F SOLIDUS character (/). • The year component of the date. • A U+0020 SPACE character. • The hours component of the time. • A U+003A COLON character (:). • The minutes component of the time. • A U+003A COLON character (:). • The seconds component of the time.

ここで,上の各~成分は、次のようにされ~MUST:

  • 当の成分を基数 10 の数で表現する`~ASCII数字$列で与える。
  • 年t成分は 4 桁~以上かつ最短にし,他の成分すべては 2 桁にする。
  • 前項に必要なら何個かの `0030^U `0^smb を前置する。
◎ All the numeric components above, other than the year, must be given as two ASCII digits representing the number in base ten, zero-padded if necessary. The year must be given as the shortest possible string of four or more ASCII digits representing the number in base ten, zero-padded if necessary.
`文書$の~source~fileの最終改変~日時は、利用-中の~networking~protocolに関連する特色機能から導出され~MUST — 例えば、文書の~HTTP `Last-Modified$h ~headerの値から, あるいは 局所~fileに対しては~file~system内の~metadataから。 最終改変~日時が未知の場合、この属性は,上の形式による現在の日時を返さ~MUST。 ◎ The Document's source file's last modification date and time must be derived from relevant features of the networking protocols used, e.g. from the value of the HTTP `Last-Modified` header of the document, or from metadata in the file system for local files. If the last modification date and time are not known, the attribute must return the current date and time in the above format.

%document . `readyState$m
`文書$を読込んでいる間は `loading^l を返す。 構文解析を終えた後, かつ下位資源を読込んでいる間は `interactive^l を返す。 すべて読込まれて以降は、 `complete^l を返す。 ◎ Returns "loading" while the Document is loading, "interactive" once it is finished parsing but still loading subresources, and "complete" once it has loaded.
この値が変化したときは、`文書$に向けて `readystatechange$et ~eventが発火される。 ◎ The readystatechange event fires on the Document object when this value changes.
`DOMContentLoaded$et ~eventは、 `interactive^l に遷移した後, かつ `complete^l に遷移する前の,すべての下位資源 — ただし, `script.async$a 属性を有する `script$e 要素によるものは除く — が読込まれた所で発火される。 ◎ The DOMContentLoaded event fires after the transition to "interactive" but before the transition to "complete", at the point where all subresources apart from async script elements have loaded.

各 `文書$は、 `現在の準備度@doc を持つ。 `文書$の作成-時には、[ 文書が[ `~HTML構文解析器$ / `~XML構文解析器$ / XSLT 処理器 ]のいずれかに結付けられているならば 文字列 `loading^l / ~ELSE_ `complete^l ]に設定され~MUST。 頁を読込んでいる間、種々の~algoがこの値に影響する。 値が設定されたときは、~UAは,`文書$に向けて名前 `readystatechange$et の`~eventを発火-$し~MUST。 ◎ Each document has a current document readiness. When a Document object is created, it must have its current document readiness set to the string "loading" if the document is associated with an HTML parser, an XML parser, or an XSLT processor, and to the string "complete" otherwise. Various algorithms during page loading affect this value. When the value is set, the user agent must fire an event named readystatechange at the Document object.

まだ[ `停止-$xされても, `中止-$xされても ]いない[ `~HTML構文解析器$ / `~XML構文解析器$ ]に結付けられている`文書$には、 `作動中の構文解析器@ があるとされる。 ◎ A Document is said to have an active parser if it is associated with an HTML parser or an XML parser that has not yet been stopped or aborted.

`readyState@m
取得子は、此れの`現在の準備度$docを返さ~MUST。 ◎ The readyState IDL attribute must, on getting, return the current document readiness.

3.1.3. ~DOM木~accessor

所与の`文書$ %文書 の `~html要素@ は、次を走らせた結果を返す:

  1. %文書~要素 ~LET %文書 の`文書~要素$
  2. ~RET[ %文書~要素 は `html$e 要素であるならば %文書~要素 / ~ELSE_ ~NULL ]
◎ The html element of a document is its document element, if it's an html element, and null otherwise.

%document . `head$m
`~head要素$を返す。 ◎ Returns the head element.

所与の`文書$ %文書 の `~head要素@ は、次を走らせた結果を返す:

  1. %~html ~LET %文書 の`~html要素$
  2. ~IF[ %~html ~EQ ~NULL ] ⇒ ~RET ~NULL
  3. ~RET[ 次をいずれも満たす要素があれば,それらのうち`木~順序$で最初のもの / ~ELSE_ ~NULL ]:

    • `head$e 要素である
    • 親 ~EQ %~html
◎ The head element of a document is the first head element that is a child of the html element, if there is one, or null otherwise.
`head@m
取得子は、此れの`~head要素$を返さ~MUST。 ◎ The head attribute, on getting, must return the head element of the document (a head element or null).

%document . `title$m [ = %value ]
文書の~titleを返す — ~titleは: ~HTMLに対しては,`~title要素$にて与えられ、 ~SVGに対しては,`~SVG-title$ 要素にて与えられる。 ◎ Returns the document's title, as given by the title element for HTML and as given by the SVG title element for SVG.
設定して文書の~titleを更新できる。 更新する適切な要素がない場合、所与の %value は無視される。 ◎ Can be set, to update the document's title. If there is no appropriate element to update, the new value is ignored.

所与の`文書$ %文書 の `~title要素@ は、 %文書 内に `title$e 要素が[ あれば それらのうち`木~順序$で最初のもの / なければ ~NULL ]を返す。 ◎ The title element of a document is the first title element in the document (in tree order), if there is one, or null otherwise.

`title@m

取得子は、次を走らせ~MUST: ◎ The title attribute must, on getting, run the following algorithm:

  1. %値 ~LET 空~文字列 ◎ ↓
  2. ~IF[ 此れの`文書~要素$ は `~SVG-svg$ 要素である ] ⇒ %値 ~SET [ 此れの`文書~要素$の子であるような,最初の `~SVG-title$ 要素 ]の`子~text内容$ ◎ If the document element is an SVG svg element, then let value be the child text content of the first SVG title element that is a child of the document element.
  3. ~ELSE[ 此れの`~title要素$ ~NEQ ~NULL ] ⇒ %値 ~SET その`子~text内容$ ◎ Otherwise, let value be the child text content of the title element, or the empty string if the title element is null.
  4. ~RET `~ASCII空白を剥いで縮約する$( %値 ) ◎ Strip and collapse ASCII whitespace in value. ◎ Return value.

設定子は、次を走らせ~MUST: ◎ On setting, the steps corresponding to the first matching condition in the following list must be run:

  1. %文書~要素 ~LET 此れの`文書~要素$ ◎ ↓
  2. ~IF[ %文書~要素 は `~SVG-svg$ 要素である ]: ◎ If the document element is an SVG svg element

    1. %title ~LET ~NULL
    2. ~IF[ %文書~要素 の子に `~SVG-title$ 要素はある ] ⇒ %title ~SET それらのうち最初のもの ◎ If there is an SVG title element that is a child of the document element, let element be the first such element.
    3. ~ELSE: ◎ Otherwise:

      1. %title ~SET `要素を作成する$( 此れ, `title^l, `~SVG名前空間$ ) ◎ Let element be the result of creating an element given the document element's node document, title, and the SVG namespace.
      2. %文書~要素 の`最初の子$として, %title を挿入する ◎ Insert element as the first child of the document element.
    4. %title の `textContent$m ~IDL属性を 所与の値に設定するかのように動作する ◎ Act as if the textContent IDL attribute of element was set to the new value being assigned.
  3. ~ELIF[ %文書~要素 は`~HTML名前空間$に属する ]: ◎ If the document element is in the HTML namespace

    1. %title ~LET 此れの`~title要素$ ◎ ↓
    2. %head ~LET 此れの`~head要素$ ◎ ↓
    3. ~IF[ %title ~EQ ~NULL ]~AND[ %head ~EQ ~NULL ] ⇒ ~RET ◎ If the title element is null and the head element is null, then return.
    4. ~IF[ %title ~EQ ~NULL ]: ◎ If the title element is non-null, let element be the title element. ◎ Otherwise:

      1. %title ~SET `要素を作成する$( 此れ, `title^l, `~HTML名前空間$ ) ◎ Let element be the result of creating an element given the document element's node document, title, and the HTML namespace.
      2. %head に`~nodeを付加する$( %title ) ◎ Append element to the head element.
    5. %title の `textContent$m ~IDL属性を 所与の値に設定するかのように動作する ◎ Act as if the textContent IDL attribute of element was set to the new value being assigned.
  4. ~ELSE ⇒ 何もしない ◎ Otherwise ◎ Do nothing.

%document . `body$m [ = %value ]
`~body要素$を返す。 ◎ Returns the body element.
設定して`~body要素$を置換できる。 ◎ Can be set, to replace the body element.
所与の要素が `body$e でも `frameset$eO でもない場合、 `HierarchyRequestError$E 例外が投出される。 ◎ If the new value is not a body or frameset element, this will throw a "HierarchyRequestError" DOMException.

所与の`文書$ %文書 の `~body要素@ は、次を走らせた結果を返す:

  1. %~html ~LET %文書 の`~html要素$
  2. ~IF[ %~html ~EQ ~NULL ] ⇒ ~RET ~NULL
  3. ~RET[ 次をいずれも満たす要素があれば,それらのうち`木~順序$で最初のもの / ~ELSE_ ~NULL ]:

    • [ `body$e / `frameset$eO ]要素である
    • 親 ~EQ %~html
◎ The body element of a document is the first of the html element's children that is either a body element or a frameset element, or null if there is no such element.
`body@m
取得子は、此れの`~body要素$を返さ~MUST。 ◎ The body attribute, on getting, must return the body element of the document (either a body element, a frameset element, or null).\

設定子は、次を走らせ~MUST: ◎ On setting, the following algorithm must be run:

  1. %要素 ~LET 与えられた値
  2. ~IF[ %要素 は[ `body$e, `frameset$eO ]いずれの要素でもない ] ⇒ ~THROW `HierarchyRequestError$E ◎ If the new value is not a body or frameset element, then throw a "HierarchyRequestError" DOMException.
  3. %body ~LET 此れの`~body要素$
  4. ~IF[ %要素 ~EQ %body ] ⇒ ~RET ◎ Otherwise, if the new value is the same as the body element, return.
  5. %文書~要素 ~LET 此れの`文書~要素$ ◎ ↓
  6. ~IF[ %body ~NEQ ~NULL ] ⇒ %body の親の中で`子を~nodeに置換する$( %body, %要素 ) ◎ Otherwise, if the body element is not null, then replace the body element with the new value within the body element's parent and return.
  7. ~ELIF[ %文書~要素 ~EQ ~NULL ] ⇒ ~THROW `HierarchyRequestError$E ◎ Otherwise, if there is no document element, throw a "HierarchyRequestError" DOMException.
  8. ~ELSE ⇒ %文書~要素 に`~nodeを付加する$( %要素 ) ◎ Otherwise, the body element is null, but there's a document element. Append the new value to the document element.

注記: `body$m 取得子は、設定子に渡された値を返さない場合もある。 ◎ The value returned by the body getter is not always the one passed to the setter.

次の例では、設定子は `body$e を成功裡に挿入する(これは適合しないが — ~SVGでは、 `~SVG-svg$ の子として `body$e 要素は許容されないので)。 しかしながら、取得子は ~NULL を返すことになる — 文書~要素は `html$e ではないので: ◎ In this example, the setter successfully inserts a body element (though this is non-conforming since SVG does not allow a body as child of SVG svg). However the getter will return null because the document element is not html.

`document-1^xCode

%document . `images$m
`文書$内の `img$e 要素たち からなる `HTMLCollection$I を返す。 ◎ Returns an HTMLCollection of the img elements in the Document.
%document . `embeds$m
%document . `plugins$m
`文書$内の `embed$e 要素たち からなる `HTMLCollection$I を返す。 ◎ Return an HTMLCollection of the embed elements in the Document.
%document . `links$m
`文書$内の `a$e, `area$e 要素たちのうち, `href$a 属性を有するもの からなる `HTMLCollection$I を返す。 ◎ Returns an HTMLCollection of the a and area elements in the Document that have href attributes.
%document . `forms$m
`文書$内の `form$e 要素たち からなる `HTMLCollection$I を返す。 ◎ Return an HTMLCollection of the form elements in the Document.
%document . `scripts$m
`文書$内の `script$e 要素たち からなる `HTMLCollection$I を返す。 ◎ Return an HTMLCollection of the script elements in the Document.
`images@m
`embeds@m
`plugins@m
`links@m
`forms@m
`scripts@m

これらの属性の取得子は、次のようにされた `HTMLCollection$I を返さ~MUST:

  • 根: 此れ
  • ~filter: 属性に応じて、次の表の右列に該当する要素のみに合致する
~IDL属性 合致する要素
`images$m `img$e 要素
`embeds$m `embed$e 要素
`plugins$m `embed$e 要素
`links$m [ `a$e, `area$e ]要素のうち,`href$a 属性を有するもの
`forms$m `form$e 要素
`scripts$m `script$e 要素
◎ The images attribute must return an HTMLCollection rooted at the Document node, whose filter matches only img elements. ◎ The embeds attribute must return an HTMLCollection rooted at the Document node, whose filter matches only embed elements. ◎ The plugins attribute must return the same object as that returned by the embeds attribute. ◎ The links attribute must return an HTMLCollection rooted at the Document node, whose filter matches only a elements with href attributes and area elements with href attributes. ◎ The forms attribute must return an HTMLCollection rooted at the Document node, whose filter matches only form elements. ◎ The scripts attribute must return an HTMLCollection rooted at the Document node, whose filter matches only script elements.

%collection = %document . `getElementsByName$m(%name)
`文書$内の要素のうち,[ `name^a 属性を有する, かつその値 ~EQ %name なるもの ]からなる `NodeList$I を返す ◎ Returns a NodeList of elements in the Document that have a name attribute with the value name.
`getElementsByName(name)@m
被呼出時には、此れ内にある `~HTML要素$のうち,[ `name^a 属性を有していて,その値 ~EQ %name ]なる~nodeすべてを包含している,`木~順序$による`~live$ `NodeList$I を返さ~MUST。 ◎ The getElementsByName(name) method takes a string name, and must return a live NodeList containing all the HTML elements in that document that have a name attribute whose value is equal to the name argument (in a case-sensitive manner), in tree order.\
~UAは、同じ引数による複数回の呼出しに対しては,同じ~objを返してよい。 そうでなければ,新たな~objを返さ~MUST。 ◎ When the method is invoked on a Document object again with the same argument, the user agent may return the same as the object returned by the earlier call. In other cases, a new NodeList object must be returned.

%document . `currentScript$m
現在~実行している[ `script$e / `~SVG-script$ ]要素を返す — その要素が`~classic~script$を表現する限りにおいて。 再入的 `script$e 実行の事例では、まだ実行し終えてないそれらのうち,最も近過去に実行し始めたものを返す。 ◎ Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing.
`文書$が現在~実行中の[ `script$e / `~SVG-script$ ]要素は[ ない(例:走っている~scriptは~event~handlerであるか, 時間切れになった), または`~module~script$を実行している ]場合は、~NULLを返す。 ◎ Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script.
`currentScript@m
取得子は、最も近過去に設定された値を返さ~MUST。 ◎ The currentScript attribute, on getting, must return the value to which it was most recently set.\
この属性は、此れの作成-時には,~NULLに初期化され~MUST。 ◎ When the Document is created, the currentScript must be initialized to null.

この~APIは、 `script$e / `~SVG-script$ 要素を大域的に公開するので、[ 実装者, 標準 ]の~communityからの支持を失っている。 そのようなわけで、`~module~script$や`~shadow木$内の~scriptを走らすときのような,より新たな文脈の下では可用ではない。 そのような文脈で走っている~scriptを,大域的に公開させることなく識別するための 新たな解決策を探している所である。 issue #1013 を見よ。 ◎ This API has fallen out of favor in the implementer and standards community, as it globally exposes script or SVG script elements. As such, it is not available in newer contexts, such as when running module scripts or when running scripts in a shadow tree. We are looking into creating a new solution for identifying the running script in such contexts, which does not make it globally available: see issue #1013.


`Document$I ~interfaceは、`有名~propを~supportする$。 所与の時点における`文書$ %文書 が`~supportする~prop名$は、 %文書 のすべての`有名~要素$の`要素~名$からなり,それらの順序は `要素~名$を供与する要素の`木~順序$に従うとする — ただし:

  • 同じ要素の `id$a, `name^a 両~属性が`要素~名$を供与する場合は `id$a が先とする。
  • `要素~名$の重複に際しては、後から供与される`要素~名$は無視する。
◎ The Document interface supports named properties. The supported property names of a Document object document at any moment consist of the following, in tree order according to the element that contributed them, ignoring later duplicates, and with values from id attributes coming before values from name attributes when the same element contributes both: • the value of the name content attribute for all exposed embed, form, iframe, img, and exposed object elements that have a non-empty name content attribute and are in a document tree with document as their root; • the value of the id content attribute for all exposed object elements that have a non-empty id content attribute and are in a document tree with document as their root; and • the value of the id content attribute for all img elements that have both a non-empty id content attribute and a non-empty name content attribute, and are in a document tree with document as their root.

~UAは、`文書$ %文書 の,所与の %名前 に対応する`有名~propの値を決定する$ときは、次の手続きを走らせ~MUST: ◎ To determine the value of a named property name for a Document, the user agent must return the value obtained using the following steps:

  1. ~Assert: %名前 は %文書 が`~supportする~prop名$である 【この段は、この訳による補完。】
  2. %要素~list ~LET %文書 の`有名~要素$のうち,[ `要素~名$ ~EQ %名前 ]なるものからなる~list ◎ Let elements be the list of named elements with the name name that are in a document tree with the Document as their root.

    定義により、~listは空でない。 ◎ There will be at least one such element, by definition.

  3. ~IF[ %要素~list は唯一の要素 %要素 からなる ]

    1. ~IF[ %要素 は `iframe$e 要素である ]~AND[ %要素 が`入子にしている閲覧文脈$ %B ~NEQ ~NULL ] ⇒ ~RET %B の `WindowProxy$I ~obj
    2. ~RET %要素
    ◎ If elements has only one element, and that element is an iframe element, and that iframe element's nested browsing context is not null, then return the WindowProxy object of the element's nested browsing context. ◎ Otherwise, if elements has only one element, return that element.
  4. ~RET 次のようにされた `HTMLCollection$I ⇒# 根: `文書$; ~filter: [`要素~名$ ~EQ %名前 ]なる`有名~要素$のみに合致する ◎ Otherwise return an HTMLCollection rooted at the Document node, whose filter matches only named elements with the name name.

次をすべて満たす要素が、`文書$の `有名~要素@ とされる:

  • 要素は、文書を`根$とする`木~内にある$
  • 要素は、下の表の 1 列目に挙げるいずれかである
  • 要素は、同じ行の 2 列目に挙げる内容~属性 %A を有する
  • 要素は、同じ行の 3 列目の条件を満たす
  • %A の値 ~NEQ 空~文字列

%A の値が、`有名~要素$の `要素~名@ を供与する。 【この語は、記述を論理的に集約するためにこの訳に導入した用語である。】

要素 内容~属性 追加の条件
`form$e, `iframe$e, `img$e `name^a なし
`object$e `name^a `公開されている$
`object$e `id$a `公開されている$
`embed$e `name^a `公開されている$
`img$e `id$a `name^a 内容~属性を有する, かつ その値 ~NEQ 空~文字列
◎ Named elements with the name name, for the purposes of the above algorithm, are those that are either: ◎ exposed embed, form, iframe, img, or exposed object elements that have a name content attribute whose value is name, or ◎ Exposed object elements that have an id content attribute whose value is name, or ◎ img elements that have an id content attribute whose value is name, and that have a non-empty name content attribute present also.

[ `embed$e / `object$e ]要素は、次のいずれも満たすならば, `公開されている@ という:

  • どの先祖も,`公開されている$ `object$e ではない
  • `embed$e 要素であるか, または 次のいずれかを満たす `object$e 要素である:

    • `~fallback内容$を示していない
    • どの子孫も, `object$e 要素でも `embed$e 要素でもない
◎ An embed or object element is said to be exposed if it has no exposed object ancestor, and, for object elements, is additionally either not showing its fallback content or has no object or embed descendants.

注記: `Document$I ~interfaceの `dir$m 属性は、 `dir$a 内容~属性とともに定義される。 ◎ The dir attribute on the Document interface is defined along with the dir content attribute.

3.2. 要素

3.2.1. 意味論

~HTMLにおける[ 要素, 属性, 属性~値 ]は、(この仕様により)ある種の意味(意味論)を有するものと定義される。 例えば、 `ol$e 要素は 有順序~listを表現し, `lang$a 属性は 要素~内容の言語を表現する。 ◎ Elements, attributes, and attribute values in HTML are defined (by this specification) to have certain meanings (semantics). For example, the ol element represents an ordered list, and the lang attribute represents the language of the content.

これらの定義は、[ ~Web~browserや検索~engineなどの,~HTML処理器 ]が[ 文書を呈示したり, 利用すること ], および[ 作者が考慮していないものも含む,多様な文脈における応用 ]を許容する。 ◎ These definitions allow HTML processors, such as Web browsers or search engines, to present and use documents and applications in a wide variety of contexts that the author might not have considered.

単純な例として、作者が~desktop~computer~Web~browserのみを考慮して書いた~Web頁を考える: ◎ As a simple example, consider a Web page written by an author who only considered desktop computer Web browsers:

`elements-1^xCode

~HTMLは,呈示ではなく 意味 を伝達するので、同じ頁は,何ら変更することなく携帯端末~上の小さい~browserからも利用され得る。 携帯端末~上の~browserは、~desktop上のときのような字の大きい見出しに代えて,例えば、頁~全体に同じ~sizeの~textを利用した上で,見出しを太字にすることもあり得る。 ◎ Because HTML conveys meaning, rather than presentation, the same page can also be used by a small browser on a mobile phone, without any change to the page. Instead of headings being in large letters as on the desktop, for example, the browser on the mobile phone might use the same size text for the whole page, but with the headings in bold.

単なる~screen~sizeの相違のみならず、同じ頁は,発話~合成に基づく~browserを利用している~blind利用者からも等しく利用され得る — そこでは、例えば~headphoneを利用している利用者に向けて,頁を~screen上に表示する代わりに頁を読上げる。 そのような発話~browserは、~textを大きくする代わりに 異なる音量やより低速な声を見出しに利用するであろう。 ◎ But it goes further than just differences in screen size: the same page could equally be used by a blind user using a browser based around speech synthesis, which instead of displaying the page on a screen, reads the page to the user, e.g. using headphones. Instead of large text for the headings, the speech browser might use a different volume or a slower voice.

他にもある。 ~browserは,頁のどの部分が見出しであるか知るので、[ 利用者が “次の/前の見出しまで飛ぶ” キーを用いて,文書を素早く~~巡回できる ]ために利用できるような,文書の~outlineを作成できる。 そのような特色機能は、とりわけ発話~browserに共通してある — さもなければ,利用者は、頁を素早く~navigateするのが著しく困難なことを見出すであろう。 ◎ That's not all, either. Since the browsers know which parts of the page are the headings, they can create a document outline that the user can use to quickly navigate around the document, using keys for "jump to next heading" or "jump to previous heading". Such features are especially common with speech browsers, where users would otherwise find quickly navigating a page quite difficult.

~browserの他にも,~softwareはこの情報を用立てられる。 検索~engineは、より効果的に,見出しを[ 頁を~indexしたり、その結果から,頁の下位節へ~~直に飛べる~linkを供する ]ために利用できる。 各種~toolは、目次を作成するときに見出しを利用できる(事実,この仕様~自身もそうやって目次を生成している)。 ◎ Even beyond browsers, software can make use of this information. Search engines can use the headings to more effectively index a page, or to provide quick links to subsections of the page from their results. Tools can use the headings to create a table of contents (that is in fact how this very specification's table of contents is generated).

この例では,見出しに注目していたが、同じ原則は,~HTMLにおけるすべての意味論に適用される。 ◎ This example has focused on headings, but the same principle applies to all of the semantics in HTML.

作者は、[ 要素/属性/属性~値 ]を,それらに意図された意味論上の目的に適切な目的~以外に利用しては~MUST_NOT — そうすると,~softwareは頁を正しく処理できなくなるので。 ◎ Authors must not use elements, attributes, or attribute values for purposes other than their appropriate intended semantic purpose, as doing so prevents software from correctly processing the page.

例えば,次の~code片は,ある企業~siteの見出しを表現するために意図されているが、その 2 行目は,下位節の見出しに意図されたものではなく、単に同じ節の副~見出しに過ぎないので、適合でない。 ◎ For example, the following snippet, intended to represent the heading of a corporate site, is non-conforming because the second line is not intended to be a heading of a subsection, but merely a subheading or subtitle (a subordinate heading for the same section).

`elements-2^xCode

この種の状況に意図されている要素は `hgroup$e である: ◎ The hgroup element is intended for these kinds of situations:

`elements-3^xCode

同様に、次の例における文書は,構文上は正しくても適合でない — 各~cell内に配されている~dataは,明らかに~table用の~dataではなく, `cite$e 要素は誤用されているので: ◎ The document in this next example is similarly non-conforming, despite being syntactically correct, because the data placed in the cells is clearly not tabular data, and the cite element mis-used:

`elements-4^xCode

これは、これらの意味論に依拠する~softwareを失敗させるであろう: 例えば文書~内の~tableを~blind利用者が~navigateできるようにする発話~browserは、上の~~文章を~tableとして報告することになり,利用者を惑わすことなる。 同様に,頁から各 作品の~titleを抽出する~toolは、 "アーネスト" を,実際には人名であって ~titleではないのに,作品の~titleとして抽出することになる。 ◎ This would make software that relies on these semantics fail: for example, a speech browser that allowed a blind user to navigate tables in the document would report the quote above as a table, confusing the user; similarly, a tool that extracted titles of works from pages would extract "Ernest" as the title of a work, even though it's actually a person's name, not a title.

上の文書を正した~versionは、次のようになるであろう: ◎ A corrected version of this document might be:

`elements-5^xCode

作者は、この仕様も含む`適用-可能な仕様$により許可されていない[ 要素, 属性, 属性~値 ]を利用しては~MUST_NOT。 そうすると、~HTMLの将来の拡張が有意に難しくなるので。 ◎ Authors must not use elements, attributes, or attribute values that are not permitted by this specification or other applicable specifications, as doing so makes it significantly harder for the language to be extended in the future.

次の例には、この仕様により許可されていない,適合しない[ 属性~値( `carpet^l ), 属性( `texture^a ) ]がある: ◎ In the next example, there is a non-conforming attribute value ("carpet") and a non-conforming attribute ("texture"), which is not permitted by this specification:

`elements-6^xCode

これを~mark-upする別の正しい仕方は: ◎ Here would be an alternative and correct way to mark this up:

`elements-7^xCode

~DOM~nodeのうち,その`~node文書$が属する`閲覧文脈$がない†ものに対しては、[ `~HTML構文$x / `~XML構文$ ]による要件を除く,すべての文書 適合性~要件は免除される。 【† `属する閲覧文脈$ ~EQ ε 】 ◎ DOM nodes whose node document does not have a browsing context are exempt from all document conformance requirements other than the HTML syntax requirements and XML syntax requirements.

特に、 `template$e 要素の`~template内容$の`~node文書$が属する`閲覧文脈$はないので、要素の内容には,例えば[ 内容~model要件, 属性~値に対する小構文による要件 ]は適用されない。 次の例の `img$e 要素の属性には、仮入力として, `template$e 要素の外側では妥当でない値が与えられている: ◎ In particular, the template element's template contents's node document does not have a browsing context. For example, the content model requirements and attribute value microsyntax requirements do not apply to a template element's template contents. In this example an img element has attribute values that are placeholders that would be invalid outside a template element.

`elements-8^xCode

上の~markupから終了tag `</h1>^c を省略した場合、`~HTML構文$x 違反になり,適合性~検査器により~errorにされる。 ◎ However, if the above markup were to omit the </h1> end tag, that would be a violation of the HTML syntax, and would thus be flagged as an error by conformance checkers.

[ 属性の値, ~text, 更には文書の構造~全体 ]は、~UAがそれを処理している間に,~scriptingを通して/他の仕組みを利用して 動的に変更され得る。 ある時点における文書の意味論は,その時点の文書の状態により表現され、したがって文書の意味論は 時経過に伴って変化し得る。 ~UAは、文書の呈示を,変化が生じる度に更新し~MUST。 ◎ Through scripting and using other mechanisms, the values of attributes, text, and indeed the entire structure of the document may change dynamically while a user agent is processing it. The semantics of a document at an instant in time are those represented by the state of the document at that instant in time, and the semantics of a document can therefore change over time. User agents must update their presentation of the document as this occurs.

~HTMLには、進捗~barを記述する `progress$e 要素がある。 その `value^a 属性が~scriptにより動的に更新された場合、~UAは,進捗の変化を示すように描画を更新することになる。 ◎ HTML has a progress element that describes a progress bar. If its "value" attribute is dynamically updated by a script, the UA would update the rendering to show the progress changing.

3.2.2. ~DOM内の要素

~DOM内の`~HTML要素$を表現している~nodeは、この仕様の関連する節にて挙げられる~interfaceを実装して~scriptに公開し~MUST。 これには、`~XML文書$内の`~HTML要素$も含まれる — それらの文書が別の文脈~内にあるときでも(例: XSLT 変形の内側)。 ◎ The nodes representing HTML elements in the DOM must implement, and expose to scripts, the interfaces listed for them in the relevant sections of this specification. This includes HTML elements in XML documents, even when those documents are in another context (e.g. inside an XSLT transform).

~DOM内の要素は、それが内在的に有する意味 — 意味論とも呼ばれる — を `表現-@ する。 ◎ Elements in the DOM represent things; that is, they have intrinsic meaning, also known as semantics.

例えば `ol$e 要素は、有順序~listを表現する。 ◎ For example, an ol element represents an ordered list.

要素は、何らかの仕方で,明示的にまたは暗黙的に `参照-@ できる(指せる)。 ~DOM内の要素を明示的に参照するには、要素に `id$a 属性を付与して,[ `href$a 属性~値の素片にその値を伴う ]ような`~hyperlink$を作成する仕方がある。 しかしながら、~hyperlinkが必要とされているわけではない — 当の要素を指すようなどの方式でも,事足りる。 ◎ Elements can be referenced (referred to) in some way, either explicitly or implicitly. One way that an element in the DOM can be explicitly referenced is by giving an id attribute to the element, and then creating a hyperlink with that id attribute's value as the fragment for the hyperlink's href attribute value. Hyperlinks are not necessary for a reference, however; any manner of referring to the element in question will suffice.

`id$a 属性が付与されている,次の `figure$e 要素を考える: ◎ Consider the following figure element, which is given an id attribute:

`elements-in-the-dom-1^xCode

`~hyperlink$に基づく`参照-$は、次の様に `a$e 要素を利用すれば作成できる: ◎ A hyperlink-based reference could be created using the a element, like so:

`elements-in-the-dom-2^xCode

しかしながら, `figure$e 要素を`参照-$する仕方には他にも多くある: ◎ However, there are many other ways of referencing the figure element, such as:

  • “モジュール A, B, C, D が成す図に示されているように…” ◎ "As depicted in the figure of modules A, B, C, and D..."
  • “図 27 において…” (~hyperlinkなしに) ◎ "In Figure 27..." (without a hyperlink)
  • “図 "~~単純なモジュールグラフ" の内容から…” ◎ "From the contents of the 'simple module graph' figure..."
  • “下の図における…” (が、このようには しないことが奨励される ) ◎ "In the figure below..." (but this is discouraged)

`HTMLElement$I ~interfaceは、すべての`~HTML要素$~interfaceが継承する基本的~interfaceであり,追加の要件がない要素に利用され~MUST。 ◎ The basic interface, from which all the HTML elements' interfaces inherit, and which must be used by elements that have no additional requirements, is the HTMLElement interface.

[Exposed=Window,
 `HTMLConstructor$]
interface `HTMLElement@I : `Element$I {
  // 
~metadata属性
◎
// metadata attributes

  [`CEReactions$] attribute DOMString `title$mE;
  [`CEReactions$] attribute DOMString `lang$m;
  [`CEReactions$] attribute boolean `translate$m;
  [`CEReactions$] attribute DOMString `dir$mE;

  // 
利用者~対話
◎
// user interaction

  [`CEReactions$] attribute boolean `hidden$m;
  void `click$m();
  [`CEReactions$] attribute DOMString `accessKey$m;
  readonly attribute DOMString `accessKeyLabel$m;
  [`CEReactions$] attribute boolean `draggable$m;
  [`CEReactions$] attribute boolean `spellcheck$m;
  [`CEReactions$] attribute DOMString `autocapitalize$m;

  [`CEReactions$] attribute [TreatNullAs=EmptyString] DOMString `innerText$m;
};

`HTMLElement$I includes `GlobalEventHandlers$I;
`HTMLElement$I includes `DocumentAndElementEventHandlers$I;
`HTMLElement$I includes `ElementContentEditable$I;
`HTMLElement$I includes `HTMLOrSVGElement$I;

/* 注記:
`HTMLConstructor$xA を付与しないのは意図的である
◎
Note: intentionally not [HTMLConstructor]
 */
[Exposed=Window]
interface `HTMLUnknownElement@I : `HTMLElement$I { };

`HTMLElement$I ~interfaceは,いくつもの異種の特色機能に関係する ~methodや属性 を保持するので、この~interfaceの~memberの記述は,この仕様の何~節かに散らばっている。 ◎ The HTMLElement interface holds methods and attributes related to a number of disparate features, and the members of this interface are therefore described in various different sections of this specification.


( `~HTML名前空間$, %名前 ) 用の`要素~interface$は、次に従って決定される: ◎ The element interface for an element with name name in the HTML namespace is determined as follows:

  1. ~IF[ %名前 ~IN { `applet$eO, `bgsound$eO, `blink$eO, `isindex$eO, `keygen$eO, `multicol$eO, `nextid$eO, `spacer$eO } ] ⇒ ~RET `HTMLUnknownElement$I ◎ If name is applet, bgsound, blink, isindex, keygen, multicol, nextid, or spacer, then return HTMLUnknownElement.
  2. ~IF[ %名前 ~IN { `acronym$eO, `basefont$eO, `big$eO, `center$eO, `nobr$eO, `noembed$eO, `noframes$eO, `plaintext$eO, `rb$eO, `rtc$eO, `strike$eO, `tt$eO } ] ⇒ ~RET `HTMLElement$I ◎ If name is acronym, basefont, big, center, nobr, noembed, noframes, plaintext, rb, rtc, strike, or tt, then return HTMLElement.
  3. ~IF[ %名前 ~IN { `listing$eO, `xmp$eO } ] ⇒ ~RET `HTMLPreElement$I ◎ If name is listing or xmp, then return HTMLPreElement.
  4. ~IF[ 局所~名 %名前 に対応する`要素~型$に対する適切な~interfaceが,この仕様に定義されている ] ⇒ ~RET その~interface ◎ Otherwise, if this specification defines an interface appropriate for the element type corresponding to the local name name, then return that interface.
  5. ~IF[ %名前 に対する適切な~interfaceが,`適用-可能な仕様$に定義されている ] ⇒ ~RET それが定義している~interface ◎ If other applicable specifications define an appropriate interface for name, then return the interface they define.
  6. ~IF[ %名前 は`妥当な~custom要素~名$である ] ⇒ ~RET `HTMLElement$I ◎ If name is a valid custom element name, then return HTMLElement.
  7. ~RET `HTMLUnknownElement$I ◎ Return HTMLUnknownElement.

注記: `妥当な~custom要素~名$の場合に, `HTMLUnknownElement$I ではなく `HTMLElement$I を利用するのは、未来にあり得る`昇格$に際し,要素の~prototype~chainを `HTMLElement$I から その~subclassへ真っ直ぐ翻訳するだけで済むようにするためにある — `HTMLUnknownElement$I から関係ない~subclassへそらすような翻訳を要することなく。 ◎ The use of HTMLElement instead of HTMLUnknownElement in the case of valid custom element names is done to ensure that any potential future upgrades only cause a linear transition of the element's prototype chain, from HTMLElement to a subclass, instead of a lateral one, from HTMLUnknownElement to an unrelated subclass.

~HTML要素と~SVG要素 `SVG$r から共有される特色機能は、 `HTMLOrSVGElement$I ~interface~mixinを利用する: ◎ Features shared between HTML and SVG elements use the HTMLOrSVGElement interface mixin: [SVG]

interface mixin `HTMLOrSVGElement@I {
  [SameObject] readonly attribute `DOMStringMap$I `dataset$m;
  attribute DOMString `nonce$m;

  [`CEReactions$] attribute long `tabIndex$m;
  void `focus$m(optional `FocusOptions$I %options);
  void `blur$m();
};

3.2.3 ~HTML要素の構築子

`~custom要素$ 特色機能を~supportするため、すべての~HTML要素には,特別に挙動する構築子がある。 これは、~IDL`拡張属性$ `HTMLConstructor@xA を介して指示される。 それは、所与の~interfaceに対する~interface~objが,~call時に特定の挙動を持つことを指示する(挙動の詳細は下に定義される)。 ◎ To support the custom elements feature, all HTML elements have special constructor behavior. This is indicated via the [HTMLConstructor] IDL extended attribute. It indicates that the interface object for the given interface will have a specific behavior when called, as defined in detail below.

`HTMLConstructor$xA 拡張属性は:

  • 引数をとっては~MUST_NOT。
  • ~interface以外のものに現れては~MUST_NOT。
  • ~interface上に現れるのは一度限りで~MUST。 【おそらく、単に,部分的~interfaceも含めて一度限り — 継承する~interfaceは含めずに。】
  • 当の~interfaceには、[ `Constructor^xA /`NoInterfaceObject^xA ]拡張属性と併用されては~MUST_NOT(が、 `NamedConstructor^xA で注釈してもよい — 競合しないので)。
  • ~callback~interfaceに利用されては~MUST_NOT。
◎ The [HTMLConstructor] extended attribute must take no arguments, and must not appear on anything other than an interface. It must appear only once on an interface, and the interface must not be annotated with the [Constructor] or [NoInterfaceObject] extended attributes. (However, the interface may be annotated with [NamedConstructor]; there is no conflict there.) It must not be used on a callback interface.

`HTMLConstructor$xA 拡張属性で注釈された~interfaceに対応する`~interface~obj$は、それに対応する~JS関数~objの `Call^sl, `Construct^sl いずれに対しても,その呼出に対する関数~本体の挙動として,次の手続きを走らせ~MUST。 この~algoは: `Call^sl で呼出されたときは、[ `NewTarget^jv 値 ~EQ `undefined^jv ]の場合,即時に例外を投出する。 `Construct^sl で呼出されたときは、 `Construct^sl %newTarget ~parameterが `NewTarget^jv 値を供する。 ◎ Interface objects for interfaces annotated with the [HTMLConstructor] extended attribute must run the following steps as the function body behavior for both [[Call]] and [[Construct]] invocations of the corresponding JavaScript function object. When invoked with [[Call]], the NewTarget value is undefined, and so the algorithm below will immediately throw. When invoked with [[Construct]], the [[Construct]] newTarget parameter provides the NewTarget value.

【 `NewTarget^jv は ~JS仕様にて定義される。 大雑把に言えば、~objの構築-時における `this^jv にあたるもの。 】

  1. %registry ~LET `現在の大域~obj$の `CustomElementRegistry$I ~obj ◎ Let registry be the current global object's CustomElementRegistry object.
  2. ~IF[ `NewTarget^jv ~EQ `作動中の関数~obj$ ] ⇒ ~THROW `TypeError$E ◎ If NewTarget is equal to the active function object, then throw a TypeError.

    これは、~custom要素が`要素~interface$を構築子に利用して定義されたときに生じ得る: ◎ This can occur when a custom element is defined using an element interface as its constructor:

    %customElements.define("bad-1", HTMLButtonElement);
    new HTMLButtonElement();          // (1)
    document.createElement("bad-1");  // (2)
    

    この事例では、 `HTMLButtonElement$I の構築子を( (1) のように明示的に, または (2) のように暗黙的に)実行する間、`作動中の関数~obj$, `NewTarget^jv のいずれも `HTMLButtonElement$I になる。 この検査がなければ、局所~名が `bad-1^l である `HTMLButtonElement$I の~instanceを作成することも可能0になる。 ◎ In this case, during the execution of HTMLButtonElement (either explicitly, as in (1), or implicitly, as in (2)), both the active function object and NewTarget are HTMLButtonElement. If this check was not present, it would be possible to create an instance of HTMLButtonElement whose local name was bad-1.

  3. %定義 ~LET %registry 内に[ `構築子$cD ~EQ `NewTarget^jv ]なる~entryが[ あれば それ / なければ ε ] ◎ Let definition be the entry in registry with constructor equal to NewTarget.\
  4. ~IF[ %定義 ~EQ ε ] ⇒ ~THROW `TypeError$E ◎ If there is no such definition, then throw a TypeError.

    %registry 内には[ `構築子$cD ~EQ `undefined^jv ]なる~entryはあり得ないので、この段は,~HTML要素~構築子が関数として~callされないようにもする(その事例では `NewTarget^jv ~EQ `undefined^jv になるので)。 ◎ Since there can be no entry in registry with a constructor of undefined, this step also prevents HTML element constructors from being called as functions (since in that case NewTarget will be undefined).

  5. %~is0値 ~LET ~NULL ◎ Let is value be null.
  6. ~IF[ %定義 の`局所~名$cD ~EQ %定義 の`名前$cD (すなわち %定義 は`自律的~custom要素$に対するものである) ]: ◎ If definition's local name is equal to definition's name (i.e., definition is for an autonomous custom element), then:

    1. ~IF[ `作動中の関数~obj$は `HTMLElement$I でない ] ⇒ ~THROW `TypeError$E ◎ If the active function object is not HTMLElement, then throw a TypeError.

      これが生じ得るのは、~custom要素は局所~名を拡張しないよう定義されているが,非 `HTMLElement$I ~classを継承している場合である: ◎ This can occur when a custom element is defined to not extend any local names, but inherits from a non-HTMLElement class:

      %customElements.define("bad-2", class Bad2 extends HTMLParagraphElement {});
      

      この事例では、 `Bad2^c の~instanceを構築するときに生じる(暗黙的な) `super()^c ~callの間、`作動中の関数~obj$は `HTMLParagraphElement$I であり, `HTMLElement$I でない。 ◎ In this case, during the (implicit) super() call that occurs when constructing an instance of Bad2, the active function object is HTMLParagraphElement, not HTMLElement.

  7. ~ELSE(すなわち, %定義 は`~custom化された組込みの要素$に対するものである) : ◎ Otherwise (i.e., if definition is for a customized built-in element):

    1. `妥当な局所~名たち^V ~LET この仕様も含む`適用-可能な仕様$にて定義される各種~要素のうち[ `要素~interface$として`作動中の関数~obj$を利用するもの ]の,局所~名からなる集合 ◎ Let valid local names be the list of local names for elements defined in this specification or in other applicable specifications that use the active function object as their element interface.
    2. ~IF[ %定義 の`局所~名$cD ~NIN `妥当な局所~名たち^V ] ⇒ ~THROW `TypeError$E ◎ If valid local names does not contain definition's local name, then throw a TypeError.

      これが生じ得るのは、~custom要素は所与の局所~名を拡張するよう定義されているが, 間違った~classを継承しているときである: ◎ This can occur when a custom element is defined to extend a given local name but inherits from the wrong class:

      %customElements.define("bad-3", class Bad3 extends HTMLQuoteElement {}, { extends: "p" });
      

      この事例では、 `Bad3^c の~instanceを構築するときに生じる(暗黙的な) `super()^c ~callの間, `妥当な局所~名たち^V は[ `q$e, `blockquote$e ]を包含しているが、 %定義 の`局所~名$cD は `p$e であり,それに含まれてない。 ◎ In this case, during the (implicit) super() call that occurs when constructing an instance of Bad3, valid local names is the list containing q and blockquote, but definition's local name is p, which is not in that list.

    3. %~is0値 ~SET %定義 の`名前$cD ◎ Set is value to definition's name.
  8. %~prototype ~LET `Get$jA( `NewTarget^jv, `prototype^l) (例外投出あり) ◎ Let prototype be Get(NewTarget, "prototype"). Rethrow any exceptions.
  9. ~IF[ `Type$jA( %~prototype ) ~NEQ `Object^jc ]: ◎ If Type(prototype) is not Object, then:

    1. %~realm ~LET `GetFunctionRealm$jA( `NewTarget^jv ) ◎ Let realm be GetFunctionRealm(NewTarget).
    2. %~prototype ~SET %~realm の`~interface~prototype~obj$のうち,その~interfaceは `作動中の関数~obj$の~interfaceと同じであるもの ◎ Set prototype to the interface prototype object of realm whose interface is the same as the interface of the active function object.

    注記: `作動中の関数~obj$の~realmは %~realm でないこともあるので、 より一般的な概念 ~realm間にわたる “同じ~interface” を用いている — `~interface~obj$の同等性を~~求めてはいない。 この~fallbackによる挙動は — `NewTarget^jv の~realmの利用と, そこにある適切な~prototypeを探し出すことも含め — ~JSに組込みのものと相似的な挙動に合致するように設計されている。 ◎ The realm of the active function object might not be realm, so we are using the more general concept of "the same interface" across realms; we are not looking for equality of interface objects. This fallback behavior, including using the realm of NewTarget and looking up the appropriate prototype there, is designed to match analogous behavior for the JavaScript built-ins.

  10. ~IF[ %定義 の`構築~stack$cDは空である ]: ◎ If definition's construction stack is empty, then:

    1. %要素 ~LET 次のようにされた新たな要素:

      • `作動中の関数~obj$に対応する~interfaceを実装する
      • 属性は有さない
      • 名前空間 ~SET `~HTML名前空間$
      • 局所~名 ~SET %定義 の`局所~名$cD
      • `~node文書$ ~SET `現在の大域~obj$に`結付けられている文書$
      ◎ Let element be a new element that implements the interface to which the active function object corresponds, with no attributes, namespace set to the HTML namespace, local name set to definition's local name, and node document set to the current global object's associated Document.
    2. %要素 . `SetPrototypeOf^sl( %prototype ) を遂行する (例外投出あり) ◎ Perform element.[[SetPrototypeOf]](prototype). Rethrow any exceptions.
    3. %要素 の`~custom要素~状態$ ~SET `custom^l ◎ Set element's custom element state to "custom".
    4. %要素 の`~custom要素~定義$ ~SET %定義 ◎ Set element's custom element definition to definition.
    5. %要素 の`~is0値$ ~SET %~is0値 ◎ Set element's is value to is value.
    6. ~RET %要素 ◎ Return element.

    注記: この段は、作者~scriptが,新たな~custom要素を — 例えば `new MyCustomElement()^c を介して — 直に構築したときに生じる。 ◎ This occurs when author script constructs a new custom element directly, e.g. via new MyCustomElement().

  11. %要素 ~LET %定義 の`構築~stack$cD内の最後の~entry ◎ Let element be the last entry in definition's construction stack.
  12. ~IF[ %要素 ~EQ `すでに構築-済みを表す~marker$i ] ⇒ ~THROW `InvalidStateError$E ◎ If element is an already constructed marker, then throw an "InvalidStateError" DOMException.

    これは、`~custom要素~構築子$の内側で、作者~codeが `不適合に$[ `super()^c を~callする前に,構築中の~classの別の~instanceを作成した ]ときに生じ得る: ◎ This can occur when the author code inside the custom element constructor non-conformantly creates another instance of the class being constructed, before calling super():

    let %doSillyThing = false;
    
    class DontDoThis extends HTMLElement {
      constructor() {
        if (%doSillyThing) {
          %doSillyThing = false;
          new DontDoThis();
          /* 
    `構築~stack$cDは今や, `すでに構築-済みを表す~marker$i を包含することになる。
    ◎
    Now the construction stack will contain an already constructed marker.
     */
        }
    
        /* 
    次は `InvalidStateError^E 例外で失敗することになる
    ◎
    This will then fail with an "InvalidStateError" DOMException:
     */
        super();
      }
    }

    また、`~custom要素~構築子$の内側で,作者~codeが `不適合に$[ `super()^c を重ねて~callした ]ときにも生じ得る。 ~JS仕様によれば、これは,~superclassの構築子(すなわち,この~algo)を — ~errorを投出する前に — 実際に,重ねて実行するので: ◎ This can also occur when author code inside the custom element constructor non-conformantly calls super() twice, since per the JavaScript specification, this actually executes the superclass constructor (i.e. this algorithm) twice, before throwing an error:

    class DontDoThisEither extends HTMLElement {
      constructor() {
        super();
    
        /* 
    次の~callは 例外を投出するが、それは
    `HTMLElement^m 構築子の中へ~callした後になる。
    ◎
    This will throw, but not until it has already called into the HTMLElement constructor
     */
        super();
      }
    }
    
  13. %要素 . `SetPrototypeOf^sl( %prototype ) を遂行する (例外投出あり) ◎ Perform element.[[SetPrototypeOf]](prototype). Rethrow any exceptions.
  14. %定義 の`構築~stack$cD内の最後の~entryを, `すでに構築-済みを表す~marker$i で置換する ◎ Replace the last entry in definition's construction stack with an already constructed marker.
  15. ~RET %要素 ◎ Return element.

    注記: この段に到達するのは、通常は,~custom要素を`昇格$するときである。 `~custom要素~構築子$の内側からの `super()^c ~callにて, this に既存の要素をあてがうようにするため、その既存の要素を返す。 ◎ This step is normally reached when upgrading a custom element; the existing element is returned, so that the super() call inside the custom element constructor assigns that existing element to this.

`HTMLConstructor$xA により含意される構築子の挙動に加えて、`有名~構築子$も有する要素もある(その実は、 `prototype^c ~propが改変された,~factory関数である)。 ◎ In addition to the constructor behavior implied by [HTMLConstructor], some elements also have named constructors (which are really factory functions with a modified prototype property).

~HTML要素に対する有名~構築子は、`~custom要素~構築子$を定義するときにも, `extends^c ~clause内で利用できる: ◎ Named constructors for HTML elements can also be used in an extends clause when defining a custom element constructor:

class AutoEmbiggenedImage extends Image {
  constructor(%width, %height) {
    super(%width * 10, %height * 10);
  }
}

%customElements.define("auto-embiggened", AutoEmbiggenedImage, { extends: "img" });

const %image = new AutoEmbiggenedImage(15, 20);
console.assert(%image.width === 150);
console.assert(%image.height === 200);

3.2.4. 要素~定義

この仕様における各種 要素には、次の情報を含む定義が与えられる: ◎ Each element in this specification has a definition that includes the following information:

分類( Categories )
要素が属するとされる`分類$の~list。 これらの`分類$は、要素の`内容~model$を定義するときに利用される。 ◎ A list of categories to which the element belongs. These are used when defining the content models for each element.
この要素を利用できる文脈( Contexts in which this element can be used )
要素をどこで利用できるかについての,規範的でない記述。 この情報は、冗長であり,もっぱら便宜のため供される — 自身/他の要素に対する内容~modelにて供される情報(次項)と~~重複するので。 ◎ A non-normative description of where the element can be used. This information is redundant with the content models of elements that allow this one as a child, and is provided only as a convenience.
注記: 簡略化するため、ここには期待される分類のうち,最も特定的なもののみが挙げられる。 例えば,`~flow内容$であって, `句内容$でもある要素は、[ `~flow内容$ / `句内容$ ]が期待されるどこでも利用できるが、すべての`句内容$は`~flow内容$なので, “`句内容$が期待される所” のみが記されることになる。 ◎ For simplicity, only the most specific expectations are listed. For example, an element that is both flow content and phrasing content can be used anywhere that either flow content or phrasing content is expected, but since anywhere that flow content is expected, phrasing content is also expected (since all phrasing content is flow content), only "where phrasing content is expected" will be listed.
内容~model( Content model )
要素の子孫として含められ~MUST内容についての,規範的な記述。 ◎ A normative description of what content must be included as children and descendants of the element.
`text/html^c における~tag省略( Tag omission in text/html )
`text/html$c 構文において,[ `開始tag$/`終了tag$ ]を省略できるかどうかについての,規範的でない記述。 この情報は冗長であり,もっぱら便宜のために供される — 規範的~要件は、 省略可能~tag節 にて与えられる。 ◎ A non-normative description of whether, in the text/html syntax, the start and end tags can be omitted. This information is redundant with the normative requirements given in the optional tags section, and is provided in the element definitions only as a convenience.
【 “省略できる” とは、[ 構文が妥当な~markupにおいて当の~tagを省略しても,元と同じ~DOM木が生成される ]ことを意味すると考えればよいであろう。 例えば ある条件の下で開始tagを省略できる要素もあるが(例: `body$e )、その場合に省略しても,~DOM木には依然としてその要素が生成されることになる。 】【 開始tagの省略が、終了tagの省略も含意するわけではない — これらを省略できる条件は互いに独立であり、省略できる開始tagを省略して終了tagだけ残しても,構文上は妥当になると考えられる。 】
内容~属性( Content attributes )
要素に指定されてよい属性を挙げる,規範的な~list(他から不許可にされるものは除く)。 加えて、それらの属性についての規範的でない記述( ~dash( "—" )の左側に記される内容は規範的であり,右側の内容はそうでない)。 ◎ A normative list of attributes that may be specified on the element (except where otherwise disallowed), along with non-normative descriptions of those attributes. (The content to the left of the dash is normative, the content to the right of the dash is not.)
~DOM~interface( DOM interface )
当の要素が実装し~MUST ~DOM~interfaceについての,規範的な定義。 ◎ A normative definition of a DOM interface that such elements must implement.

上述の定義には、要素が何を`表現-$するかについての記述, および 作者/実装 に適用され得る,追加の規範的な適合性~判定基準も後続する。 例が含められることもある。 ◎ This is then followed by a description of what the element represents, along with any additional normative conformance criteria that may apply to authors and implementations. Examples are sometimes also included.

3.2.4.1. 属性

属性~値は文字列である。 他から指定されない限り、`~HTML要素$上の属性~値は,空~文字列も含め,どのような文字列~値もとり得る — そのような属性に指定し得る~textに制約はない。 ◎ An attribute value is a string. Except where otherwise specified, attribute values on HTML elements may be any string value, including the empty string, and there is no restriction on what text can be specified in such attribute values.

3.2.5. 内容~model

この仕様にて定義される各~要素は、要素に期待される`内容$を記述する,内容~modelを有する。 `~HTML要素$の内容は、要素の内容~modelに述べられる要件に合致し~MUST。 要素の `内容@ とは、~DOMにおける要素の子たちである。 ◎ Each element defined in this specification has a content model: a description of the element's expected contents. An HTML element must have contents that match the requirements described in the element's content model. The contents of an element are its children in the DOM.

要素たちの合間には,`~ASCII空白$が常に許容される。 ~UAは、~source~markup内の要素の合間にある~ASCII空白を,~DOM内では `Text$I ~nodeとして表現する。 0 個以上の`~ASCII空白$のみからなる `Text$I ~nodeは、 `要素間~空白@ と見なされる。 ◎ ASCII whitespace is always allowed between elements. User agents represent these characters between elements in the source markup as Text nodes in the DOM. Empty Text nodes and Text nodes consisting of just sequences of those characters are considered inter-element whitespace.

[ `要素間~空白$ / ~comment~node / 処理命令~node ]は、次の文脈においては,無視され~MUST:

  • 要素の内容が要素の内容~modelに合致するかどうか確かめるとき。
  • 文書や要素の意味論を定義する~algoに従うとき。
◎ Inter-element whitespace, comment nodes, and processing instruction nodes must be ignored when establishing whether an element's contents match the element's content model or not, and must be ignored when following algorithms that define document and element semantics.

注記: したがって要素 %A, %B に対し、[ %A, %B の親~nodeが同じである ]~AND[ それらの合間に[ 他の要素~nodeや, (`要素間~空白$以外の) `Text$I ~node ]が無いならば、 【上述の文脈においては,】 %A と %B は `~~隣接する^i とされる。 同様に,要素の子~nodeは、その要素が[ `要素間~空白$, ~comment~node, 処理命令~node ]以外の~nodeを他に包含しないならば,要素の唯一の子になる。 ◎ Thus, an element A is said to be preceded or followed by a second element B if A and B have the same parent node and there are no other element nodes or Text nodes (other than inter-element whitespace) between them. Similarly, a node is the only child of an element if that element contains no other nodes other than inter-element whitespace, comment nodes, and processing instruction nodes.

作者は、[ 各~要素に定義される / 他の仕様から明示的に要求される ]ような,明示的に許容される所を除いて、`~HTML要素$を利用しては~MUST_NOT。 ~XMLが複合されている文書に対しては、他の名前空間に属する要素の内側であっても, その種の要素が,関連する文脈を供するものとして定義されているならば、この文脈になり得る。 ◎ Authors must not use HTML elements anywhere except where they are explicitly allowed, as defined for each element, or as explicitly required by other specifications. For XML compound documents, these contexts could be inside elements from other namespaces, if those elements are defined as providing the relevant contexts.

例えば, Atom 仕様 `ATOM$r では、 `content^e 要素が定義されていて,その `type^a 属性の値が `xhtml^l のときには単独の~HTML `div$e 要素を包含することが要求される。 したがって, `div$e 要素は、その仕様により明示的に規範的であるものと言明されていなくとも,その文脈においては許容される。 ◎ For example, the Atom specification defines a content element. When its type attribute has the value xhtml, the Atom specification requires that it contain a single HTML div element. Thus, a div element is allowed in that context, even though this is not explicitly normatively stated by this specification. [ATOM]

加えて,`~HTML要素$は、孤立している — すなわち,親~nodeがない — 場合もある。 ◎ In addition, HTML elements may be orphan nodes (i.e. without a parent node).

例えば、[ `td$e 要素を利用できる場所は `tr$e 要素の内側のみ ]と想定されているが、[ ~scriptで `td$e 要素を作成して,大域的~変数に格納する ]ことは,適合である。 ◎ For example, creating a td element and storing it in a global variable in a script is conforming, even though td elements are otherwise only supposed to be used inside tr elements.

var %data = {
  name: "バナナ",
  cell: document.createElement('td'),
};

3.2.5.1. “なし” 内容~model

内容~modelが `なし@ ( nothing )とされている要素は、[[ `要素間~空白$以外の `Text$I ~node ] / 要素~node ]を包含しては~MUST_NOT。 ◎ When an element's content model is nothing, the element must contain no Text nodes (other than inter-element whitespace) and no element nodes.

注記: 内容~modelが “なし” とされているほとんどの~HTML要素は、簡便に記せるように,`~void要素$(`~HTML構文$において `終了tag$がない要素)にされているが、これらは全く別々の概念である。 ◎ Most HTML elements whose content model is "nothing" are also, for convenience, void elements (elements that have no end tag in the HTML syntax). However, these are entirely separate concepts.

3.2.5.2. 内容の種類

~HTMLにおける各種~要素は、互いに特徴が類似するいくつかの~groupに `分類-@ される。 各~要素は,これらのうち 0 個以上のものに該当する。 この仕様では,次の大分類が利用される: ◎ Each element in HTML falls into zero or more categories that group elements with similar characteristics together. The following broad categories are used in this specification:

  • `~metadata内容$( Metadata content )
  • `~flow内容$( Flow content )
  • `~sectioning内容$( Sectioning content )
  • `見出し内容$( Heading content )
  • `句内容$( Phrasing content )
  • `埋込みの内容$( Embedded content )
  • `対話的~内容$( Interactive content )

注記: 要素には、他の分類にも該当するものがある。 それらは,この仕様の他所にて定義される。 ◎ Some elements also fall into other categories, which are defined in other parts of this specification.

これらの分類は、次のように関係する: ◎ These categories are related as follows:

[ ~sectioning内容, 見出し内容, 句内容, 埋込みの内容, 対話的~内容 ]は、いずれも~flow内容の一種である。 ~metadataには,~flow内容になるものもある。 [ ~metadata/対話的~内容 ]には,句内容になるものもある。 埋込みの内容は、句内容の一種であり,対話的~内容になるものもある。 ◎ Sectioning content, heading content, phrasing content, embedded content, and interactive content are all types of flow content. Metadata is sometimes flow content. Metadata and interactive content are sometimes phrasing content. Embedded content is also a type of phrasing content, and sometimes is interactive content.

他の分類も特定の目的に利用される。 例えば~form~controlは、共通する要件を定義するために,いくつかの分類を利用して指定される。 一部の要素には,一意な要件があり、どの特定0の分類にもあてはまらない。 ◎ Other categories are also used for specific purposes, e.g. form controls are specified using a number of categories to define common requirements. Some elements have unique requirements and do not fit into any particular category.

3.2.5.2.1. ~metadata内容

`~metadata内容@ は、[ 内容の他の部分の呈示や挙動を設定しておく / 当の文書と他の文書との関係性を設定しておく / その他の “帯域外の” 情報を伝達する ]ような内容である: ◎ Metadata content is content that sets up the presentation or behavior of the rest of the content, or that sets up the relationship of the document with other documents, or that conveys other "out of band" information.

  • `base$e
  • `link$e
  • `meta$e
  • `noscript$e
  • `script$e
  • `style$e
  • `template$e
  • `title$e

他の名前空間に属する要素であって,その意味論が第一に~metadataに関係するもの(例: RDF )も、`~metadata内容$である。 ◎ Elements from other namespaces whose semantics are primarily metadata-related (e.g. RDF) are also metadata content.

したがって,~XML直列化においては、 RDF を次の様に利用できる: ◎ Thus, in the XML serialization, one can use RDF, like this:

`metadata-1^xCode

しかしながら,これは、~HTML直列化においては可能0でない。 ◎ This isn't possible in the HTML serialization, however.

3.2.5.2.2. ~flow内容

文書の~bodyや~appにて利用されるほとんどの要素は、 `~flow内容@ に分類される: ◎ Most elements that are used in the body of documents and applications are categorized as flow content.

  • `a$e
  • `abbr$e
  • `address$e
  • `area$e ( `map$e 要素の子孫であれば) ◎ area (if it is a descendant of a map element)
  • `article$e
  • `aside$e
  • `audio$e
  • `b$e
  • `bdi$e
  • `bdo$e
  • `blockquote$e
  • `br$e
  • `button$e
  • `canvas$e
  • `cite$e
  • `code$e
  • `data$e
  • `datalist$e
  • `del$e
  • `details$e
  • `dfn$e
  • `dialog$e
  • `div$e
  • `dl$e
  • `em$e
  • `embed$e
  • `fieldset$e
  • `figure$e
  • `footer$e
  • `form$e
  • `h1$e
  • `h2$e
  • `h3$e
  • `h4$e
  • `h5$e
  • `h6$e
  • `header$e
  • `hgroup$e
  • `hr$e
  • `i$e
  • `iframe$e
  • `img$e
  • `input$e
  • `ins$e
  • `kbd$e
  • `label$e
  • `link$e ( `~body内に許容される$ものに限る) ◎ link (if it is allowed in the body)
  • `main$e (`階層的に正しく$なるものに限る) ◎ main (if it is a hierarchically correct main element)
  • `map$e
  • `mark$e
  • `~MathML-math$
  • `menu$e
  • `meta$e ( `itemprop$a 属性を有するものに限る) ◎ meta (if the itemprop attribute is present)
  • `meter$e
  • `nav$e
  • `noscript$e
  • `object$e
  • `ol$e
  • `output$e
  • `p$e
  • `picture$e
  • `pre$e
  • `progress$e
  • `q$e
  • `ruby$e
  • `s$e
  • `samp$e
  • `script$e
  • `section$e
  • `select$e
  • `slot$e
  • `small$e
  • `span$e
  • `strong$e
  • `sub$e
  • `sup$e
  • `~SVG-svg$
  • `table$e
  • `template$e
  • `textarea$e
  • `time$e
  • `u$e
  • `ul$e
  • `var$e
  • `video$e
  • `wbr$e
  • `自律的~custom要素$
  • `~text$
3.2.5.2.3. ~sectioning内容

`~sectioning内容@ は[ `見出し$/ `footer$e ]の視野を定義する内容である: ◎ Sectioning content is content that defines the scope of headings and footers.

  • `article$e
  • `aside$e
  • `nav$e
  • `section$e

各`~sectioning内容$要素は、見出しや`~outline$を持ち得る。 更なる詳細は、 見出しと~section の節を見よ。 ◎ Each sectioning content element potentially has a heading and an outline. See the section on headings and sections for further details.

注記: 要素には、`~sectioning根$になるものもある。 これらは`~sectioning内容$とは別個のものだが、`~outline$を持ち得る。 ◎ There are also certain elements that are sectioning roots. These are distinct from sectioning content, but they can also have an outline.

3.2.5.2.4. 見出し内容

`見出し内容@ は、~sectionの~headerを定義する(~sectionは、`~sectioning内容$要素を利用して明示的に, または 見出し内容~自身により暗黙的に,~mark-upされる): ◎ Heading content defines the header of a section (whether explicitly marked up using sectioning content elements, or implied by the heading content itself).

  • `h1$e
  • `h2$e
  • `h3$e
  • `h4$e
  • `h5$e
  • `h6$e
  • `hgroup$e
3.2.5.2.5. 句内容

`句内容@ は、文書の~text, および その~textを段落~内の~levelで~mark-upする要素である。 `句内容$の連なりは、`段落$を形成する: ◎ Phrasing content is the text of the document, as well as elements that mark up that text at the intra-paragraph level. Runs of phrasing content form paragraphs.

  • `a$e
  • `abbr$e
  • `area$e ( `map$e 要素の子孫であるものに限る) ◎ area (if it is a descendant of a map element)
  • `audio$e
  • `b$e
  • `bdi$e
  • `bdo$e
  • `br$e
  • `button$e
  • `canvas$e
  • `cite$e
  • `code$e
  • `data$e
  • `datalist$e
  • `del$e
  • `dfn$e
  • `em$e
  • `embed$e
  • `i$e
  • `iframe$e
  • `img$e
  • `input$e
  • `ins$e
  • `kbd$e
  • `label$e
  • `link$e ( `~body内に許容される$ものに限る) ◎ link (if it is allowed in the body)
  • `map$e
  • `mark$e
  • `~MathML-math$
  • `meta$e ( `itemprop$a 属性を有するものに限る) ◎ meta (if the itemprop attribute is present)
  • `meter$e
  • `noscript$e
  • `object$e
  • `output$e
  • `picture$e
  • `progress$e
  • `q$e
  • `ruby$e
  • `s$e
  • `samp$e
  • `script$e
  • `select$e
  • `slot$e
  • `small$e
  • `span$e
  • `strong$e
  • `sub$e
  • `sup$e
  • `~SVG-svg$
  • `template$e
  • `textarea$e
  • `time$e
  • `u$e
  • `var$e
  • `video$e
  • `wbr$e
  • `自律的~custom要素$
  • `~text$

注記: 句内容に分類されるほとんどの要素は、句内容に分類される要素のみを包含し得る — ~~任意の~flow内容ではなく。 ◎ Most elements that are categorized as phrasing content can only contain elements that are themselves categorized as phrasing content, not any flow content.

内容~modelの文脈における `~text@ は、[ `なし$, または `Text$I ~node ]を意味する。 `~text$は,内容~modelに利用されることもあるが、分類としては,`句内容$や`要素間~空白$( 0 個以上の`~ASCII空白$のみからなる `Text$I ~node)にもなり得る。 ◎ Text, in the context of content models, means either nothing, or Text nodes. Text is sometimes used as a content model on its own, but is also phrasing content, and can be inter-element whitespace (if the Text nodes are empty or contain just ASCII whitespace).

[ `Text$I ~nodeを成す文字列 / 内容~属性の値 ]は、次を満たさ~MUST:

  • `~scalar値$のみからなる
  • `非文字$は包含しない
  • `~ASCII空白$以外の`制御~文字$は包含しない

この仕様は、精確な文脈に依存して,[ `Text$I ~nodeを成す文字列 / 内容~属性の値 ]がとり得る~~範囲に 余分の拘束を課すこともある。

◎ Text nodes and attribute values must consist of scalar values, excluding noncharacters, and controls other than ASCII whitespace. This specification includes extra constraints on the exact value of Text nodes and attribute values depending on their precise context.
3.2.5.2.6. 埋込みの内容

`埋込みの内容@ は、文書の中に[ 別の資源を取込む / 別の語彙に属する内容を挿入する ]ような内容である: ◎ Embedded content is content that imports another resource into the document, or content from another vocabulary that is inserted into the document.

  • `audio$e
  • `canvas$e
  • `embed$e
  • `iframe$e
  • `img$e
  • `~MathML-math$
  • `object$e
  • `picture$e
  • `~SVG-svg$
  • `video$e

`~HTML名前空間$以外の名前空間に属する要素であって,~metadataでない内容を伝達するものは、この仕様にて定義される内容~modelの目的においては,`埋込みの内容$になる(例: MathML, ~SVG )。 ◎ Elements that are from namespaces other than the HTML namespace and that convey content but not metadata, are embedded content for the purposes of the content models defined in this specification. (For example, MathML, or SVG.)

埋込みの内容を与える要素には、外部~資源を利用できないとき(例:~supportされない形式であるため)に利用される, `~fallback内容@ を持つものもある。 何が~fallbackにあたるのかは、それぞれの要素~定義にて言明される。 ◎ Some embedded content elements can have fallback content: content that is to be used when the external resource cannot be used (e.g. because it is of an unsupported format). The element definitions state what the fallback is, if any.

3.2.5.2.7. 対話的~内容

`対話的~内容@ は、利用者~対話~用に特に意図されている内容である: ◎ Interactive content is content that is specifically intended for user interaction.

  • `a$e ( `href$a 属性を有するものに限る) ◎ a (if the href attribute is present)
  • `audio$e ( `controls$a 属性を有するものに限る) ◎ audio (if the controls attribute is present)
  • `button$e
  • `details$e
  • `embed$e
  • `iframe$e
  • `img$e ( `usemap$a 属性を有するものに限る) ◎ img (if the usemap attribute is present)
  • `input$e ( `type$a 属性の状態 ~NEQ `Hidden$st なるものに限る) ◎ input (if the type attribute is not in the Hidden state)
  • `label$e
  • `object$e ( `usemap$a 属性を有するものに限る) ◎ object (if the usemap attribute is present)
  • `select$e
  • `textarea$e
  • `video$e ( `controls$a 属性を有するものに限る) ◎ video (if the controls attribute is present)

`tabindex$a 属性は、どの要素も`対話的~内容$にし得る。 ◎ The tabindex attribute can also make any element into interactive content.

3.2.5.2.8. 可触~内容

一般~規則として、内容~modelにて,何らかの`~flow内容$や`句内容$が許容されるような要素は、その`内容$内に 1 個以上の[ `可触~内容$であって, `hidden$a 属性が指定されていない ]ような~nodeを持つべきである。 ◎ As a general rule, elements whose content model allows any flow content or phrasing content should have at least one node in its contents that is palpable content and that does not have the hidden attribute specified.

注記: `可触~内容$は、次のいずれかを供して要素を空でなくする:

  • 何らかの子孫
  • 空でない`~text$
  • 利用者が[ 聴ける( `audio$e 要素)/ 見れる( `video$e, `img$e, `canvas$e 要素)/ 対話できる(対話的~form~controlなど) ]ような何か
◎ Palpable content makes an element non-empty by providing either some descendant non-empty text, or else something users can hear (audio elements) or view (video or img or canvas elements) or otherwise interact with (for example, interactive form controls).

この要件は難しいものではないが、要素が正当に空になり得るような多くの事例がある。 例えば、要素が~scriptにより後で埋められるような仮入力として利用されるときや、要素は~templateの一部であって,ほとんどの頁では埋められるが,ある頁では無関係になるときなど。 ◎ This requirement is not a hard requirement, however, as there are many cases where an element can be empty legitimately, for example when it is used as a placeholder which will later be filled in by a script, or when the element is part of a template and would on most pages be filled in but on some pages is not relevant.

適合性~検査器には、この要件を充足できない要素を見出す仕組みを,作者の著作~援助として供することが奨励される。 ◎ Conformance checkers are encouraged to provide a mechanism for authors to find elements that fail to fulfill this requirement, as an authoring aid.

次の要素が `可触~内容@ ( palpable 内容, “(利用者が)触れれる内容” )とされる: ◎ The following elements are palpable content:

  • `a$e
  • `abbr$e
  • `address$e
  • `article$e
  • `aside$e
  • `audio$e ( `controls$a 属性を有するものに限る) ◎ audio (if the controls attribute is present)
  • `b$e
  • `bdi$e
  • `bdo$e
  • `blockquote$e
  • `button$e
  • `canvas$e
  • `cite$e
  • `code$e
  • `data$e
  • `details$e
  • `dfn$e
  • `div$e
  • `dl$e ( `dt^e, `dd^e ~groupを子に持つものに限る) ◎ dl (if the element's children include at least one name-value group)
  • `em$e
  • `embed$e
  • `fieldset$e
  • `figure$e
  • `footer$e
  • `form$e
  • `h1$e
  • `h2$e
  • `h3$e
  • `h4$e
  • `h5$e
  • `h6$e
  • `header$e
  • `hgroup$e
  • `i$e
  • `iframe$e
  • `img$e
  • `input$e ( `type$a 属性の状態 ~NEQ `Hidden$st なるものに限る) ◎ input (if the type attribute is not in the Hidden state)
  • `ins$e
  • `kbd$e
  • `label$e
  • `main$e
  • `map$e
  • `mark$e
  • `~MathML-math$
  • `menu$e ( 1 個以上の `li$e 要素を子に持つものに限る) ◎ menu (if the element's children include at least one li element)
  • `meter$e
  • `nav$e
  • `object$e
  • `ol$e ( 1 個以上の `li$e 要素を子に持つものに限る) ◎ ol (if the element's children include at least one li element)
  • `output$e
  • `p$e
  • `pre$e
  • `progress$e
  • `q$e
  • `ruby$e
  • `s$e
  • `samp$e
  • `section$e
  • `select$e
  • `small$e
  • `span$e
  • `strong$e
  • `sub$e
  • `sup$e
  • `~SVG-svg$
  • `table$e
  • `textarea$e
  • `time$e
  • `u$e
  • `ul$e (要素が 1 個以上の `li$e 要素を子に持つものに限る) ◎ ul (if the element's children include at least one li element)
  • `var$e
  • `video$e
  • `自律的~custom要素$
  • `~text$ (`要素間~空白$でないものに限る) ◎ text that is not inter-element whitespace
3.2.5.2.9. ~scriptを~supportする要素

`~scriptを~supportする要素@ は、それ自身は何も`表現-$しない(すなわち,具現化されない)が,例えば 利用者に機能性を供するためとして、~scriptを~supportするために利用されるものである。 ◎ Script-supporting elements are those that do not represent anything themselves (i.e. they are not rendered), but are used to support scripts, e.g. to provide functionality for the user.

次の要素が~scriptを~supportする: ◎ The following elements are script-supporting elements:

  • `script$e
  • `template$e

3.2.5.3. 透過的な内容~model

一部の要素は、その内容~modelにおいて “透過的( transparent )” と記述される部分を持つ — そのような要素は、 `透過的@ と呼ばれる。 `透過的$な要素 %要素 の内容~modelは、その親~要素の内容~modelから導出される。 すなわち、 %要素 の内容~modelにおいて “透過的” とされている所では、[ %要素 の親の内容~modelにおいて, %要素 が許容される所 ]に要求されるものと同じ要素が要求される。 ◎ Some elements are described as transparent; they have "transparent" in the description of their content model. The content model of a transparent element is derived from the content model of its parent element: the elements required in the part of the content model that is "transparent" are the same elements as required in the part of the content model of the parent of the transparent element in which the transparent element finds itself.

具体例として, `ins$e 要素は透過的であり、 `ruby$e 要素の子であるときは, `rt$e 要素を包含できない — `ruby$e 要素の内容~modelにおいて `ins$e 要素が許容される部分は,`句内容$を許容する部分であり、 `rt$e 要素は`句内容$ではないので。 ◎ For instance, an ins element inside a ruby element cannot contain an rt element, because the part of the ruby element's content model that allows ins elements is the part that allows phrasing content, and the rt element is not phrasing content.

注記: 透過的な要素が入子にされているような事例では、この処理-は反復的に適用される必要がある。 ◎ In some cases, where transparent elements are nested in each other, the process has to be applied iteratively.

次の~markup片を考える: ◎ Consider the following markup fragment:

`transparent-1^xCode

"りんご" が `a$e 要素の内側に許容されるか検査するため、内容~modelが精査される。 `a$e 要素, その親の `map$e 要素, そのまた親の `ins$e 要素の内容~modelは透過的であり、そのまた親の `object$e 要素の内容~modelにおいて `ins$e 要素が現れ得る部分もまた, “透過的” である。 `object$e 要素の親は `p$e 要素であり, `p$e の内容~modelは`句内容$であり,~textは句内容であり, "りんご" は~textであるので、 "りんご" は許容されることになる。 ◎ To check whether "Apples" is allowed inside the a element, the content models are examined. The a element's content model is transparent, as is the map element's, as is the ins element's, as is the part of the object element's in which the ins element is found. The object element is found in the p element, whose content model is phrasing content. Thus, "Apples" is allowed, as text is phrasing content.

透過的な要素が親を持たない場合、その内容~modelにおいて “透過的” な部分は,どの`~flow内容$も受容するものと扱われ~MUST。 ◎ When a transparent element has no parent, then the part of its content model that is "transparent" must instead be treated as accepting any flow content.

3.2.5.4. 段落

注記: この節に定義される用語 `段落$は、単なる `p$e 要素の定義より広い概念であり,文書をどう解釈するかを述べるために利用される。 `p$e 要素は、`段落$を~mark-upするいくつかの仕方の一つに過ぎない。 ◎ The term paragraph as defined in this section is used for more than just the definition of the p element. The paragraph concept defined here is used to describe how to interpret documents. The p element is merely one of several ways of marking up a paragraph.

`段落@ は,概して、特定0の論題をいくつかの文章で論じる`句内容$の連なりからなり,~typographyに見られるような~textの~blockを形成するが、より一般的~thematic~group分けにも利用し得る。 具体例として、~addressも段落の一種であり,[ ~form/署名行/詩の一節 ]の一部分も同様である。 ◎ A paragraph is typically a run of phrasing content that forms a block of text with one or more sentences that discuss a particular topic, as in typography, but can also be used for more general thematic grouping. For instance, an address is also a paragraph, as is a part of a form, a byline, or a stanza in a poem.

次の例には、 `section^e 内に 2 個の段落がある。 また、句内容を包含する,段落でない見出しもある。 ~commentや`要素間~空白$は、段落を形成しないことに注意。 ◎ In the following example, there are two paragraphs in a section. There is also a heading, which contains phrasing content that is not a paragraph. Note how the comments and inter-element whitespace do not form paragraphs.

`paragraph-1^xCode

`~flow内容$における段落は、文書から[ `a$e, `ins$e, `del$e, `map$e ]要素を除いたときの見かけを基準に定義される。 これらの要素の内容~modelは,混成的であり、下の最初の 2 つの例に示されるように,段落~境界を不明瞭にし得るため、問題0を複雑にするので。 ◎ Paragraphs in flow content are defined relative to what the document looks like without the a, ins, del, and map elements complicating matters, since those elements, with their hybrid content models, can straddle paragraph boundaries, as shown in the first two examples below.

注記: 一般に,要素~間の段落~境界は、不明瞭にしないのが最善である。 そのような~markupを保守するのは困難にもなり得る。 ◎ Generally, having elements straddle paragraph boundaries is best avoided. Maintaining such markup can be difficult.

次の例は、先掲の例と同じ~markupの一部分を `ins$e, `del$e 要素で括って,~textが変更されたことを示している(この~markupは、変更らしきものとは言えないが)。 この例では、 `ins$e, `del$e 要素があるにもかかわらず,先掲の例と正確に同じ段落を成すことに注意 — `ins$e 要素は,見出しと 1 個目の段落を不明瞭にしていて、 `del$e 要素は, 2 つの段落の合間の境界を不明瞭にしている。 ◎ The following example takes the markup from the earlier example and puts ins and del elements around some of the markup to show that the text was changed (though in this case, the changes admittedly don't make much sense). Notice how this example has exactly the same paragraphs as the previous one, despite the ins and del elements — the ins element straddles the heading and the first paragraph, and the del element straddles the boundary between the two paragraphs.

`paragraph-2^xCode

文書~内のすべての[ `a$e, `ins$e, `del$e, `map$e ]要素を,それぞれの`内容$に置換した結果の~DOMにおける、[ `句内容$も`句内容$以外の内容も受容する要素 ]における、[ 他の型の内容に割込まれないような,互いに同胞の`句内容$~nodeの連なり ]であって,[ `埋込みの内容$でも`要素間~空白$でもない~nodeを 1 個以上含むもの ]を考える。 元の~DOMにおける段落は、そのような各~連なりの[ 最初の~nodeの直前から, 最後の~nodeの直後まで ]に存在する(段落は,したがって[ `a$e / `ins$e / `del$e / `map$e ]要素をまたがり得る)。 ◎ Let view be a view of the DOM that replaces all a, ins, del, and map elements in the document with their contents. Then, in view, for each run of sibling phrasing content nodes uninterrupted by other types of content, in an element that accepts content other than phrasing content as well as phrasing content, let first be the first node of the run, and let last be the last node of the run. For each such run that consists of at least one node that is neither embedded content nor inter-element whitespace, a paragraph exists in the original DOM from immediately before first to immediately after last. (Paragraphs can thus span across a, ins, del, and map elements.)

適合性~検査器は、段落どうしが互いに重なる事例に際し,作者に警告してよい(これは[ `object$e / `video$e / `audio$e / `canvas$e ]要素にて起こり得る。 また,[ `~SVG-svg$ / `~MathML-math$ ]などの、その中で更なる埋込みの~HTMLを許容するような,他の名前空間に属する要素を通しても、間接的に起こり得る。 ◎ Conformance checkers may warn authors of cases where they have paragraphs that overlap each other (this can happen with object, video, audio, and canvas elements, and indirectly through elements in other namespaces that allow HTML to be further embedded therein, like SVG svg or MathML math).

`段落$はまた, `p$e 要素により明示的に形成される。 ◎ A paragraph is also formed explicitly by p elements.

注記: 互いの段落を分離するような,句内容~以外の内容がない所では、 `p$e 要素を利用して個々の段落を包装できる。 ◎ The p element can be used to wrap individual paragraphs when there would otherwise not be any content other than phrasing content to separate the paragraphs from each other.

次の例では、~linkは[ 1 個目の段落の半分, 2 個の段落を分離している見出しすべて, 2 個目の段落の半分 ]に渡る。 それは、段落と見出しを不明瞭にする。 ◎ In the following example, the link spans half of the first paragraph, all of the heading separating the two paragraphs, and half of the second paragraph. It straddles the paragraphs and the heading.

`paragraph-3^xCode

これを~mark-upする別の仕方を次に示す — 今度は、段落を明示的に示した上で, 1 個の~link要素を,3 個に分割する: ◎ Here is another way of marking this up, this time showing the paragraphs explicitly, and splitting the one link element into three:

`paragraph-4^xCode

~fallback内容を定義する,ある種の要素を利用しているときには、段落どうしが重なることもある。 例えば、次の `section^e には: ◎ It is possible for paragraphs to overlap when using certain elements that define fallback content. For example, in the following section:

`paragraph-5^xCode

次が記された, 5 個の段落がある: ◎ There are five paragraphs:

  1. "猫シミュレータで遊びませんか。 `object^i 面白いから是非! — ここで、 `object^i は `object$e 要素である。 ◎ The paragraph that says "You can play with my cat simulator. object I'm quite proud of it.", where object is the object element.
  2. "猫シミュレータは、次のリンクから遊べます:" ◎ The paragraph that says "To see the cat simulator, use one of the following links:".
  3. "シミュレータ ファイルをダウンロードする" ◎ The paragraph that says "Download simulator file".
  4. "オンライン シミュレータを~~利用する" ◎ The paragraph that says "Use online simulator".
  5. "Mellblom ブラウザは最新版にアップグレードすることをすすめます。" ◎ The paragraph that says "Alternatively, upgrade to the Mellblom Browser.".

最初の段落は、他の 4 つと重なっている。 "cats.sim" 資源を~supportする~UAは,最初のもののみを示すことになる。 一方で,~fallbackを示す~UAは、最初の段落の最初の文章を,それが 2 個目のものと同じ段落であるかのように混同して示すことになり、最後の段落を,それが最初の段落の 2 個目の文章の開始であったかのように示すことになる。 ◎ The first paragraph is overlapped by the other four. A user agent that supports the "cats.sim" resource will only show the first one, but a user agent that shows the fallback will confusingly show the first sentence of the first paragraph as if it was in the same paragraph as the second one, and will show the last paragraph as if it was at the start of the second sentence of the first paragraph.

この混同を避けるには、明示的 `p$e 要素を利用できる。 例えば: ◎ To avoid this confusion, explicit p elements can be used. For example:

`paragraph-6^xCode

3.2.6. 各種~大域的~属性

次に挙げる属性は、すべての`~HTML要素$(この仕様に定義されていないものも含む)に共通する — どの~HTML要素に指定してもよい: ◎ The following attributes are common to and may be specified on all HTML elements (even those not defined in this specification):

  • `accesskey$a
  • `autocapitalize$a
  • `contenteditable$a
  • `dir$a
  • `draggable$a
  • `hidden$a
  • `inputmode$a
  • `is$a
  • `itemid$a
  • `itemprop$a
  • `itemref$a
  • `itemscope$a
  • `itemtype$a
  • `lang$a
  • `nonce$a
  • `spellcheck$a
  • `style$a
  • `tabindex$a
  • `title$a
  • `translate$a

これらの属性は、この仕様により,`~HTML要素$のみに対する属性として定義される。 この仕様がこれらの属性を有する要素を~~参照する所では、他の名前空間に属する要素は,これらの属性を有せるものと定義されていない限り,これらの属性を有するものと見なされては~MUST_NOT。 ◎ These attributes are only defined by this specification as attributes for HTML elements. When this specification refers to elements having these attributes, elements from namespaces that are not defined as having these attributes must not be considered as being elements with these attributes.

例えば、次の~XML片における `bogus^l 要素は、~literalとして名前 `dir^l の属性を有しているが、にもかかわらず,この仕様にて定義される `dir$a 属性は有さないとされる。 したがって,~~内側の `span$e 要素の`方向性$は、 `div$e 要素から `bogus^l 要素を通して間接的に継承される結果, `~rtl$ ( `rtl^v )になる。 ◎ For example, in the following XML fragment, the "bogus" element does not have a dir attribute as defined in this specification, despite having an attribute with the literal name "dir". Thus, the directionality of the inner-most span element is 'rtl', inherited from the div element indirectly through the "bogus" element.

`global-attr-1^xCode

WHATWG DOM 標準は、名前空間を問わず,どの要素に対しても[ `class@a / `id@a / `slot@a ]属性に対する~UA要件を定義している。 `DOM$r ◎ The WHATWG DOM standard defines the user agent requirements for the class, id, and slot attributes for any element in any namespace. [DOM]

[ `class$a / `id$a / `slot$a ]属性は、どの`~HTML要素$にも指定できる。 ◎ The class, id, and slot attributes may be specified on all HTML elements.

`~HTML要素$上に指定される `class$a 属性の値は,`空白区切りの~token集合$で~MUST — 要素が属する種々の~classを表現するような。 ◎ When specified on HTML elements, the class attribute must have a value that is a set of space-separated tokens representing the various classes that the element belongs to.

注記: 要素に~classをあてがうことは、[ ~CSSにおける選択子の~class照合 / ~DOMにおける `getElementsByClassName()$m ~method / 他のその種の特色機能 ]に影響する。 ◎ Assigning classes to an element affects class matching in selectors in CSS, the getElementsByClassName() method in the DOM, and other such features.

作者が `class$a 属性に利用できる~tokenに追加の制約はないが、作者には,内容に欲される呈示ではなく,内容の資質を述べる値を利用することが奨励される。 ◎ There are no additional restrictions on the tokens authors can use in the class attribute, but authors are encouraged to use values that describe the nature of the content, rather than values that describe the desired presentation of the content.

`~HTML要素$上に指定される `id$a 属性の値は、次のいずれも満たさ~MUST:

  • 要素の`木$内のすべての要素の`~ID$にわたって一意である
  • 1 個以上の文字を包含する
  • `~ASCII空白$を包含しない
◎ When specified on HTML elements, the id attribute value must be unique amongst all the IDs in the element's tree and must contain at least one character. The value must not contain any ASCII whitespace.

注記: `id$a 属性は、要素の`~ID$(一意な識別子)を指定する。 `DOM$r ◎ The id attribute specifies its element's unique identifier (ID).

~IDがとり得る形に他の制約は無い。 特に,~IDは、[ 数字のみからなる / 数字や~underscoreから開始する / 約物のみからなる ]等々にもなり得る。 ◎ There are no other restrictions on what form an ID can take; in particular, IDs can consist of just digits, start with a digit, start with an underscore, consist of just punctuation, etc.

要素の`~ID$は、様々な目的に利用できる。 特に、[ `素片$urlを利用して 文書の特定の部位へ~linkする / ~scripting時に要素を~targetにする / 特定の要素に~CSSで~styleをあてがう ]用途が多い。 ◎ An element's unique identifier can be used for a variety of purposes, most notably as a way to link to specific parts of a document using fragments, as a way to target an element when scripting, and as a way to style a specific element from CSS.

`id$a 属性の値による識別子は、不透明な文字列であり,特定0の意味が導出されるべきでない。 ◎ Identifiers are opaque strings. Particular meanings should not be derived from the value of the id attribute.

`slot$a 属性に対しては、`~HTML要素$に特有の適合性~要件はない。 ◎ There are no conformance requirements for the slot attribute specific to HTML elements.

注記: `slot$a 属性は、要素を ある~slotに`割当する$ために利用される: `slot$a 属性を有する要素は、次を満たすような `slot$e 要素 %slot により作成される`~slot$に`割当される$ ⇒ [ %slot の `slot.name$a 属性の値は `slot$a 属性の値に合致する ]~AND[ %slot が見出される`~shadow木$の`根$の`~host$が,対応する `slot$a 属性~値を持つ【?】 ] ◎ The slot attribute is used to assign a slot to an element: an element with a slot attribute is assigned to the slot created by the slot element whose name attribute's value matches that slot attribute's value — but only if that slot element finds itself in the shadow tree whose root's host has the corresponding slot attribute value.


支援技術~製品が,~HTMLの 要素/属性 で可能0なものより木目細かい~interfaceを公開できるようにするため、 支援技術~製品~用の注釈 の集合( ARIA `role$a, `aria-*$a 属性)が指定できる/され得る。 `ARIA$r ◎ To enable assistive technology products to expose a more fine-grained interface than is otherwise possible with HTML elements and attributes, a set of annotations for assistive technology products can be specified (the ARIA role and aria-* attributes). [ARIA]


次に挙げる`~event~handler内容~属性$は、どの`~HTML要素$上にも指定されてよい: ◎ The following event handler content attributes may be specified on any HTML element:

  • `onabort$hd
  • `onauxclick$hd
  • `onblur$hd†
  • `oncancel$hd
  • `oncanplay$hd
  • `oncanplaythrough$hd
  • `onchange$hd
  • `onclick$hd
  • `onclose$hd
  • `oncontextmenu$hd
  • `oncuechange$hd
  • `ondblclick$hd
  • `ondrag$hd
  • `ondragend$hd
  • `ondragenter$hd
  • `ondragexit$hd
  • `ondragleave$hd
  • `ondragover$hd
  • `ondragstart$hd
  • `ondrop$hd
  • `ondurationchange$hd
  • `onemptied$hd
  • `onended$hd
  • `onerror$hd†
  • `onfocus$hd†
  • `oninput$hd
  • `oninvalid$hd
  • `onkeydown$hd
  • `onkeypress$hd
  • `onkeyup$hd
  • `onload$hd†
  • `onloadeddata$hd
  • `onloadedmetadata$hd
  • `onloadend$hd
  • `onloadstart$hd
  • `onmousedown$hd
  • `onmouseenter$hd
  • `onmouseleave$hd
  • `onmousemove$hd
  • `onmouseout$hd
  • `onmouseover$hd
  • `onmouseup$hd
  • `onwheel$hd
  • `onpause$hd
  • `onplay$hd
  • `onplaying$hd
  • `onprogress$hd
  • `onratechange$hd
  • `onreset$hd
  • `onresize$hd†
  • `onscroll$hd†
  • `onsecuritypolicyviolation$hd
  • `onseeked$hd
  • `onseeking$hd
  • `onselect$hd
  • `onstalled$hd
  • `onsubmit$hd
  • `onsuspend$hd
  • `ontimeupdate$hd
  • `ontoggle$hd
  • `onvolumechange$hd
  • `onwaiting$hd

注記: †付きの属性は、 `body$e 要素~上に指定されたときには,異なる意味になる — その要素は、 `Window$I ~objの同じ名前の`~event~handler$を公開するので。 ◎ The attributes marked with an asterisk have a different meaning when specified on body elements as those elements expose event handlers of the Window object with the same names.

注記: これらの属性は,すべての要素に適用されるとしても、すべての要素~上で有用になるわけではない。 例えば,~UAにより発火される `volumechange$et ~eventを受取れるのは、`媒体~要素$に限られる。 ◎ While these attributes apply to all elements, they are not useful on all elements. For example, only media elements will ever receive a volumechange event fired by the user agent.


どの `~HTML要素$上にも,`~custom~data属性$(例: `data-foldername^a, `data-msgid^a 等々)を指定して,頁に特有の[ ~custom~data, 状態, 注釈, 等々 ]を格納できる。 ◎ Custom data attributes (e.g. data-foldername or data-msgid) can be specified on any HTML element, to store custom data, state, annotations, and similar, specific to the page.


`~HTML文書$においては、`~HTML名前空間$に属する要素には, `xmlns^a 属性が指定されてよい — ただし,その値が正確に `http://www.w3.org/1999/xhtml^l である場合,その場合に限り。 このことは、`~XML文書$には適用されない。 ◎ In HTML documents, elements in the HTML namespace may have an xmlns attribute specified, if, and only if, it has the exact value "http://www.w3.org/1999/xhtml". This does not apply to XML documents.

注記: ~HTMLにおいては、 `xmlns^a 属性は,何ら効果はない。 それは、基本的に護符のようなものである。 それは単に,~HTMLと~XMLとの間の移行を容易くするために許容されている。 `~HTML構文解析器$により構文解析されるときには、この属性は どの名前空間にも属さないようにされる — ~XMLにおける名前空間~宣言~属性の様な, `http://www.w3.org/2000/xmlns/^l 名前空間ではなく。 ◎ In HTML, the xmlns attribute has absolutely no effect. It is basically a talisman. It is allowed merely to make migration to and from XML mildly easier. When parsed by an HTML parser, the attribute ends up in no namespace, not the "http://www.w3.org/2000/xmlns/" namespace like namespace declaration attributes in XML do.

注記: ~XMLにおいては、 `xmlns^a 属性は 名前空間~宣言の仕組みの一部であり,要素は[ 名前空間が指定されていない `xmlns^a 属性 ]を実際に有することはできない。 ◎ In XML, an xmlns attribute is part of the namespace declaration mechanism, and an element cannot actually have an xmlns attribute in no namespace specified.


~XML仕様はまた、`~XML文書$内のどの要素に対しても,`~XML名前空間$に属する `~xml_space$a 属性の利用を許容する。 この属性は、`~HTML要素$に対しては効果はない — ~HTMLにおける既定の挙動は,空白を保全するので。 `XML$r ◎ The XML specification also allows the use of the xml:space attribute in the XML namespace on any element in an XML document. This attribute has no effect on HTML elements, as the default behavior in HTML is to preserve whitespace. [XML]

注記: `text/html$c 構文の下で`~HTML要素$上の `~xml_space$a 属性を直列化する仕方はない。 ◎ There is no way to serialize the xml:space attribute on HTML elements in the text/html syntax.

3.2.6.1. `title^a 属性

`title@a 属性は、~tooltipに適切になるような,要素に対する助言情報を`表現-$する。 その値は~textであり:

  • ~linkにおいては、~target資源の~titleや記述にもなり得る。
  • 画像においては,画像~creditや画像の記述にもなり得る。
  • 段落においては,その~textの脚注や解説にもなり得る。
  • 引用文においては,その~sourceについての更なる情報にもなり得る。
  • `対話的~内容$においては,要素の利用についての ~labelや指示書きにもなり得る。

…等々。

◎ The title attribute represents advisory information for the element, such as would be appropriate for a tooltip. On a link, this could be the title or a description of the target resource; on an image, it could be the image credit or a description of the image; on a paragraph, it could be a footnote or commentary on the text; on a citation, it could be further information about the source; on interactive content, it could be a label for, or instructions for, use of the element; and so forth. The value is text.

注記: 現時点では、 `title$a 属性には依拠しないことが奨励される — 多くの~UAは、この属性を,この仕様に要求されるように~access可能な方式で公開していない(例:~tooltipを現れさせるために,~mouseなどの~pointing装置を要求することは、現代の携帯端末や~tabletを用いている,~keyboard/~touchのみの利用者たちを除外することになる)。 ◎ Relying on the title attribute is currently discouraged as many user agents do not expose the attribute in an accessible manner as required by this specification (e.g., requiring a pointing device such as a mouse to cause a tooltip to appear, which excludes keyboard-only users and touch-only users, such as anyone with a modern phone or tablet).

この属性が要素から省略されている場合、 `title$a 属性を有する先祖`~HTML要素$のうち最も近いものが,この要素に関連することを含意する。 この属性を設定すれば、それを上書きして,どの先祖の助言情報も この要素には関連しないことを明示的に言明することになる。 この属性を空~文字列に設定した場合、当の要素には助言情報は無いことを指示する。 ◎ If this attribute is omitted from an element, then it implies that the title attribute of the nearest ancestor HTML element with a title attribute set is also relevant to this element. Setting the attribute overrides this, explicitly stating that the advisory information of any ancestors is not relevant to this element. Setting the attribute to the empty string indicates that the element has no advisory information.

`title$a 属性の値の中の 各 LF 文字( `000A^U LINE FEED )は、改行を表現し,もしあれば、内容は複数の行に分割される。 ◎ If the title attribute's value contains U+000A LINE FEED (LF) characters, the content is split into multiple lines. Each U+000A LINE FEED (LF) character represents a line break.

`title$a 属性における改行文字の利用には、注意すべき点がある。 ◎ Caution is advised with respect to the use of newlines in title attributes.

具体例として,次の片の略称の中の改行は、実際に展開されることになる: ◎ For instance, the following snippet actually defines an abbreviation's expansion with a line break in it:

`title-1^xCode

[ `link$e, `abbr$e, `input$e ]など,要素には、 `title$a 属性に対し,上に述べた意味論を超える追加の意味論を定義するものもある。 ◎ Some elements, such as link, abbr, and input, define additional semantics for the title attribute beyond the semantics described above.

要素の %要素 の `助言情報@ は、次の~algoが返す値である — 結果が空~文字列の場合、助言情報はない: ◎ The advisory information of an element is the value that the following algorithm returns, with the algorithm being aborted once a value is returned. When the algorithm returns the empty string, then there is no advisory information.

  1. ~IF[ %要素 は `title$a 属性を有する ] ⇒ ~RET その属性~値 ◎ If the element has a title attribute, then return its value.
  2. ~IF[ %要素 には親~要素がある ] ⇒ ~RET 親~要素の`助言情報$ ◎ If the element has a parent element, then return the parent element's advisory information.
  3. ~RET 空~文字列 ◎ Return the empty string.

~UAは、要素に`助言情報$があるときには,そのことが利用者に判るように伝えるべきである。 ◎ User agents should inform the user when elements have advisory information, otherwise the information would not be discoverable.


`title@mE
此れの `title$a 内容~属性を`反映-$し~MUST。 ◎ The title IDL attribute must reflect the title content attribute.

3.2.6.2. `lang^a 属性, `~xml_lang^a 属性

どの名前空間にも属さない `lang^a 属性 — 以下、 `素の~lang属性@ と略記する — は、[ 要素の内容, および ~textを包含するような要素の属性 ]に対する第一~言語†を指定する。 その値は妥当な BCP 47 言語~tagか, 空~文字列で~MUST。 空~文字列は、第一~言語が未知であることを指示する。 `BCP47$r ◎ The lang attribute (in no namespace) specifies the primary language for the element's contents and for any of the element's attributes that contain text. Its value must be a valid BCP 47 language tag, or the empty string. Setting the attribute to the empty string indicates that the primary language is unknown. [BCP47]

【† この節の “言語” は、もっぱら自然言語(人が話す言語)を意味する。 】

`~XML名前空間$に属する `lang^a 属性 — 以下 `~XML~lang属性@ と略記する — は、~XMLにて定義される。 `XML$r ◎ The lang attribute in the XML namespace is defined in XML. [XML]

要素からこれらの属性が省略された場合、この要素の言語は,その親~要素があれば それの言語と同じになる。 ◎ If these attributes are omitted from an element, then the language of this element is the same as the language of its parent element, if any.

`素の~lang属性$は、どの`~HTML要素$にも利用してよい。 ◎ The lang attribute in no namespace may be used on any HTML element.

`~XML~lang属性$は、他の名前空間に属する要素のみならず,`~XML文書$内の`~HTML要素$にも利用できる — 関連する仕様がそれを許容するならば(特に, MathML, ~SVGは、それらの要素~上に指定される`~XML~lang属性$を許容する)。 同じ要素~上に[ `素の~lang属性$, `~XML~lang属性$ ]の両者が指定されている場合、それらは,`~ASCII大小無視$で正確に同じ値をとら~MUST。 ◎ The lang attribute in the XML namespace may be used on HTML elements in XML documents, as well as elements in other namespaces if the relevant specifications allow it (in particular, MathML and SVG allow lang attributes in the XML namespace to be specified on their elements). If both the lang attribute in no namespace and the lang attribute in the XML namespace are specified on the same element, they must have exactly the same value when compared in an ASCII case-insensitive manner.

作者は、`~HTML文書$内の`~HTML要素$に,`~XML~lang属性$を利用しては~MUST_NOT。 ~XMLへの/からの移行を容易くするため、作者は,`~HTML文書$内の`~HTML要素$に対しては、[ 要素~上に,`素の~lang属性$も指定されている ]場合に限り,次をすべて満たす属性を指定してよい:

  • 接頭辞を持たない
  • ~literalとして `~xml_lang^l を局所名に持つ
  • どの名前空間にも属さない
  • その値は,素の~lang属性の値と`~ASCII大小無視$で同じある
◎ Authors must not use the lang attribute in the XML namespace on HTML elements in HTML documents. To ease migration to and from XML, authors may specify an attribute in no namespace with no prefix and with the literal localname "xml:lang" on HTML elements in HTML documents, but such attributes must only be specified if a lang attribute in no namespace is also specified, and both attributes must have the same value when compared in an ASCII case-insensitive manner.

注記: そのような属性が、言語~処理に効果を及ぼすことはない。 ◎ The attribute in no namespace with no prefix and with the literal localname "xml:lang" has no effect on language processing.


~UAは、~node %~nodeの `言語@ を決定するときは、次の手続きから返される言語~tag値に基づか~MUST: ◎ To determine the language of a node, user agents must\

  1. %要素 ~LET [ %~node は要素ならば %~node / ~ELSE_ %~node の親~要素 ] ◎ ↓
  2. ~IF[ %要素 の`広義~先祖$に,次のいずれかを満たすものがある ]…:

    • `~XML~lang属性$を有する
    • `~HTML要素$であって `素の~lang属性$を有する

    …ならば:

    1. %先祖 ~LET そのような要素のうち %要素 に最も近いもの
    2. ~IF[ %先祖 は`~XML~lang属性$を有する ] ⇒ ~RET その属性の値 — `素の~lang属性$は、有していても`無視-$する。
    3. ~RET %先祖 の`素の~lang属性$の値
    ◎ look at the nearest ancestor element (including the element itself if the node is an element) that has a lang attribute in the XML namespace set or is an HTML element and has a lang in no namespace attribute set. That attribute specifies the language of the node (regardless of its value). ◎ If both the lang attribute in no namespace and the lang attribute in the XML namespace are set on an element, user agents must use the lang attribute in the XML namespace, and the lang attribute in no namespace must be ignored for the purposes of determining the element's language.
  3. ~IF[ `~pragma集合の既定の言語$が設定されている ] ⇒ ~RET それに対応する言語~tag ◎ If node's inclusive ancestors do not have either attribute set, but there is a pragma-set default language set, then that is the language of the node.\
  4. ~IF[ より高~levelの~protocol(~HTTPなど)から,単独の言語~情報が報告されている ] ⇒ ~RET それに対応する言語~tag ◎ If there is no pragma-set default language set, then language information from a higher-level protocol (such as HTTP), if any, must be used as the final fallback language instead.\
  5. ~RET 空~文字列 — ~nodeの言語は未知とされる。 より高~levelの~protocolから複数の言語が報告されている場合も含む。 ◎ In the absence of any such language information, and in cases where the higher-level protocol reports multiple languages, the language of the node is unknown, and the corresponding language tag is the empty string.

上の結果が認識できる言語~tagでない場合、~UAは,結果を,その言語~tagを持つ未知の — 他のすべての言語とは別個の — 言語として扱わ~MUST。 言語~tagを期待する,往来や他の~serviceとの通信の目的においては、未知の言語~tagを改変せずに渡すべきであり、後続の~serviceが,その~dataを別の型の言語~記述として解釈しないように BCP 47 言語~tagであるものと~tag付けるべきである。 `BCP47$r ◎ If the resulting value is not a recognized language tag, then it must be treated as an unknown language having the given language tag, distinct from all other languages. For the purposes of round-tripping or communicating with other services that expect language tags, user agents should pass unknown language tags through unmodified, and tagged as being BCP 47 language tags, so that subsequent services do not interpret the data as another type of language description. [BCP47]

したがって,具体例として、 `lang="xyzzy"^a を伴う要素は、(例えば~CSSにより)選択子 `:lang(xyzzy)^css に合致するが, `:lang(abcde)^css には合致しない — 両者とも等しく妥当でないが。 同様に、~Web~browserと~screen-readerが,要素の言語について~~情報を~~交換しあっている下では、~browserは,[ 妥当でないと知っていたとしても,言語は `xyzzy^l であった ]ものと~screen-readerに伝えることになる — ~screen-readerが,実際に その~tagの言語を~supportしている場合もあり得るので。 ~screen-readerが、 BCP 47 に加えて,別の構文による言語~名の符号化法も~supportしていて,そこでは文字列 `xyzzy^l が~Belarusianの言語~tagであったとしても、~screen-readerが~textを~Belarusianとして扱い始めるのは,不正になる — `xyzzy^l は, BCP 47 ~codeにおいては~Belarusianとされていないので( BCP 47 は、~Belarusianに~code `be^l を利用する)。 ◎ Thus, for instance, an element with lang="xyzzy" would be matched by the selector :lang(xyzzy) (e.g. in CSS), but it would not be matched by :lang(abcde), even though both are equally invalid. Similarly, if a Web browser and screen reader working in unison communicated about the language of the element, the browser would tell the screen reader that the language was "xyzzy", even if it knew it was invalid, just in case the screen reader actually supported a language with that tag after all. Even if the screen reader supported both BCP 47 and another syntax for encoding language names, and in that other syntax the string "xyzzy" was a way to denote the Belarusian language, it would be incorrect for the screen reader to then start treating text as Belarusian, because "xyzzy" is not how Belarusian is described in BCP 47 codes (BCP 47 uses the code "be" for Belarusian).

上の結果が空~文字列の場合、~nodeの言語は 明示的に未知であるものと解釈され~MUST。 ◎ If the resulting value is the empty string, then it must be interpreted as meaning that the language of the node is explicitly unknown.


~UAは、要素の言語を,適正な処理や具現化を決定する際に利用してよい(例えば、適切な[ ~font/発音/辞書 ]の選定や、日付~~選択などの~form~control~UIなど)。 ◎ User agents may use the element's language to determine proper processing or rendering (e.g. in the selection of appropriate fonts or pronunciations, for dictionary selection, or for the user interfaces of form controls such as date pickers).


`lang@m
此れの`素の~lang属性$を`反映-$し~MUST。 ◎ The lang IDL attribute must reflect the lang content attribute in no namespace.

3.2.6.3. `translate^a 属性

`translate@a 属性は、`列挙~属性$であり,当の要素の[ 属性~値/ 子である `Text$I ~nodeの値 ]を[ 頁を地域化する際に,翻訳するか, 変えないままにするかどうか ]を指定するために利用される。 ◎ The translate attribute is an enumerated attribute that is used to specify whether an element's attribute values and the values of its Text node children are to be translated when the page is localized, or whether to leave them unchanged.

この属性がとり得る~keyword, および状態は、次で与えられる:

空~文字列
`yes^v
`yes^st 状態に対応付けられる。
`no^v
`no^st 状態に対応付けられる。
`値なし用の既定$
`妥当でない値~用の既定$
`inherit^st 状態に対応付けられる。
◎ The attribute's keywords are the empty string, yes, and no. The empty string and the yes keyword map to the yes state. The no keyword maps to the no state. In addition, there is a third state, the inherit state, which is the missing value default and the invalid value default.

各~要素は(非~HTML要素であっても), `翻訳~mode@ を持つ。 それは[ `翻訳可能$st, `翻訳不可$st ]のいずれかであり、要素の `translate$a 属性の状態に応じて,次のようになる: ◎ Each element (even non-HTML elements) has a translation mode, which is in either the translate-enabled state or the no-translate state.\

  • `yes^st ならば、`翻訳可能$st ◎ If an HTML element's translate attribute is in the yes state, then the element's translation mode is in the translate-enabled state;\
  • `no^st ならば、`翻訳不可$st ◎ otherwise, if the element's translate attribute is in the no state, then the element's translation mode is in the no-translate state.\
  • `inherit^st ならば、要素に親~要素が[ あれば 親と同じ状態 / なければ(要素は`文書~要素$)`翻訳可能$st ]になる。

    要素が`~HTML要素$でない場合も、 `translate$a 属性を有さないので,この場合に該当する。

    ◎ Otherwise, either the element's translate attribute is in the inherit state, or the element is not an HTML element and thus does not have a translate attribute; in either case, the element's translation mode is in the same state as its parent element's, if any, or in the translate-enabled state, if the element is a document element.

要素の`翻訳~mode$に応じて: ◎ ↓

  • `翻訳可能@st の下では、[ 要素の`翻訳-可能な属性$, および 要素の子である `Text$I ~nodeの値 ]は,頁が地域化される際に翻訳されることになる。 ◎ When an element is in the translate-enabled state, the element's translatable attributes and the values of its Text node children are to be translated when the page is localized.
  • `翻訳不可@st の下では、[ 要素の属性~値, および 要素の子である `Text$I ~nodeの値 ]は,頁が地域化される際に そのままにされる — 例えば、要素は,人名や~computer~programの名前を包含しているとき。 ◎ When an element is in the no-translate state, the element's attribute values and the values of its Text node children are to be left as-is when the page is localized, e.g. because the element contains a person's name or a name of a computer program.

次の表の 1 列目に挙げる要素~上の,同じ行の 2 列目に示される(かつ 3 列目の条件があれば,それも満たす)属性が `翻訳-可能な属性@ とされる: ◎ The following attributes are translatable attributes:

要素 内容~属性 追加の条件/要件
`th$e `th.abbr$a
`area$e `area.alt$a
`img$e `img.alt$a
`input$e `input.alt$a
`meta$e `meta.content$a 要素の `meta.name$a 属性の値が,翻訳-可能なことが既知である~metadata名を指定する場合に限る。
`a$e, `area$e `download$a
`optgroup$e `optgroup.label$a
`option$e `option.label$a
`track$e `track.label$a
`~HTML要素$ `lang$a 翻訳に利用されている言語に合致するように “翻訳され” ~MUST。
`input$e `input.placeholder$a
`textarea$e `textarea.placeholder$a
`iframe$e `srcdoc$a 属性は、構文解析された上で,再帰的に処理され~MUST。
`~HTML要素$ `style$a 属性は、構文解析された上で,再帰的に処理され~MUST。 (例: `content$p ~propの値に対し)
すべての`~HTML要素$ `title$a
`input$e `value$a 要素の `type$a 属性の状態 ~IN { `Button$st, `Reset$st } の場合に限る。
◎ • abbr on th elements • alt on area, img, and input elements • content on meta elements, if the name attribute specifies a metadata name whose value is known to be translatable • download on a and area elements • label on optgroup, option, and track elements • lang on HTML elements; must be "translated" to match the language used in the translation • placeholder on input and textarea elements • srcdoc on iframe elements; must be parsed and recursively processed • style on HTML elements; must be parsed and recursively processed (e.g. for the values of 'content' properties) • title on all HTML elements • value on input elements with a type attribute in the Button state or the Reset Button state

他の仕様も他の属性を`翻訳-可能な属性$として定義してよい。 例えば, ARIA は、 `aria-label$a 属性を翻訳-可能として定義するであろう。 ◎ Other specifications may define other attributes that are also translatable attributes. For example, ARIA would define the aria-label attribute as translatable.


`translate@m
取得子は、[ 此れの`翻訳~mode$ ~EQ `翻訳可能$st ならば ~T / ~ELSE_ ~F ]を返さ~MUST。 ◎ The translate IDL attribute must, on getting, return true if the element's translation mode is translate-enabled, and false otherwise.\
設定子は、此れの `translate$a 内容~属性の値を[ 所与の値 ~EQ ~T ならば `yes^l / ~ELSE_ `no^l ]に設定し~MUST。 ◎ On setting, it must set the content attribute's value to "yes" if the new value is true, and set the content attribute's value to "no" otherwise.

この例では、[ 見本~keyboard入力,見本~program出力 ]を除く,文書~内のすべては、頁が地域化される際に翻訳される: ◎ In this example, everything in the document is to be translated when the page is localized, except the sample keyboard input and sample program output:

<!DOCTYPE HTML>
<html lang="en"> <!-- 文書~要素~上では `translate=yes^a -->
 <head>
  <title>The Bee Game</title> <!-- 先祖から暗黙的に `translate=yes^a が継承される -->
 </head>
 <body>
  <p>The Bee Game is a text adventure game in English.</p>
  <p>When the game launches, the first thing you should do is type
  <kbd translate=no>eat honey</kbd>. The game will respond with:</p>
  <pre><samp translate=no>Yum yum! That was some good honey!</samp></pre>
 </body>
</html>

3.2.6.4. `dir^a 属性

`dir$a 属性は、要素の~text方向性を指定する。 この属性は`列挙~属性$であり,次の~keyword, 状態をとり得る: ◎ The dir attribute specifies the element's text directionality. The attribute is an enumerated attribute with the following keywords and states:

`ltr@v ( “left-to-right” )
`~ltr@st 状態に対応付けられる。 ◎ The ltr keyword, which maps to the ltr state
要素の内容は、明示的に,左横書き~textとして方向的に隔離されることを指示する。 ◎ Indicates that the contents of the element are explicitly directionally isolated left-to-right text.
`rtl@v ( “right-to-left” )
`~rtl@st 状態に対応付けられる。 ◎ The rtl keyword, which maps to the rtl state
要素の内容は、明示的に,右横書き~textとして方向的に隔離されることを指示する。 ◎ Indicates that the contents of the element are explicitly directionally isolated right-to-left text.
`auto@v
`自動@st 状態に対応付けられる。 ◎ The auto keyword, which maps to the auto state
要素の内容は、明示的に,方向的に隔離される~textであること、および その方向は,当の要素の内容を利用して,(下に述べるように)~program的に決定されることを指示する。 ◎ Indicates that the contents of the element are explicitly directionally isolated text, but that the direction is to be determined programmatically using the contents of the element (as described below).
注記: この状態の下で利用される経験則は、ごく荒削りなものである(それは、双向algoにおける Paragraph Level 決定に相似的な方式で,強い方向性†を備える最初の文字を見るだけである)。 作者には、当の~textの方向が まったく未知で,適用できる より良い~server側~経験則もないときの,最後の~~手段としてのみ、この値を利用することが督促される。 `BIDI$r ◎ The heuristic used by this state is very crude (it just looks at the first character with a strong directionality, in a manner analogous to the Paragraph Level determination in the bidirectional algorithm). Authors are urged to only use this value as a last resort when the direction of the text is truly unknown and no better server-side heuristic can be applied. [BIDI]
【† `双向-字種$の大分類が `Strong^uc に該当する文字。 概ね、文字~自身から,それを利用している~textの方向性を推定できるような文字 — ~Arabicのみに利用される文字であれば、右横書き,等々。 】
【 この節に現れる `双向-字種@ とは、 Unicode bidirectional character type を指す。 】
注記: `textarea$e / `pre$e 要素に対しては、この経験則は,段落ごとの~levelで適用される。 ◎ For textarea and pre elements, the heuristic is applied on a per-paragraph level.
`妥当でない値~用の既定$
`値なし用の既定$
`未定義@st 状態に対応付けられる。 ◎ The attribute has no invalid value default and no missing value default.
【 この状態~値は、以下を簡潔に訳すために,この訳で非公式に導入したものである。 原文においては、これらは “ない” ものと定義されている。 】

要素(`~HTML要素$でない要素も含む) %要素 の `方向性@ は、[ `~ltr@, `~rtl@ ]のいずれかであり,次の手続きに従って決定される: ◎ The directionality of an element (any element, not just an HTML element) is either 'ltr' or 'rtl', and is determined as per the first appropriate set of steps from the following list:

  1. %状態 ~LET %要素 の `dir$a 属性の状態 ◎ ↓
  2. ~IF[ %状態 ~EQ `~ltr$st ] ⇒ ~RET `~ltr$ ◎ If the element's dir attribute is in the ltr state • ↓
  3. ~IF[ %状態 ~EQ `未定義$st ]~AND[ 次のいずれかが満たされる ]…:

    • %要素 は`文書~要素$である
    • [ %要素 は `input$e 要素である ]~AND[ %要素 の `type$a 属性の状態 ~EQ `Tel$st ]

    …ならば ⇒ ~RET `~ltr$

    ◎ If the element is a document element and the dir attribute is not in a defined state (i.e. it is not present or has an invalid value) ◎ If the element is an input element whose type attribute is in the Telephone state, and the dir attribute is not in a defined state (i.e. it is not present or has an invalid value) ◎ • The directionality of the element is 'ltr'.
  4. ~IF[ %状態 ~EQ `~rtl$st ] ⇒ ~RET `~rtl$ ◎ If the element's dir attribute is in the rtl state • The directionality of the element is 'rtl'.
  5. ~IF[ %状態 ~EQ `自動$st ]~AND[ 次のいずれかが満たされる ]…: ◎ ↓

    • [ %要素 は `input$e 要素である ]~AND[ %要素 の `type$a 属性の状態 ~IN { `Text$st, `Search$st, `Tel$st, `Url$st, `Email$st } ] ◎ If the element is an input element whose type attribute is in the Text, Search, Telephone, URL, or E-mail state, and the dir attribute is in the auto state
    • %要素 は `textarea$e 要素である ◎ If the element is a textarea element and the dir attribute is in the auto state

    …ならば:

    1. %文字列 ~LET %要素 の`値$x ◎ ↓
    2. ~IF[ %文字列 内に[ `双向-字種$ ~IN { `L^uc, `AL^uc, `R^uc } ]なる文字がある `BIDI$r ] ⇒ ~IF[ そのような最初の文字の`双向-字種$ ~NEQ `L^uc ] ⇒ ~RET `~rtl$ ◎ If the element's value contains a character of bidirectional character type AL or R, and there is no character of bidirectional character type L anywhere before it in the element's value, then the directionality of the element is 'rtl'. [BIDI]
    3. ~IF[ %文字列 ~NEQ 空~文字列 ]~OR[ %要素 は`文書~要素$である ] ⇒ ~RET `~ltr$ ◎ Otherwise, if the element's value is not the empty string, or if the element is a document element, the directionality of the element is 'ltr'.
    4. ~RET %要素 の親~要素の`方向性$ ◎ Otherwise, the directionality of the element is the same as the element's parent element's directionality.
  6. ~IF[ 次のいずれかが満たされる ]…:

    • %状態 ~EQ `自動$st ◎ If the element's dir attribute is in the auto state
    • [ %状態 ~EQ `未定義$st ]~AND[ %要素 は `bdi$e 要素である ] ◎ If the element is a bdi element and the dir attribute is not in a defined state (i.e. it is not present or has an invalid value)

    …ならば:

    1. %文字 ~LET 次のいずれも満たす文字のうち,`木~順序$で最初のもの: ◎ Find the first character in tree order that matches the following criteria:

      • %文字 は[ %要素 のある子孫 `Text$I ~node %T ]内にある ◎ The character is from a Text node that is a descendant of the element whose directionality is being determined.
      • %文字 の`双向-字種$ ~IN { `L^uc, `AL^uc, `R^uc } `BIDI$r ◎ The character is of bidirectional character type L, AL, or R. [BIDI]
      • %T の先祖であって, %要素 の子孫でもある,どの要素も: ◎ The character is not in a Text node that has an ancestor element that is a descendant of the element whose directionality is being determined and that is either:

        • [ `bdi$e / `script$e / `style$e / `textarea$e ]要素でない, かつ ◎ • A bdi element. • A script element. • A style element. • A textarea element.
        • その `dir$a 属性の状態 ~EQ `未定義$st ◎ An element with a dir attribute in a defined state.
    2. ~IF[ そのような %文字 はある ] ⇒ ~RET %文字 の`双向-字種$ に応じて ⇒ `AL^uc, `R^uc ならば `~rtl$ / `L^uc ならば `~ltr$ ◎ If such a character is found and it is of bidirectional character type AL or R, the directionality of the element is 'rtl'. ◎ If such a character is found and it is of bidirectional character type L, the directionality of the element is 'ltr'.
    3. ~IF[ %要素 は`文書~要素$である ] ⇒ ~RET `~ltr$ ◎ Otherwise, if the element is a document element, the directionality of the element is 'ltr'.
    4. ~RET %要素 の親~要素の`方向性$ ◎ Otherwise, the directionality of the element is the same as the element's parent element's directionality.
  7. ~ELSE( [ %状態 ~EQ `未定義$st ]~AND[ %要素 には親~要素がある ]) ⇒ ~RET %要素 の親~要素の`方向性$ ◎ If the element has a parent element and the dir attribute is not in a defined state (i.e. it is not present or has an invalid value) • The directionality of the element is the same as the element's parent element's directionality.

注記: `dir$a 属性は`~HTML要素$に対してのみ定義されているので、他の名前空間に属する要素は,それを有することはなく,自身の`方向性$を,親~要素から継承するか, 親がなければ既定の`~ltr$になる。 ◎ Since the dir attribute is only defined for HTML elements, it cannot be present on elements from other namespaces. Thus, elements from other namespaces always just inherit their directionality from their parent element, or, if they don't have one, default to 'ltr'.

注記: この属性には、 双向algoを孕むような具現化~要件が課される。 ◎ This attribute has rendering requirements involving the bidirectional algorithm.


`~HTML要素$ %要素 の `属性の方向性@ は、その属性 %属性 の~textが ある方式で具現化されるときに利用され,次の手続きにより決定される: ◎ The directionality of an attribute of an HTML element, which is used when the text of that attribute is to be included in the rendering in some manner, is determined as per the first appropriate set of steps from the following list:

  1. ~IF[ %属性 は`方向性有りの属性$である ]~AND[ %要素 の `dir$a 属性の状態 ~EQ `自動$st ]: ◎ If the attribute is a directionality-capable attribute and the element's dir attribute is in the auto state

    1. ~IF[ %属性 の値~内に,[ `双向-字種$ ~IN { `L^uc, `AL^uc, `R^uc } ]なる文字がある ]] ⇒ ~IF[[ そのような文字のうち,(論理的~順序で)最初の文字 ]の`双向-字種$ ~NEQ `L^uc ] ⇒ ~RET `~rtl$ `BIDI$r ◎ Find the first character (in logical order) of the attribute's value that is of bidirectional character type L, AL, or R. [BIDI] ◎ If such a character is found and it is of bidirectional character type AL or R, the directionality of the attribute is 'rtl'.
    2. ~RET `~ltr$ ◎ Otherwise, the directionality of the attribute is 'ltr'.
  2. ~RET %要素 の`方向性$ ◎ Otherwise ◎ The directionality of the attribute is the same as the element's directionality.

次の表の左列に挙げる要素~上の,同じ行の右列に挙げる属性は、 `方向性有りの属性@ とされる:

要素 内容~属性
`th$e `th.abbr$a
`area$e `area.alt$a
`img$e `img.alt$a
`input$e `input.alt$a
`meta$e `meta.content$a†
`optgroup$e `optgroup.label$a
`option$e `option.label$a
`track$e `track.label$a
`input$e `input.placeholder$a
`textarea$e `textarea.placeholder$a
すべての`~HTML要素$ `title$a

† 要素~上の `meta.name$a 属性が~metadata名を指定していて,その値は 機械からではなく人から読まれる用途が第一に意図されている場合に限る。

◎ The following attributes are directionality-capable attributes: • abbr on th elements • alt on area, img, and input elements • content on meta elements, if the name attribute specifies a metadata name whose value is primarily intended to be human-readable rather than machine-readable • label on optgroup, option, and track elements • placeholder on input and textarea elements • title on all HTML elements

%document . `dir$m [ = %value ]
`~html要素$があって,その `dir$a 属性を有するならば、その値を返す。 ◎ Returns the html element's dir attribute's value, if any.
設定して,`~html要素$ の `dir$a 属性の値を[ `ltr^l, `rtl^l, `auto^l ]のいずれかに置換できる。 ◎ Can be set, to either "ltr", "rtl", or "auto" to replace the html element's dir attribute's value.
`~html要素$がなければ, 空~文字列を返す / 所与の %value は無視される。 ◎ If there is no html element, returns the empty string and ignores new values.
要素~上の `dir@mE
`既知の値のみに制限される$下で,此れの `dir$a 内容~属性を`反映-$し~MUST。 ◎ The dir IDL attribute on an element must reflect the dir content attribute of that element, limited to only known values.
`文書$上の `dir@m
此れの`~html要素$ %~html ~NEQ ~NULL ならば ⇒ `既知の値のみに制限される$下で, %~html の `dir$a 内容~属性を`反映-$し~MUST。 ◎ The dir IDL attribute on Document objects must reflect the dir content attribute of the html element, if any, limited to only known values.\

他の場合:

  • 取得子は、空~文字列を返さ~MUST。
  • 設定子は、何もしては~MUST_NOT。
◎ If there is no such element, then the attribute must return the empty string and do nothing on setting.

注記: 作者には、~text方向を指示するときは,~CSSを利用するのではなく, `dir$a 属性を利用することが強く奨励される。 その仕方であれば、~CSSが不在のときでも(例: 検索~engineに解釈されるとき),文書は正しく具現化し続けられるようになるので。 ◎ Authors are strongly encouraged to use the dir attribute to indicate text direction rather than using CSS, since that way their documents will continue to render correctly even in the absence of CSS (e.g. as interpreted by search engines).

この~markup片は、 Instant messaging による会話のものである: ◎ This markup fragment is of an IM conversation.

`dir-1^xCode

`p$e 要素に対し,相応しい~stylesheet, および 既定の整列~style — すなわち,~textを段落の始端辺に整列する — が与えられた下では、結果の描画は次のようにもなる: ◎ Given a suitable style sheet and the default alignment styles for the p element, namely to align the text to the start edge of the paragraph, the resulting rendering could be as follows:

各~段落は,別々の~blockとして描画され、 2 番目と最後の段落は右寄せに,他は左寄せにされる。各~段落の先頭の利用者名(この例では 'Student' , 'Teacher' )は、右寄せの段落では右端に接合され, その左に~colon, その左に~textが来る。/ Each paragraph rendered as a separate block, with the paragraphs left-aligned except the second paragraph and the last one, which would  be right aligned, with the usernames ('Student' and 'Teacher' in this example) flush right, with a colon to their left, and the text first to the left of that.

先に注記したように, `dir.auto$a 値は万能ではない。 この例における~~最後の段落は,~Arabic文字から始まるので、右横書き~textに誤解釈され, "right?" を~Arabic~textの左側に置く。 ◎ As noted earlier, the auto value is not a panacea. The final paragraph in this example is misinterpreted as being right-to-left text, since it begins with an Arabic character, which causes the "right?" to be to the left of the Arabic text.

3.2.6.5. `style^a 属性

`style$a 内容~属性はすべての`~HTML要素$に設定できる。 これは、 CSS Styling Attribute Syntax `CSSATTR$r 仕様に定義される,`~style属性$である。 ◎ All HTML elements may have the style content attribute set. This is a style attribute as defined by the CSS Style Attributes specification. [CSSATTR]

~CSSを~supportする~UAは:

  • `要素$ %要素 に この属性が追加された, あるいは その値が変更されたときには、`~style属性$に課される規則に則って,属性の値を構文解析し~MUST。 `CSSATTR$r ◎ In user agents that support CSS, the attribute's value must be parsed when the attribute is added or has its value changed, according to the rules given for style attributes. [CSSATTR]
  • ただし,[ ( %要素, `style attribute^l, 属性の値 ) を与える下で,[ `要素の~inline挙動は~CSPにより阻止されるべきか?$を実行した結果 ] ~EQ `~Blocked^i ]になる場合、この属性の値により定義される~style規則を %要素 に適用しては~MUST_NOT。 `CSP$r ◎ However, if the Should element's inline behavior be blocked by Content Security Policy? algorithm returns "Blocked" when executed upon the attribute's element, "style attribute", and the attribute's value, then the style rules defined in the attribute's value must not be applied to the element. [CSP]

要素~上で `style$a 属性を利用する文書は、それらの属性が除去されても,依然として理解でき, 利用でき~MUST。 ◎ Documents that use style attributes on any of their elements must still be comprehensible and usable if those attributes were removed.

注記: 特に, `style$a 属性を利用して内容を隠す/示す, あるいは[ さもなければ文書~内に含まれないような意味を伝達する ]ものは、適合でない。 (内容を隠す/示すときは、 `hidden$a 属性を利用せよ。) ◎ In particular, using the style attribute to hide and show content, or to convey meaning that is otherwise not included in the document, is non-conforming. (To hide and show content, use the hidden attribute.)


%element . `style$m
要素の `style$a 属性に対する `CSSStyleDeclaration$I ~objを返す。 ◎ Returns a CSSStyleDeclaration object for the element's style attribute.
`style@m
CSSOM( CSS Object Model )仕様 `CSSOM$r に定義される。 ◎ The style IDL attribute is defined in the CSS Object Model (CSSOM) specification. [CSSOM]

次の例では、色を指す単語が,視覚的~媒体において関連する色で示されるようにするため、 `span$e 要素と `style$a 属性を利用して~mark-upされている: ◎ In the following example, the words that refer to colors are marked up using the span element and the style attribute to make those words show up in the relevant colors in visual media.

`style-1^xCode

3.2.6.6. `data-*^a 属性による~custom不可視~dataの埋込み

`~custom~data属性@ は、どの名前空間にも属さない属性であって,その名前が次のいずれも満たすものである:

  • 文字列 "`data-@a" で開始される
  • `data-^l の後に 1 個以上の文字がある
  • `~XML互換$である
  • `~ASCII英大文字$を包含しない
◎ A custom data attribute is an attribute in no namespace whose name starts with the string "data-", has at least one character after the hyphen, is XML-compatible, and contains no ASCII upper alphas.

注記: `~HTML文書$においては、`~HTML要素$上のすべての属性~名は 自動的に~ASCII小文字~化されるので,~ASCII英大文字の制約は影響しない。 ◎ All attribute names on HTML elements in HTML documents get ASCII-lowercased automatically, so the restriction on ASCII uppercase letters doesn't affect such documents.

`~custom~data属性$は、適切な属性や要素が無いような,[ 頁/~app ]に私的な[ ~custom~data, 状態, 注釈, 等々 ]を格納するために意図されている。 ◎ Custom data attributes are intended to store custom data, state, annotations, and similar, private to the page or application, for which there are no more appropriate attributes or elements.

これらの属性は、それを利用する~siteの管理者に既知でない~software用途に意図されるものではない。 複数の独立な~tool用の汎用的な拡張のためには、この仕様が拡張されて,その種の特色機能が明示的に供されるようになるか,または `~microdata$の様な(標準~化された語彙を伴う)技術が利用されるべきである。 ◎ These attributes are not intended for use by software that is not known to the administrators of the site that uses the attributes. For generic extensions that are to be used by multiple independent tools, either this specification should be extended to provide the feature explicitly, or a technology like microdata should be used (with a standardized vocabulary).

具体例として,音楽~siteは、~album内の各~曲を表現する一連の~list~itemに,曲の長さを包含する~custom~data属性で注釈することもできる。 ~site自身は、この情報を,利用者が~listを 曲の長さで~sortしたり, ある長さの曲に絞込むことを可能にする用途に利用できる。 ◎ For instance, a site about music could annotate list items representing tracks in an album with custom data attributes containing the length of each track. This information could then be used by the site itself to allow the user to sort the list by track length, or to filter the list for tracks of certain lengths.

`data-1^xCode

しかしながら,利用者がその音楽~siteに結付けられてない汎用~softwareを利用して,この~dataに基づいて,ある長さの曲を検索するような用途は、適切でなくなる。 ◎ It would be inappropriate, however, for the user to use generic software not associated with that music site to search for tracks of a certain length by looking at this data.

これらの属性は、公共用途の~metadata用の汎用的な拡張の仕組みではなく,~siteの自前の~script用途に意図されているので。 ◎ This is because these attributes are intended for use by the site's own scripts, and are not a generic extension mechanism for publicly-usable metadata.

同様に,頁~作者は、利用を意図する翻訳~tool用の情報を供する~markupを書くこともある: ◎ Similarly, a page author could write markup that provides information for a translation tool that they are intending to use:

`data-2^xCode

この例における `data-mytrans-de^a 属性は、句 "claim" を~Germanに翻訳するときに,利用する MyTrans 製品に特有の~textを与えている。 しかしながら,[ “HTML” については,すべての言語にわたり変えずにおく ]ことを伝えるために、標準の `translate$a 属性が利用されている。 標準の属性が可用なときは、`~custom~data属性$を利用する必要はない。 ◎ In this example, the "data-mytrans-de" attribute gives specific text for the MyTrans product to use when translating the phrase "claim" to German. However, the standard translate attribute is used to tell it that in all languages, "HTML" is to remain unchanged. When a standard attribute is available, there is no need for a custom data attribute to be used.

次の例では、~custom~data属性を利用して,`PaymentRequest$I 特色機能を検出した結果を格納している。 それを利用して,検査後の頁に異なる~CSS~styleをあてがうこともできる: ◎ In this example, custom data attributes are used to store the result of a feature detection for PaymentRequest, which could be used in CSS to style a checkout page differently.

<script>
if ('PaymentRequest' in window) {
document.documentElement.dataset.hasPaymentRequest = '';
}
</script>

ここでの `data-has-payment-request^a 属性は、その有無を検査するだけで十分なので,実質的に`真偽~属性$として利用されているが、作者は,望むなら、後で何らかの値で拡充して,例えば 特色機能の機能性が制限されていることを指示することもできる。 ◎ Here, the data-has-payment-request attribute is effectively being used as a boolean attribute; it is enough to check the presence of the attribute. However, if the author so wishes, it could later be populated with some value, maybe to indicate limited functionality of the feature.

`~custom~data属性$は、どの`~HTML要素$にも, いくつでも, どの値も指定できる。 ◎ Every HTML element may have any number of custom data attributes specified, with any value.

作者は、そのような拡張を注意深く設計するべきである — 当の属性が無視され,~CSSも~~無効にされても、頁は依然として利用できるように。 ◎ Authors should carefully design such extensions so that when the attributes are ignored and any associated CSS dropped, the page is still usable.

~UAは、これらの属性や値から,どのような実装の挙動も導出しては~MUST_NOT。 ~UA用に意図される仕様は、これらの属性がとる値にどのような意味も定義しては~MUST_NOT。 ◎ User agents must not derive any implementation behavior from these attributes or values. Specifications intended for user agents must not define these attributes to have any meaningful values.

~JS~libraryは、それを利用している頁の一部と見なされるので,`~custom~data属性$を利用してよい。 多くの作者から再利用される~libraryの作者には、属性~名に何らかの~~固有の文字列を含ませて,衝突の~riskを抑制することが奨励される。 ~library作者には、そうすることに~~意味があるなら,属性~名に利用される正確な名前を~custom化できるようにすることも奨励される — そうすれば、~library作者が頁に利用され得る名前を知らずに同じ名前を選ぼうが,~libraryを利用でき、また,特定0の~libraryの複数の~versionどうしが互換でないときでも,同じ頁に利用できるようになるので。 ◎ JavaScript libraries may use the custom data attributes, as they are considered to be part of the page on which they are used. Authors of libraries that are reused by many authors are encouraged to include their name in the attribute names, to reduce the risk of clashes. Where it makes sense, library authors are also encouraged to make the exact name used in the attribute names customizable, so that libraries whose authors unknowingly picked the same name can be used on the same page, and so that multiple versions of a particular library can be used on the same page even when those versions are not mutually compatible.

例えば、 "DoQuery" ~libraryが利用する属性~名は `data-doquery-range^a の様にする一方で, "jJo" ~libraryは `data-jjo-range^a にすることが~~想定される。 ~libraryは、利用する接頭辞を設定する~APIを供することもできる(例: `jJo.setDataPrefix('j2')^c のように,属性~名を `data-j2-range^a の様な名前にするものなど)。 ◎ For example, a library called "DoQuery" could use attribute names like data-doquery-range, and a library called "jJo" could use attributes names like data-jjo-range. The jJo library could also provide an API to set which prefix to use (e.g. J.setDataPrefix('j2'), making the attributes have names like data-j2-range).


%element . `dataset$m
要素~上の一連の `data-*$a 属性に対する簡便な~accessorを `DOMStringMap$I ~objとして返す。 ◎ Returns a DOMStringMap object for the element's data-* attributes.
~hyphenateされた名前は、~camel-case化される。 例えば、 `data-foo-bar=""^a は、 %element`.dataset.fooBar^c になる。 ◎ Hyphenated names become camel-cased. For example, data-foo-bar="" becomes element.dataset.fooBar.
`dataset@m
取得子は、此れ上の `data-*$a 属性を公開するような,[ 此れを結付けている `DOMStringMap$I ~obj ]を返さ~MUST: ◎ The dataset IDL attribute provides convenient accessors for all the data-* attributes on an element. On getting, the dataset IDL attribute must return a DOMStringMap whose associated element is this element.

`DOMStringMap$I ~interfaceは、 `dataset$m 属性に利用される。 各 `DOMStringMap$I には、ある `要素@dsmap が結付けられる。 ◎ The DOMStringMap interface is used for the dataset attribute. Each DOMStringMap has an associated element.

[Exposed=Window,
 OverrideBuiltins]
interface `DOMStringMap@I {
  `getter$dsmap DOMString (DOMString %name);
  [`CEReactions$] `setter$dsmap void (DOMString %name, DOMString %value);
  [`CEReactions$] `deleter$dsmap void (DOMString %name);
};

以下,この節では、所与の `DOMStringMap$I ~objを単に %文字列~map, それに結付けられている`要素$dsmapを単に %要素 と記す。 ◎ ↓

%文字列~map から `名値~pairの~listを取得-@ するときは、次の~algoを走らす: ◎ To get a DOMStringMap's name-value pairs, run the following algorithm:

  1. %~list ~LET 空~list ◎ Let list be an empty list of name-value pairs.
  2. %要素 の`属性~list$内の ~EACH ( 内容~属性 %属性 ) に対し,順に

    1. %名前 ~LET %属性 の名前
    2. ~IF[ %名前 の最初の 5 文字 ~NEQ `data-^l ] ⇒ ~CONTINUE
    3. %名前 ~LET %名前 から最初の 5 文字を除去した結果
    4. ~IF[ %名前 内に`~ASCII英大文字$がある ] ⇒ ~CONTINUE
    5. %名前 ~SET %名前 の中の各[ `002D^U `-^smb, `~ASCII英小文字$ %C ]並びを次の結果に置換した結果 ⇒ `~ASCII大文字~化する$( %C )
    6. 名値~pair ( %名前, %属性 の値 ) を %~list に追加する
    ◎ For each content attribute on the DOMStringMap's associated element whose first five characters are the string "data-" and whose remaining characters (if any) do not include any ASCII upper alphas, in the order that those attributes are listed in the element's attribute list, add a name-value pair to list whose name is the attribute's name with the first five characters removed and whose value is the attribute's value. ◎ For each name in list, for each U+002D HYPHEN-MINUS character (-) in the name that is followed by an ASCII lower alpha, remove the U+002D HYPHEN-MINUS character (-) and replace the character that followed it by the same character converted to ASCII uppercase.
  3. ~RET %~list ◎ Return list.

所与の時点における[ %文字列~map が`~supportする~prop名$ ]は、その時点で[ %文字列~map から`名値~pairの~listを取得-$した結果 ]内の各~pairの名前からなる同順の~listとする。 ◎ The supported property names on a DOMStringMap object at any instant are the names of each pair returned from getting the DOMStringMap's name-value pairs at that instant, in the order returned.

%文字列~map 上で所与の %名前 に対し `有名~propの値を決定する$ときは、[[ ~objから`名値~pairの~listを取得-$した結果 ]内の,[ 名前~成分 ~EQ %名前 ]なる名値~pair ]の値~成分を返す。 ◎ To determine the value of a named property name for a DOMStringMap, return the value component of the name-value pair whose name component is name in the list returned from getting the DOMStringMap's name-value pairs.

%文字列~map 上で[ `新たな有名~propの値を設定する$ / `既存の有名~propの値を設定する$ ]手続きは、所与の ( ~prop名 %名前, 値 %値 ) に対し,次を走らす: ◎ To set the value of a new named property or set the value of an existing named property for a DOMStringMap, given a property name name and a new value value, run the following steps:

  1. ~IF[ %名前 内に[ `002D^U `-^smb, `~ASCII英小文字$ ]並びがある ] ⇒ ~THROW `SyntaxError$E ◎ If name contains a U+002D HYPHEN-MINUS character (-) followed by an ASCII lower alpha, then throw a "SyntaxError" DOMException.
  2. %名前 ~SET %名前 内の各`~ASCII英大文字$ %C を次の並びに置換した結果 ⇒# `002D^U `-^smb, `~ASCII小文字~化する$( %C ) ◎ For each ASCII upper alpha in name, insert a U+002D HYPHEN-MINUS character (-) before the character and replace the character with the same character converted to ASCII lowercase.
  3. %名前 ~SET %名前 の先頭に文字列 `data-^l を挿入した結果 ◎ Insert the string data- at the front of name.
  4. ~IF[ %名前 は[ ~XML `Name$P 生成規則 ]に合致しない ] ⇒ ~THROW `InvalidCharacterError$E ◎ If name does not match the XML Name production, throw an "InvalidCharacterError" DOMException.
  5. %要素 の`属性~値を設定する$( %名前, %値 ) ◎ Set an attribute value for the DOMStringMap's associated element using name and value.

%文字列~map から所与の %名前 の `既存の有名~propを削除する$ときは、次の手続きを走らす: ◎ To delete an existing named property name for a DOMStringMap, run the following steps:

  1. %名前 ~SET %名前 内の各`~ASCII英大文字$ %C を次の並びに置換した結果 ⇒# `002D^U `-^smb, `~ASCII小文字~化する$( %C ) ◎ For each ASCII upper alpha in name, insert a U+002D HYPHEN-MINUS character (-) before the character and replace the character with the same character converted to ASCII lowercase.
  2. %名前 ~SET %名前 の先頭に文字列 `data-^l を挿入した結果 ◎ Insert the string data- at the front of name.
  3. %要素 から`属性を除去する$( 名前 %名前 の属性 ) ◎ Remove an attribute by name given name and the DOMStringMap's associated element.

注記: この~algoは、[ 先掲の[ `名値~pairの~listを取得-$する~algo ]から得られる名前 ]を取得するために限って, `WEBIDL$r 仕様から呼出される。 ◎ This algorithm will only get invoked by the Web IDL specification for names that are given by the earlier algorithm for getting the DOMStringMap's name-value pairs. [WEBIDL]

~gameの一部として, `data-*$a 属性とともに `class$a 属性も利用する~Web頁の例: ◎ If a Web page wanted an element to represent a space ship, e.g. as part of a game, it would have to use the class attribute along with data-* attributes:

`data-spaceship^xCode

~hyphenateされた属性~名は,~APIにおいては~camel-case化されることに注意。 ◎ Notice how the hyphenated attribute name becomes camel-cased in the API.

上と似たような,次の~code片と要素が与えられたとする…: ◎ Given the following fragment and elements with similar constructions:

`data-tower^xCode

上の要素を処理する関数の例( `splashDamage()^c ): ◎ ...one could imagine a function splashDamage() that takes some arguments, the first of which is the element to process:

function splashDamage(%node, %x, %y, %damage) {

  if (
      %node.classList.contains('tower') && /* 
`class^a 属性を検査する
 */
      %node.dataset.x == %x && /* 
`data-x^a 属性を読取る
 */
      %node.dataset.y == %y /* 
`data-y^a 属性を読取る
 */
  ) { 
    var %hp = parseInt(%node.dataset.hp); /* 
`data-hp^a 属性を読取る
 */
    %hp = %hp - %damage;
    if (%hp < 0) {
      %hp = 0;
      %node.dataset.ai = 'dead'; /* 
`data-ai^a 属性を設定する
 */
      delete %node.dataset.ability; /* 
`data-ability^a 属性を除去する
 */
    }
    %node.dataset.hp = %hp; /* 
`data-hp^a 属性を設定する
 */
  }
}

3.2.7. `innerText$m ~IDL属性

%element . `innerText$m [ = %value ]

要素の~text内容を “描画されたままの~~形で” 返す。 ◎ Returns the element's text content "as rendered".

設定して,要素の内容を所与の値に置換できる。 ただし、改行は `br$e 要素に変換される。 ◎ Can be set, to replace the element's children with the given value, but with line breaks converted to br elements.

【可読性のため、この節では次の表記を用いる:】

  • `CR^i は、文字 `000D^U CARRIAGE RETURN を表す。
  • `LF^i は、文字 `000A^U LINE FEED を表す。
  • `TAB^i は、文字 `0009^U CHARACTER TABULATION を表す。

`innerText@m 属性の取得子は、次の手続きに従わ~MUST: ◎ On getting, the innerText attribute must follow these steps:

  1. ~IF[ 此れは`具現化されて$いない ]~OR[ ~UAは非~CSS~UAである ] ⇒ ~RET 此れの `textContent$m ~IDL属性と同じ値 ◎ If this element is not being rendered, or if the user agent is a non-CSS user agent, then return the same value as the textContent IDL attribute on this element.

    注記: この手続きは意外な結果を生産し得る。 この属性が`具現化されて$いない要素~上で~accessされた場合,その~text内容が返される一方、`具現化されて$いる要素~上で~accessされた場合,[ その子たちのうち`具現化されて$いないもの ]の~text内容は無視される。 ◎ This step can produce surprising results, as when the innerText attribute is accessed on an element not being rendered, its text contents are returned, but when accessed on an element that is being rendered, all of its children that are not being rendered have their text contents ignored.

  2. %~item~list ~LET `内縁~textを収集する$( 此れ ) ⇒ 結果を成す各~itemは、`~JS文字列$, または( `要改行数^i を与える)正~整数になる。 ◎ Let results be the list resulting in running the inner text collection steps with this element. Each item in results will either be a JavaScript string or a positive integer (a required line break count).

    注記: `要改行数^i ~itemは、直感的には,その地点に現れる[ ~itemの値で与えられる個数の改行からなる文字列 ]を意味するが、それらは,隣り合う `要改行数^i ~itemどうしで縮約し得る — ~CSSの~margin相殺にある意味似たように。 ◎ Intuitively, a required line break count item means that a certain number of line breaks appear at that point, but they can be collapsed with the line breaks induced by adjacent required line break count items, reminiscent to CSS margin-collapsing.

  3. %~item~list から[ 空~文字列である文字列~item ]を`除去する$ ◎ Remove any items from results that are the empty string.
  4. %~item~list から,頭部と尾部にある[ 連続する `要改行数^i ~itemたち ]を`除去する$ ◎ Remove any runs of consecutive required line break count items at the start or end of results.
  5. %~item~list 内の各[ 連続する `要改行数^i ~itemたち ]を[ それらの~itemの最大~値と同じ個数の `LF^i からなる文字列 ]に`置換する$ ◎ Replace each remaining run of consecutive required line break count items with a string consisting of as many U+000A LINE FEED (LF) characters as the maximum of the values in the required line break count items.
  6. ~RET %~item~list 内の文字列~itemたちを順に連結した結果 ◎ Return the concatenation of the string items in results.

`内縁~textを収集する@ ときは、所与の ( `~node$ %~node ) に対し,次を走らす: ◎ The inner text collection steps, given a node node, are as follows:

  1. %~item~list ~LET 空`~list$ ◎ ↓
  2. %~node の~EACH( 子~node %子 ) に対し,`木~順序$で:

    1. %子~item~list ~LET `内縁~textを収集する$( %子 )
    2. %子~item~list 内の~EACH( %子~item ) に対し ⇒ %~item~list に %子~item を`付加する$
    ◎ Let items be the result of running the inner text collection steps with each child node of node in tree order, and then concatenating the results to a single list.
  3. ~IF[ %~node 上の `visibility$p の`算出値$ ~NEQ `visible^v ] ⇒ ~RET %~item~list ◎ If node's computed value of 'visibility' is not 'visible', then return items.
  4. ~IF[ %~node は`具現化されて$いない ] ⇒ ~RET %~item~list ◎ If node is not being rendered, then return items.\

    この段の目的においては、次に挙げる要素は,[ その `display$p ~propの`算出値$ ~NEQ `none^v ]ならば、そこに述べるように動作しているものと扱わ~MUST: ◎ For the purpose of this step, the following elements must act as described if the computed value of the 'display' property is not 'none':

    • `select$e 要素 ⇒ `置換され$ない行内~CSS~boxが結付けられていて、子である[ `optgroup$e / `option$e ]要素による~boxのみを子~boxとして含んでいる。 ◎ select elements have an associated non-replaced inline CSS box whose child boxes include only those of optgroup and option element child nodes;
    • `optgroup$e 要素 ⇒ `置換され$ない塊levelの~CSS~boxが結付けられていて、子である `option$e 要素による~boxのみを子~boxとして含んでいる。 ◎ optgroup elements have an associated non-replaced block-level CSS box whose child boxes include only those of option element child nodes; and
    • `option$e 要素 ⇒ `置換され$ない塊levelの~CSS~boxが結付けられていて、その子~boxは,通常の `置換され$ない塊levelの~CSS~boxになる。 ◎ option element have an associated non-replaced block-level CSS box whose child boxes are as normal for non-replaced block-level CSS boxes.

    注記: `display^p 値が `contents$v の場合、 %~item~list は非~空になり得る。 ◎ items can be non-empty due to 'display:contents'.

  5. ~IF[ %~node は `Text$I ~nodeである(したがって, %~item~list は空) ]: ◎ If node is a Text node, then\

    1. %~node が生産した ~EACH( ~CSS~text~box ) に対し,内容~順に: ◎ for each CSS text box produced by node, in content order,\

      1. %文字列~item ~LET[ ~CSSの `空白~処理~規則$, `~text変形法$ `CSSTEXT$r を,~boxの~textに適用して算出される文字列 — ここでは: ◎ compute the text of the box after application of the CSS 'white-space' processing rules and 'text-transform' rules, set items to the list of the resulting strings, and return items.\

        • `空白~処理~規則$は、少しばかり改変される: 行末の縮約-可能な空白~並びは常に縮約されるが、それらは[ その行が当の~blockの最後の行であるか, または `br$e 要素で終端している ]場合に限り除去されるように。 ◎ The CSS 'white-space' processing rules are slightly modified: collapsible spaces at the end of lines are always collapsed, but they are only removed if the line is the last line of the block, or it ends with a br element.\
        • ~soft-hyphenは保全されるべきである ◎ Soft hyphens should be preserved. [CSSTEXT]
      2. %~item~list に %文字列~item を`付加する$ ◎ ↑
    2. ~RET %~item~list ◎ ↑
  6. ~IF[ %~node は `br$e 要素である ] ⇒ %~item~list に[ 1 個の `LF^i からなる文字列 ]を`付加する$ ◎ If node is a br element, then append a string containing a single U+000A LINE FEED (LF) character to items.
  7. ~IF[ %~node 上の `display$p の`算出値$ ~EQ `table-cell$v ]~AND[ %~node の~CSS~boxは、それを封入している `table-row$v ~boxの最後の `table-cell$v ~boxではない ] ⇒ %~item~list に[ 1 個の `TAB^i からなる文字列 ]を`付加する$ ◎ If node's computed value of 'display' is 'table-cell', and node's CSS box is not the last 'table-cell' box of its enclosing 'table-row' box, then append a string containing a single U+0009 CHARACTER TABULATION (tab) character to items.
  8. ~IF[ %~node 上の `display$p の`算出値$ ~EQ `table-row$v ]~AND[ %~node は[ %~node に最も近い[ %~node の先祖 `table$v ~box ]]の最後の `table-row$v ~boxではない ] ⇒ %~item~list に[ 1 個の `LF^i からなる文字列 ]を`付加する$ ◎ If node's computed value of 'display' is 'table-row', and node's CSS box is not the last 'table-row' box of the nearest ancestor 'table' box, then append a string containing a single U+000A LINE FEED (LF) character to items.
  9. %要改行数 ~LET ε ◎ ↓
  10. ~IF[ %~node は `p$e 要素である ] ⇒ %要改行数 ~SET 2 ◎ If node is a p element, then append 2 (a required line break count) at the beginning and end of items.
  11. ~ELIF[ %~node 上の `display$p の`使用値$は[ `塊level$である, または `table-caption$v ] `CSSDISPLAY$r ] ⇒ %要改行数 ~SET 1 ◎ If node's used value of 'display' is block-level or 'table-caption', then append 1 (a required line break count) at the beginning and end of items. [CSSDISPLAY]

    注記: 浮動体, 絶対位置された要素は、この分類に入る。 ◎ Floats and absolutely-positioned elements fall into this category.

  12. ~IF[ %要改行数 ~NEQ ε ]:

    1. %~item~list に %要改行数 を`前付加する$
    2. %~item~list に %要改行数 を`付加する$
    ◎ ↑
  13. ~RET %~item~list ◎ Return items.

注記: 厳密に言えば、ほとんどの`置換され$る要素(例: `textarea$e, `input$e, `video$e — ただし `button$e は除く)の子孫~nodeは、~CSSにより具現化されることはなく,この~algoの目的においては~CSS~boxを持たないことに注意。 ◎ Note that descendant nodes of most replaced elements (e.g., textarea, input, and video — but not button) are not rendered by CSS, strictly speaking, and therefore have no CSS boxes for the purposes of this algorithm.

この~algoを,`範囲~obj$上でも働くように一般~化する。 そうすれば `Selection$I の文字列化子の基礎に利用でき、`範囲~obj$上に直に公開し得るようになる。 Bugzilla bug 10583 を見よ。 ◎ This algorithm is amenable to being generalized to work on ranges. Then we can use it as the basis for Selection's stringifier and maybe expose it directly on ranges. See Bugzilla bug 10583.

`innerText$m 属性の設定子は、次の手続きに従わ~MUST: ◎ On setting, the innerText attribute must follow these steps:

  1. %文書 ~LET 此れの`~node文書$ ◎ Let document be this element's node document.
  2. %文書片 ~LET 次のようにされた新たな `DocumentFragment$I ~obj ⇒ `~node文書$ ~SET %文書 ◎ Let fragment be a new DocumentFragment object whose node document is document.
  3. %入力 ~LET 所与の値 ◎ Let input be the given value.
  4. %位置 ~LET %入力 の先頭の文字を指している`位置~変数$ ◎ Let position be a pointer into input, initially pointing at the start of the string.
  5. %~text ~LET 空~文字列 ◎ Let text be the empty string.
  6. ~WHILE[ %位置↗ ~NEQ ε ]: ◎ While position is not past the end of input:

    1. %~text ~SET %入力 内の %位置 から { `LF^i, `CR^i } 以外の`符号位置~並びを収集する$ ◎ Collect a sequence of code points that are not U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR) characters from input given position. Set text to the collected characters.
    2. ~IF[ %~text ~NEQ 空~文字列 ] ⇒ %文書片 に`~nodeを付加する$( 次のようにされた新たな `Text$I ~node ) ⇒ ( `data$m, `~node文書$ ) ~SET ( %~text, %文書 ) ◎ If text is not the empty string, then append a new Text node whose data is text and node document is document to fragment.
    3. ~WHILE[ %位置↗ ~IN { `LF^i, `CR^i } ]: ◎ While position is not past the end of input, and the character at position is either a U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR) character:

      1. ~IF[ %位置↗ ~EQ `CR^i ]~AND[ ( %位置 + 1 )↗ ~EQ `LF^i ] ⇒ %位置 ~INCBY 1 ◎ If the character at position is a U+000D CARRIAGE RETURN (CR) character and the next character is a U+000A LINE FEED (LF) character, then advance position to the next character in input.
      2. %位置 ~INCBY 1 ◎ Advance position to the next character in input.
      3. %文書片 に`~nodeを付加する$( `要素を作成する$( %文書, `br$e, `~HTML名前空間$ ) ) ◎ Append the result of creating an element given document, br, and the HTML namespace to fragment.
  7. 此れの`全~内容を~nodeで置換する$( %文書片 ) ◎ Replace all with fragment within this element.

3.2.8. 双向algoに関係する要件

3.2.8.1. 双向algo整形~文字に対する著作~適合性の判定基準

`~HTML要素$における,[ `~text内容$ — `Text$I ~nodeを含むような`内容$ ]/[ 自由形の~textを許容するような属性~内の~text ]は、範囲 { `202A^U 〜 `202E^U, `2066^U 〜 `2069^U } に入る文字(双向algo整形~文字)を包含してもよい。 `BIDI$r ◎ Text content in HTML elements with Text nodes in their contents, and text in attributes of HTML elements that allow free-form text, may contain characters in the ranges U+202A to U+202E and U+2066 to U+2069 (the bidirectional-algorithm formatting characters). [BIDI]

注記: 作者には、[ `dir$a 属性, `bdo$e 要素, `bdi$e 要素 ]を利用することが奨励される — 双向algo整形~文字を手動で保守するのでなく。 双向algo整形~文字は、~CSSとの相互作用に乏しい。 ◎ Authors are encouraged to use the dir attribute, the bdo element, and the bdi element, rather than maintaining the bidirectional-algorithm formatting characters manually. The bidirectional-algorithm formatting characters interact poorly with CSS.

3.2.8.2. ~UAに課される適合性~判定基準

~UAは、文書や その一部を具現化する際に,文字たちの適正な順序付けを決定するときには、~Unicode双向algo `BIDI$r を実装し~MUST。 ◎ User agents must implement the Unicode bidirectional algorithm to determine the proper ordering of characters when rendering documents and parts of documents. [BIDI]

~UAは、~HTMLから~Unicode双向algoへの対応付けを,次のいずれかの仕方で行わ~MUST `CSSGC$r: ◎ The mapping of HTML to the Unicode bidirectional algorithm must be done in one of three ways. Either the user agent must\

  • ~CSS — 特に,~CSS[ `unicode-bidi$p, `direction$p, `content$p ]~propを実装した上で、[ `具現化 節$に与えられる,これらの~propを利用している規則 ]を,自身の~UA~stylesheetに含める。 ◎ implement CSS, including in particular the CSS 'unicode-bidi', 'direction', and 'content' properties, and must have, in its user agent style sheet, the rules using those properties given in this specification's rendering section, or,\
  • 前項であったかのように動作しつつ、文書に指定される~stylesheetには,それを上書きさせない。 ◎ alternatively, the user agent must act as if it implemented just the aforementioned properties and had a user agent style sheet that included all the aforementioned rules, but without letting style sheets specified in documents override them, or,\
  • 等価な意味論を伴うような別の~style付け言語を実装する。 ◎ alternatively, the user agent must implement another styling language with equivalent semantics. [CSSGC]

次の要素/属性には,`具現化 節$により定義される要件が課されるが、この節における要件に因り,すべての~UAに課される要件にもなる( 示唆される既定の具現化を~supportする~UA のみならず): ◎ The following elements and attributes have requirements defined by the rendering section that, due to the requirements in this section, are requirements on all user agents (not just those that support the suggested default rendering):

  • `dir$a 属性, および
  • `bdi$e, `bdo$e, `br$e, `pre$e, `textarea$e, `wbr$e 要素
◎ • dir attribute • bdi element • bdo element • br element • pre element • textarea element • wbr element

3.2.9. ARIA, および~platform~accessibility~APIに関係する要件

`~HTML要素$に対する Accessibility API の意味論を実装するにあたって,~UAに課される要件は、 HTML Accessibility API Mappings にて定義される。 `HTMLAAM$r ◎ User agent requirements for implementing Accessibility API semantics on HTML elements are defined in HTML Accessibility API Mappings. [HTMLAAM]

`~HTML要素$上の ARIA [ `role$a / `aria-*$a ]属性の利用を検査する適合性~検査器に課される要件は、 ARIA in HTML にて定義される。 `ARIAHTML$r ◎ Conformance checker requirements for checking use of ARIA role and aria-* attributes on HTML elements are defined in ARIA in HTML. [ARIAHTML]