HTML — URL, 資源の fetch 法

【この訳に特有な表記規約】

◎表記記号

2.4. ~URL

2.4.1. 各種用語

`妥当かつ空でない~URL@ とは、 空~文字列でない,`妥当な~URL文字列$である。 ◎ A string is a valid non-empty URL if it is a valid URL string but it is not the empty string.

`前後~空白~可の妥当な~URL@ とは、 次の結果が`妥当な~URL文字列$になる %文字列 である ⇒ `前後の~ASCII空白~列を剥ぐ$( %文字列 ) ◎ A string is a valid URL potentially surrounded by spaces if, after stripping leading and trailing ASCII whitespace from it, it is a valid URL string.

`前後~空白~可の妥当かつ空でない~URL@ とは、 次の結果が`妥当かつ空でない~URL$になる %文字列 である ⇒ `前後の~ASCII空白~列を剥ぐ$( %文字列 ) ◎ A string is a valid non-empty URL potentially surrounded by spaces if, after stripping leading and trailing ASCII whitespace from it, it is a valid non-empty URL.

この仕様は、 予約-済みかつ解決-不能な `about_$sc ~URL `ABOUT$r として, 次に挙げる~URLを定義する: ◎ ↓

`about_legacy-compat@sc ◎ This specification defines the URL about:legacy-compat as a reserved, though unresolvable, about: URL,\
~XML~toolとの互換性に必要なとき,`~HTML文書$内の `DOCTYPE$ にて利用される。 ◎ for use in DOCTYPEs in HTML documents when needed for compatibility with XML tools. [ABOUT]
`about_html-kind@sc ◎ This specification defines the URL about:html-kind as a reserved, though unresolvable, about: URL,\
~media~trackの種類~用の識別子として利用される。 ◎ that is used as an identifier for kinds of media tracks. [ABOUT]
`about_srcdoc@sc ◎ This specification defines the URL about:srcdoc as a reserved, though unresolvable, about: URL,\
`~iframe-srcdoc文書$の`~URL$docとして利用される。 ◎ that is used as the URL of iframe srcdoc documents. [ABOUT]

【 これら(および `about_blank$sc )は, `~URL$をとり得る何かと直に( “~EQ” で)比較されることもあるが、 その比較が何に基づくかは,明示的に定義されていない。 これらは, “`URL$r に定義される`~URL$である” とすら述べられていないが、[ `~URL$をとり得る何かと比較される/ 上のように`~URL$として利用される ]以上,そう見なす必要があるので、 実際には[ 当の `about_…^sc を文字列として`構文解析-@~URL1#concept-url-parser$した結果の`~URL$ ]であり,[ 他との比較は,`同等な~URL@~URL1#concept-url-equals$に基づく ]と解釈すべきに思われる。 】

`文書$ %文書 の `~fallback基底~URL@ は、 次を走らせて得される`~URL~record$である: ◎ The fallback base URL of a Document object document is the URL record obtained by running these steps:

  1. %~about基底~URL ~LET %文書 の`~about基底~URL$doc ◎ ↓
  2. ~IF[ %文書 は`~iframe-srcdoc文書$である ]: ◎ If document is an iframe srcdoc document, then:

    1. ~Assert: %~about基底~URL ~NEQ ~NULL ◎ Assert: document's about base URL is non-null.
    2. ~RET %~about基底~URL ◎ Return document's about base URL.
  3. ~IF[ %文書 の`~URL$doc は`~about_blank に合致して$いる ]~AND[ %~about基底~URL ~NEQ ~NULL ] ⇒ ~RET %文書 の`~about基底~URL$doc ◎ If document's URL matches about:blank and document's about base URL is non-null, then return document's about base URL.
  4. ~RET %文書 の`~URL$doc ◎ Return document's URL.

`文書$ %文書 の `文書~基底~URL@ は、 次を走らせて得される`~URL~record$である: ◎ The document base URL of a Document object is the URL record obtained by running these steps:

  1. ~IF[ %文書 内に `~hrefM$a 属性を有する `base$e 要素は在る ] ⇒ ~RET それらのうち`~tree順序$で最初のものの`凍結d基底~URL$ ◎ ↓
  2. ~RET %文書 の`~fallback基底~URL$ ◎ If there is no base element that has an href attribute in the Document, then return the Document's fallback base URL. ◎ Otherwise, return the frozen base URL of the first base element in the Document that has an href attribute, in tree order.

`~URL$が `~about_blank に合致して@ いるとは、 ~AND↓ が満たされることをいう:

  • その`~scheme$url ~EQ `about^l
  • その`~path$urlは 1 個の文字列 `blank^l のみからなる
  • その`~username$url ~EQ 空~文字列
  • その`~password$url ~EQ 空~文字列
  • その`~host$url ~EQ ~NULL
◎ A URL matches about:blank if its scheme is "about", its path contains a single string "blank", its username and password are the empty string, and its host is null.

注記: そのような~URLの[ `~query$url / `素片$url ]は ~NULL でないこともある。 例えば、[ `about:blank?foo#bar^l を`~URL構文解析する$ことにより作成された`~URL~record$ ]は,`~about_blank に合致して$いる。 ◎ Such a URL's query and fragment can be non-null. For example, the URL record created by parsing "about:blank?foo#bar" matches about:blank.

`~URL$が `~about_srcdoc に合致して@ いるとは、 ~AND↓ が満たされることをいう:

  • その`~scheme$url ~EQ `about^l
  • その`~path$urlは 1 個の文字列 `srcdoc^l のみからなる
  • その`~query$url ~EQ ~NULL
  • その`~username$url ~EQ 空~文字列
  • その`~password$url ~EQ 空~文字列
  • その`~host$url ~EQ ~NULL
◎ A URL matches about:srcdoc if its scheme is "about", its path contains a single string "srcdoc", its query is null, its username and password are the empty string, and its host is null.

注記: `~about_srcdoc に合致して$いる`~URL$の`~query$urlが ~NULL になることを確保する理由は、 `~iframe-srcdoc文書$を[ その`~URL$docの`~query$url ~NEQ ~NULL ]を満たすように作成することはアリでないからである — `~URL$docが`~about_blank に合致して$いる`文書$と違って。 言い換えれば、 `~about_srcdoc に合致して$いる どの`~URL$も,`素片$url以外の成分は同じになる。 ◎ The reason that matches about:srcdoc ensures that the URL's query is null is because it is not possible to create an iframe srcdoc document whose URL has a non-null query, unlike Documents whose URL matches about:blank. In other words, the set of all URLs that match about:srcdoc only vary in their fragment.

2.4.2. ~URLの構文解析-法

~URLの構文解析は、 文字列をとり,それが表現する`~URL~record$を得する処理nである。 この処理nは `URL^cite 標準 `URL$r にて定義されているが、 この~HTML標準では,基底~URLと符号化法を抽象化して包装する手続きをいくつか定義する。 ◎ Parsing a URL is the process of taking a string and obtaining the URL record that it represents. While this process is defined in URL, the HTML standard defines several wrappers to abstract base URLs and encodings. [URL]

注記: ほとんどの新たな~APIは、 `~URLを相対的に構文解析する$を利用する。 より旧い~APIと~HTML要素は、 `~URLを符号化法の下で相対的に構文解析する$を利用する理由があるかもしれない。 もちろん,[ ~customな基底~URLが必要なとき/基底~URLが欲されないとき ]も、 `~URL構文解析する$を直に利用できる。 ◎ Most new APIs are to use parse a URL. Older APIs and HTML elements might have reason to use encoding-parse a URL. When a custom base URL is needed or no base URL is desired, the URL parser can of course be used directly as well.

`~URLを相対的に構文解析する@ ときは、 所与の ( 文字列 %~URL, `文書$または`環境~設定群~obj$ %環境 ) に対し,次を走らす — これは[ `失敗^i /`~URL$ ]を返す: ◎ To parse a URL, given a string url, relative to a Document object or environment settings object environment, run these steps. They return failure or a URL.

  1. %基底~URL ~LET %環境 に応じて ⇒# `文書$であるならば %環境 の`文書~基底~URL$/ %環境 の`~API用~基底~URL$enV ◎ Let baseURL be environment's base URL, if environment is a Document object; otherwise environment's API base URL.
  2. ~RET `~URL構文解析する$( %~URL, %基底~URL ) ◎ Return the result of applying the URL parser to url, with baseURL.

`~URLを符号化法の下で相対的に構文解析する@ ときは、 所与の ( 文字列 %~URL, `文書$または`環境~設定群~obj$ %環境 ) に対し,次を走らす — これは[ `失敗^i /`~URL$ ]を返す: ◎ To encoding-parse a URL, given a string url, relative to a Document object or environment settings object environment, run these steps. They return failure or a URL.

  1. %符号化法 ~LET `~UTF-8$ ◎ Let encoding be UTF-8.
  2. ~IF[ %環境 は`文書$である ] ⇒ %符号化法 ~SET %環境 の`符号化法$doc ◎ If environment is a Document object, then set encoding to environment's character encoding.
  3. ~ELIF[ %環境 に`関連な大域~obj$ は `Window$I ~objである ] ⇒ %符号化法 ~SET %環境 に`関連な大域~obj$に`結付けられた文書$の`符号化法$doc ◎ Otherwise, if environment's relevant global object is a Window object, set encoding to environment's relevant global object's associated Document's character encoding.
  4. %基底~URL ~LET %環境 に応じて ⇒# `文書$であるならば %環境 の`文書~基底~URL$/ %環境 の`~API用~基底~URL$enV ◎ Let baseURL be environment's base URL, if environment is a Document object; otherwise environment's API base URL.
  5. ~RET `~URL構文解析する$( %~URL, %基底~URL, %符号化法 ) ◎ Return the result of applying the URL parser to url, with baseURL and encoding.

【 原文には, この~algoの結果をさらに`直列化した結果@~URL1#concept-url-serializer$を返す `~URLを符号化法の下で相対的に構文解析して直列化する@ ~algoも定義されているが、 この訳では利用しない — 直列化した結果のみが利用される事例は,ごく少数に限られるので。 それが必要になる所では、 明示的に それを呼出すことにする。 】 ◎ To encoding-parse-and-serialize a URL, given a string url, relative to a Document object or environment settings object environment, run these steps. They return failure or a string. • Let url be the result of encoding-parsing a URL given url, relative to environment. • If url is failure, then return failure. • Return the result of applying the URL serializer to url.

2.4.3. 基底~URLに対する動的な変化

`文書$ %文書 の`文書~基底~URL$が変化したとき、 %文書 内のすべての要素は, %文書 の`基底~URLの変化により影響される$ `DOM$r。 ◎ When a document's document base URL changes, all elements in that document are affected by a base URL change.

要素 %要素 が`基底~URLの変化により影響される$ときに走らす`基底~URL変更-手続き$( `DOM^cite に定義される)は、 次で与えられる: ◎ The following are base URL change steps, which run when an element is affected by a base URL change (as defined by DOM):

%要素 は`~hyperlink$を作成するものである場合、 ~UAは次に従うべきである: ◎ If the element creates a hyperlink

当の~hyperlinkにより識別される`~URL$から導出される~dataは、 表示に影響している場合(~URLは利用者に示されているなど) ⇒ 次の結果に基づいて,該当する~UIを適切に更新する ⇒ `~URLを符号化法の下で相対的に構文解析する$( 当の~hyperlinkの `href$a 属性の値, %要素 の`~node文書$ ) ◎ If the URL identified by the hyperlink is being shown to the user, or if any data derived from that URL is affecting the display, then the href attribute's value should be reparsed, relative to the element's node document and the UI updated appropriately.

例えば~CSS[ `link$ps / `visited$ps ]`疑似類$は、 影響され得る。 ◎ For example, the CSS :link/:visited pseudo-classes might have been affected.

当の~hyperlinkは `ping$a 属性を有する場合 ⇒ その値を成す ~EACH( %~token ) に対し ⇒ %~token が与える`~URL$は、 利用者に示されているならば ⇒ 次の結果に基づいて,該当する~UIを適切に更新する ⇒ `~URLを符号化法の下で相対的に構文解析する$( %~token, %要素 の`~node文書$ ) ◎ If the hyperlink has a ping attribute and its URL(s) are being shown to the user, then the ping attribute's tokens should be reparsed, relative to the element's node document and the UI updated appropriately.

[ %要素 は[ `q$e / `blockquote$e / `ins$e / `del$e ]要素である ]~AND[ %要素 は `cite^a 属性を有する ]場合、 ~UAは次に従うべきである: ◎ If the element is a q, blockquote, ins, or del element with a cite attribute
`cite^a 属性で識別される`~URL$から導出される~dataは、 表示に影響している場合 (~URLは利用者に示されているなど) ⇒ 次の結果に基づいて,該当する~UIを適切に更新する ⇒ `~URLを符号化法の下で相対的に構文解析する$( `cite^a 属性の値, %要素 の`~node文書$ ) ◎ If the URL identified by the cite attribute is being shown to the user, or if any data derived from that URL is affecting the display, then the cite attribute's value should be reparsed, relative to the element's node document and the UI updated appropriately.
他の場合: ◎ Otherwise
%要素 は直に影響されない。 ◎ The element is not directly affected.
具体的には、 基底~URLを変更しても, `img$e 要素により表示されている画像には影響しない — ~scriptからの `src$m ~IDL属性に対する後続な~accessに対しては, 新たな`絶対~URL$が返されることになるが、 示されている画像には対応しなくなるであろう。 ◎ For instance, changing the base URL doesn't affect the image displayed by img elements, although subsequent accesses of the src IDL attribute from script will return a new absolute URL that might no longer correspond to the image being shown.

2.5. 資源の~fetch法

2.5.1. 各種用語

【`~network~error@~FETCH#concept-network-error$以外の】 `応答$は、 次に挙げる 2 つに大別される `FETCH$r :

  • `~CORS同一-生成元@ ⇒ `種別$rs ~IN { `basic^l, `cors^l, `default^l } を満たすもの。
  • `~CORS非同一-生成元@ ⇒ `種別$rs ~IN { `opaque^l, `opaqueredirect^l } を満たすもの。
◎ A response whose type is "basic", "cors", or "default" is CORS-same-origin. [FETCH] ◎ A response whose type is "opaque" or "opaqueredirect" is CORS-cross-origin.

`応答$の `安全でない応答@ は、 その`内部~応答$rsが[ 在るならば それ / 無いならば`応答$自身 ]とする。 ◎ A response's unsafe response is its internal response if it has one, and the response itself otherwise.

`~CORSになり得る要請を作成する@ ときは、所与の ⇒# %~URL, %行先, %~CORS属性~状態, %同一-生成元~fallbackありか ~IN { `同一-生成元~fallbackあり^i, ε }(省略時は ε ) ◎終 に対し,次を走らす: ◎ To create a potential-CORS request, given a url, destination, corsAttributeState, and an optional same-origin fallback flag, run these steps:

  1. %~mode ~LET [ %~CORS属性~状態 ~EQ `~CORSなし$st ならば `no-cors^l / ~ELSE_ `cors^l ] ◎ Let mode be "no-cors" if corsAttributeState is No CORS, and "cors" otherwise.
  2. ~IF[ %同一-生成元~fallbackありか ~EQ `同一-生成元~fallbackあり^i ]~AND[ %~mode ~EQ `no-cors^l ] ⇒ %~mode ~SET `same-origin^l ◎ If same-origin fallback flag is set and mode is "no-cors", set mode to "same-origin".
  3. %資格証~mode ~LET `include^l ◎ Let credentialsMode be "include".
  4. ~IF[ %~CORS属性~状態 ~EQ `匿名$st ] ⇒ %資格証~mode ~SET `same-origin^l ◎ If corsAttributeState is Anonymous, set credentialsMode to "same-origin".
  5. ~RET 次のようにされた新たな`要請$ ⇒# `~URL$rq ~SET %~URL, `行先$rq ~SET %行先, `~mode$rq ~SET %~mode, `資格証~mode$rq ~SET %資格証~mode, `~URL資格証を利用するか$rq ~SET ~T ◎ Let request be a new request whose URL is url, destination is destination, mode is mode, credentials mode is credentialsMode, and whose use-URL-credentials flag is set.

2.5.2. 資源の型の決定-法

資源の `Content-Type ~metadata@ は、 `MIME Sniffing^cite `MIMESNIFF$r による要件に整合な方式で,得する/解釈するモノトスル。 ◎ The Content-Type metadata of a resource must be obtained and interpreted in a manner consistent with the requirements of MIME Sniffing. [MIMESNIFF]

資源から`算出される~MIME型$は、 `MIME Sniffing^cite `MIMESNIFF$r に与えられる[ 関連な~octet列から `sniffed media type^i を見出すための要件 ]に整合な方式で,見出すモノトスル。 ◎ The computed MIME type of a resource must be found in a manner consistent with the requirements given in MIME Sniffing. [MIMESNIFF]

次に挙げる規則も `MIME Sniffing^cite `MIMESNIFF$r にて定義され、 `~MIME型$を返す:

  • `画像を特定的に~sniffするための規則$
  • `資源は~textか~binaryかを判別する規則$
  • `音声や動画を特定的に~sniffするための規則$
◎ The rules for sniffing images specifically, the rules for distinguishing if a resource is text or binary, and the rules for sniffing audio and video specifically are also defined in MIME Sniffing. These rules return a MIME type as their result. [MIMESNIFF]

`MIME Sniffing^cite による規則には、 正確に従うことが絶対要件である。 ~UAが,内容~型の検出~用に[ ~serverが期待するものとは異なる経験則 ]を利用すると、 ~securityの問題が生じ得る。 更なる詳細は、 その仕様を見よ。 ◎ It is imperative that the rules in MIME Sniffing be followed exactly. When a user agent uses different heuristics for content type detection than the server expects, security problems can occur. For more details, see MIME Sniffing. [MIMESNIFF]

2.5.3. `meta^e 要素から文字~符号化法を抽出する

`meta 要素から符号化法を抽出する@ ~algoは、 所与の文字列 %入力 に対し[ `文字~符号化法$/ ε(なし) ]を返す: ◎ The algorithm for extracting a character encoding from a meta element, given a string s, is as follows. It either returns a character encoding or nothing.

  1. %位置 ~LET %入力 の先頭の文字を指している`位置~変数$ ◎ Let position be a pointer into s, initially pointing at the start of the string.
  2. ~WHILE 無条件:

    1. ~IF[ %入力 の %位置 以降の部分に`~ASCII大小無視$で `charset^l に合致する文字列がある ] ⇒ %位置 ~SET 該当する文字列のうち,最初のものの直後を指す位置
    2. ~ELSE ⇒ ~RET ε
    3. %入力 内の %位置 から`~ASCII空白を読飛ばす$
    4. ~IF[ %位置↗ ~EQ `003D^U `=^smb ] ⇒ ~BREAK
    ◎ Loop: Find the first seven characters in s after position that are an ASCII case-insensitive match for the word "charset". If no such match is found, return nothing. ◎ Skip any ASCII whitespace that immediately follow the word "charset" (there might not be any). ◎ If the next character is not a U+003D EQUALS SIGN (=), then move position to point just before that next character, and jump back to the step labeled loop.
  3. %入力 内の %位置 から`~ASCII空白を読飛ばす$ ◎ Skip any ASCII whitespace that immediately follow the equals sign (there might not be any).
  4. ~IF[ %位置↗ ~EQ ε ] ⇒ ~RET ε ◎ ↓
  5. %符号化法 ~LET ε ◎ ↓
  6. ~IF[ %位置↗ ~IN { `0022^U `"^smb, `0027^U `'^smb } ]:

    1. %引用符 ~LET %位置↗
    2. %位置 ~INCBY 1
    3. %符号化法 ~SET %入力 内の %位置 から %引用符 以外の`符号位置~並びを収集する$
    4. ~IF[ %位置↗ ~NEQ %引用符 ] ⇒ ~RET ε
    ◎ Process the next character as follows: • If it is a U+0022 QUOTATION MARK character (") and there is a later U+0022 QUOTATION MARK character (") in s • If it is a U+0027 APOSTROPHE character (') and there is a later U+0027 APOSTROPHE character (') in s •• Return the result of getting an encoding from the substring that is between this character and the next earliest occurrence of this character. • If it is an unmatched U+0022 QUOTATION MARK character (") • If it is an unmatched U+0027 APOSTROPHE character (') • If there is no next character •• Return nothing.
  7. ~ELSE ⇒ %符号化法 ~SET %入力 内の %位置 から { `~ASCII空白$, `003B^U `;^smb } 以外の`符号位置~並びを収集する$ ◎ • Otherwise •• Return the result of getting an encoding from the substring that consists of this character up to but not including the first ASCII whitespace or U+003B SEMICOLON character (;), or the end of s, whichever comes first.
  8. ~RET [ `~labelから符号化法を取得する$( %符号化法 ) の結果 ~NEQ `失敗^i ならば その結果 / ~ELSE_ ε ] ◎ ↑

この~algoは、 ~HTTP仕様のものとは別個な形をとる (例えば,~HTTPでは、 一重引用符 `0027^U `'^smb の利用は許容されないことに加え、[ この~algoが~supportしない,~backslashによる~escapeの仕組み ]を~supportすることが要求されている)。 この~algoは,歴史的に~HTTPに関係する文脈で利用されていたが、 実装により~supportされる構文は,あるときから分岐した。 `HTTP$r ◎ This algorithm is distinct from those in the HTTP specifications (for example, HTTP doesn't allow the use of single quotes and requires supporting a backslash-escape mechanism that is not supported by this algorithm). While the algorithm is used in contexts that, historically, were related to HTTP, the syntax as supported by implementations diverged some time ago. [HTTP]

2.5.4. ~CORS設定群~属性

内容~属性には、 `~CORS設定群~属性@ ( `CORS settings attribute^en ) とされるものもある。 【通例的に, `crossorigin^a と命名される。】 それは,`列挙d属性$であり、 次に挙げる~keyword, とり得る状態, それらの対応付けが定義される: ◎ A CORS settings attribute is an enumerated attribute with the following keywords and states:

~keyword 状態 概略的な記述
`anonymous@v `匿名@st 要素による`要請$の[ `~mode$rqは `cors^l / `資格証~mode$rqは `same-origin^l ]に設定する。
空~文字列
`use-credentials@v `資格証を利用する@st 要素による`要請$の[ `~mode$rqは `cors^l / `資格証~mode$rqは `include^l ]に設定する。
(なし) `~CORSなし@st 【 要素による`要請$の[ `~mode$rqは概して `no-cors^l (一部の事例では `same-origin^l )/ `資格証~mode$rqは `include^l ]に設定する。 】
◎ Keyword|State|Brief description ◎ anonymous|Anonymous|Requests for the element will have their mode set to "cors" and their credentials mode set to "same-origin". (the empty string)|↑|↑ use-credentials|Use Credentials|Requests for the element will have their mode set to "cors" and their credentials mode set to "include".

この属性の[ `欠落~値~用の既定の状態$は `~CORSなし$st/ `妥当でない値~用の既定の状態$は `匿名$st / ]とする。 `反映$の目的においては、 `匿名$st 状態~用の`正準的な~keyword$は `anonymous$v とする。 ◎ The attribute's missing value default is the No CORS state, and its invalid value default is the Anonymous state. For the purposes of reflection, the canonical keyword for the Anonymous state is the anonymous keyword.

~fetchにおいて`~CORS設定群~属性$が統治する大部分は、 `~CORSになり得る要請を作成する$~algoを介して行われることになる。 ◎ The majority of fetches governed by CORS settings attributes will be done via the create a potential-CORS request algorithm.

より現代的な[ `要請$の`~mode$rqは常に `cors^l になる特能 ]用には、 ある種の`~CORS設定群~属性$は,[ 少し異なる意味に転用され、 `要請$の`資格証~mode$rqに限り,影響iする ]ようになる。 この翻訳を遂行するため、 所与の`~CORS設定群~属性$に対しては, `~CORS設定群~属性の資格証~mode@ が定義される — それは、 属性の状態に応じて,次に与える値に決定される ⇒# `~CORSなし$st ならば `same-origin^l / `匿名$st ならば `same-origin^l / `資格証を利用する$st ならば `include^l ◎ For more modern features, where the request's mode is always "cors", certain CORS settings attributes have been repurposed to have a slightly different meaning, wherein they only impact the request's credentials mode. To perform this translation, we define the CORS settings attribute credentials mode for a given CORS settings attribute to be determined by switching on the attribute's state: ◎ No CORS Anonymous • "same-origin" Use Credentials • "include"

2.5.5. ~referrer施策~属性

内容~属性には、 `~referrer施策~属性@ ( `referrer policy attribute^en ) とされるものもある。 【通例的に, `referrerpolicy^a と命名される。】 それは、 `列挙d属性$である。 この属性~用に定義される~keywordは、 `~referrer施策$であり,空~文字列も含む。 各~keywordは、 同じ名前の状態に対応付けられる。 ◎ A referrer policy attribute is an enumerated attribute. Each referrer policy, including the empty string, is a keyword for this attribute, mapping to a state of the same name.

この属性の[ `欠落~値~用の既定の状態$/`妥当でない値~用の既定の状態$ ]は、 空~文字列とする。 ◎ The attribute's missing value default and invalid value default are both the empty string state.

これらの状態による各種`~fetch$の処理~modelへの影響iについては、 この仕様を通して, および `Fetch^cite `FETCH$r, `Referrer Policy^cite `REFERRERPOLICY$r にて,より詳細に定義される。 ◎ The impact of these states on the processing model of various fetches is defined in more detail throughout this specification, in Fetch, and in Referrer Policy. [FETCH] [REFERRERPOLICY]

注記: [ 所与の`~fetch$がどの処理~modelを利用するか ]に寄与し得る通達には,いくつかあり、 `~referrer施策~属性$は,その一つである。 一般に、 これらの通達は,次の順序で処理される: ◎ Several signals can contribute to which processing model is used for a given fetch; a referrer policy attribute is only one of them. In general, the order in which these signals are processed are:

  1. 最初に、 ~link型 `noreferrer$v の有無。 ◎ First, the presence of a noreferrer link type;
  2. `~referrer施策~属性$の値。 ◎ Then, the value of a referrer policy attribute;
  3. `~nameM$a 属性が `referrer$v に設定された `meta$e 要素の有無。 ◎ Then, the presence of any meta element with name attribute set to referrer.
  4. 最後に、 `Referrer-Policy$h ~header。 ◎ Finally, the `Referrer-Policy` HTTP header.

2.5.6. `nonce^a 属性

`nonce@a 内容~属性は、 暗号用~nonce ( “`number used once^en” 【使い捨ての番号】 )を表現する。 それは、 `CSP$r により利用され,[ 所与の~fetchを続行するのを許容する ]かどうかを決定する。 値は~textである。 ◎ A nonce content attribute represents a cryptographic nonce ("number used once") which can be used by Content Security Policy to determine whether or not a given fetch will be allowed to proceed. The value is text. [CSP]

要素が `nonce$a 内容~属性を有するとき、 その暗号用~nonceは,~scriptのみに公開される (および,~CSS属性~選択子の様な~side-channelには公開されない) ことを確保する — 内容~属性から値をとって, `CryptographicNonce@sl 内部~slotに移動して, `HTMLOrSVGElement$I ~interface~mixinを介して~scriptに公開して, 内容~属性を空~文字列に設定することにより。 他が指定されない限り、 この~slotの値は,空~文字列になるとする。 ◎ Elements that have a nonce content attribute ensure that the cryptographic nonce is only exposed to script (and not to side-channels like CSS attribute selectors) by taking the value from the content attribute, moving it into an internal slot named [[CryptographicNonce]], exposing it to script via the HTMLOrSVGElement interface mixin, and setting the content attribute to the empty string. Unless otherwise specified, the slot's value is the empty string.

%element.`nonce$m
要素の暗号用~nonce用に設定された値を返す。 設定子を利用しなかった場合、 これは,元々 `nonce$a 内容~属性に見出された値を返すことになる。 ◎ Returns the value set for element's cryptographic nonce. If the setter was not used, this will be the value originally found in the nonce content attribute.
%element.`nonce$m = %value
要素の暗号用~nonce値を更新する。 ◎ Updates element's cryptographic nonce value.

`nonce@m 取得子~手続きは ⇒ ~RET コレの `CryptographicNonce$sl ~slotの値

`nonce$m 設定子~手続きは ⇒ コレの `CryptographicNonce$sl ~slot ~SET 所与の値 ◎ The nonce IDL attribute must, on getting, return the value of this element's [[CryptographicNonce]]; and on setting, set this element's [[CryptographicNonce]] to the given value.

注記: `nonce$m 設定子は、 対応する内容~属性を更新しないことに注意。 このこと, および[ 要素が`閲覧~文脈に接続された$とき, `nonce$a 内容~属性を空~文字列に設定すること ](下に述べる)は、[ 内容~属性を容易に読取れる仕組み(選択子など)による,~nonce値の不正転送 ]を防止することが意味されている。 この挙動が導入された~~経緯は、 `課題 #2369@~HTMLissue/2369$ にて学べる。 ◎ Note how the setter for the nonce IDL attribute does not update the corresponding content attribute. This, as well as the below setting of the nonce content attribute to the empty string when an element becomes browsing-context connected, is meant to prevent exfiltration of the nonce value through mechanisms that can easily read content attributes, such as selectors. Learn more in issue #2369, where this behavior was introduced.

%要素 上の `nonce$a 内容~属性~用に利用される `属性~変更-時の手続き$は、所与の ( %局所~名, %旧~値, %値, %名前空間 ) に対し: ◎ The following attribute change steps are used for the nonce content attribute:

  1. ~IF[ %要素 は `HTMLOrSVGElement$I を`内包して$いない ] ⇒ ~RET ◎ If element does not include HTMLOrSVGElement, then return.
  2. ~IF[ %局所~名 ~NEQ `nonce^l ]~OR[ %名前空間 ~NEQ ~NULL ] ⇒ ~RET ◎ If localName is not nonce or namespace is not null, then return.
  3. %要素 の `CryptographicNonce$sl ~SET %値 に応じて ⇒# ~NULL ならば 空~文字列 / ~ELSE_ %値 ◎ If value is null, then set element's [[CryptographicNonce]] to the empty string. ◎ Otherwise, set element's [[CryptographicNonce]] to value.

`HTMLOrSVGElement$I を`内包して$いる %要素 が`閲覧~文脈に接続された$ときは、 次を走らすモノトスル: ◎ Whenever an element including HTMLOrSVGElement becomes browsing-context connected, the user agent must execute the following steps on the element:

  1. %~CSP~list ~LET %要素 の`~shadowも含めた根$の`施策~容器$の`~CSP~list$pC ◎ Let CSP list be element's shadow-including root's policy container's CSP list.
  2. ~IF[ %~CSP~list は`~headerにより送達された~CSPを包含している$ ]~AND[ %要素 は `nonce$a 内容~属性 %属性 を有する ]~AND[ %属性 の値 ~NEQ 空~文字列 ]: ◎ If CSP list contains a header-delivered Content Security Policy, and element has a nonce content attribute attr whose value is not the empty string, then:

    1. %nonce ~LET %要素 の `CryptographicNonce$sl ◎ Let nonce be element's [[CryptographicNonce]].
    2. %要素 の`属性~値を設定する$( `nonce^l, 空~文字列 ) ◎ Set an attribute value for element using "nonce" and the empty string.
    3. %要素 の `CryptographicNonce$sl ~SET %nonce ◎ Set element's [[CryptographicNonce]] to nonce.

    注記: %要素 の `CryptographicNonce^sl は、 復旧しないと空~文字列になる。 ◎ If element's [[CryptographicNonce]] were not restored it would be the empty string at this point.

`HTMLOrSVGElement$I を`内包して$いる %要素 用の`~clone時の手続き$は、 所与の ( %複製, %要素, … ) に対し,次を走らすモノトスル ⇒ %複製 の `CryptographicNonce$sl ~slot ~SET %要素 の `CryptographicNonce$sl ~slotの値 ◎ The cloning steps for elements that include HTMLOrSVGElement must set the [[CryptographicNonce]] slot on the copy to the value of the slot on the element being cloned.

2.5.7. ~lazy読込ng属性

内容~属性には、 `~lazy読込ng属性@ ( `lazy loading attribute^en 【 “読込ngを後回しにする” 】 ) とされるものもある。 【通例的に, `loading^a と命名される。】 それは,`列挙d属性$であり、 次に挙げる~keyword, とり得る状態, それらの対応付けが定義される: ◎ A lazy loading attribute is an enumerated attribute with the following keywords and states:

~keyword 状態
`lazy@v `Lazy$st
`eager@v `Eager$st

上に挙げた各~状態は、 次を~UAに指図する:

  • `Lazy@st (後回し) ⇒ 当の要素に結付けられた何らかの条件が満たされるまで、 資源の~fetchingを先送りする。
  • `Eager@st (早急) ⇒ 資源を即時に~fetchする。
◎ Keyword|State|Brief description lazy|Lazy|Used to defer fetching a resource until some conditions are met. eager|Eager|Used to fetch a resource immediately; the default state. ◎ The attribute directs the user agent to fetch a resource immediately or to defer fetching until some conditions associated with the element are met, according to the attribute's current state.

この属性の[ `欠落~値~用の既定の状態$/`妥当でない値~用の既定の状態$ ]は、 `Eager$st とする。 ◎ The attribute's missing value default and invalid value default are both the Eager state.


所与の要素 %要素 は `~lazyに読込むことになる@ かどうかは、 次に従う: ◎ The will lazy load element steps, given an element element, are as follows:

  1. ~IF[ %要素 `用の~scriptingは不能化されて$いる ] ⇒ ~RET ~F ◎ If scripting is disabled for element, then return false.

    注記: これは、 追跡に抗する保護策である — ~UAの~scriptingが不能化されている下で~lazy読込ngを~supportした場合、 ~pageの~markup内に画像を計略的に配置すれば, ~serverはそれらの画像がいつ, どれだけ要請されたか追跡でき、 ~session全体を通して利用者の~scroll位置を近似的に追跡することが, ~siteにとって依然としてアリになるので。 ◎ This is an anti-tracking measure, because if a user agent supported lazy loading when scripting is disabled, it would still be possible for a site to track a user's approximate scroll position throughout a session, by strategically placing images in a page's markup such that a server can track how many images are requested and when.

  2. ~IF[ %要素 の`~lazy読込ng属性$は `Lazy$st 状態にある ] ⇒ ~RET ~T ◎ If element's lazy loading attribute is in the Lazy state, then return true.
  3. ~RET ~F ◎ Return false.

各[ `img$e / `iframe$e ]要素には `~lazy読込n再開~手続き@ が結付けられ,初期~時には ~NULL をとるとする。 ◎ Each img and iframe element has associated lazy load resumption steps, initially null.

注記: この手続きは、[ それらの要素のうち,`~lazyに読込むことになる$もの ]用にあり,[ `~lazy読込n交差~観測器$の~callback内から/ 要素の`~lazy読込ng属性$が `Eager$st 状態に変化した【!設定された】とき ]走らすことになる。 これは、 当の要素の読込ngを継続させる。 ◎ For img and iframe elements that will lazy load, these steps are run from the lazy load intersection observer's callback or when their lazy loading attribute is set to the Eager state. This causes the element to continue loading.

各`文書$には, `~lazy読込n交差~観測器@ があり、 初期~時には ~NULL に設定されるが, 後で `IntersectionObserver$I ~instanceに設定され得る。 ◎ Each Document has a lazy load intersection observer, initially set to null but can be set to an IntersectionObserver instance.

`~lazyに読込んでいる要素の交差~観測を開始する@ ときは、 所与の ( %要素 ) に対し,次の手続きを走らす: ◎ To start intersection-observing a lazy loading element element, run these steps:

  1. %文書 ~LET %要素 の`~node文書$ ◎ Let doc be element's node document.
  2. ~IF[ %文書 の`~lazy読込n交差~観測器$ ~EQ ~NULL ]: ◎ If doc's lazy load intersection observer is null,\

    1. %文書 の`~lazy読込n交差~観測器$ ~SET 新たな `IntersectionObserver$I ~obj ◎ set it to a new IntersectionObserver instance, initialized as follows:
    2. %文書 の`~lazy読込n交差~観測器$上で `new IntersectionObserver$m 構築子~手続き( %callback, %options ) を遂行する※【下を見よ(以下同様)】 — ここで: ◎ The intention is to use the original value of the IntersectionObserver constructor. However, we're forced to use the JavaScript-exposed constructor in this specification, until Intersection Observer exposes low-level hooks for use in specifications. See bug w3c/IntersectionObserver#464 which tracks this. [INTERSECTIONOBSERVER]

      • `IntersectionObserverCallback$I ~callback %callback は、 引数 ( %~entry~list, %観測器 ) に対し,次の手続きを走らす: ◎ The callback is these steps, with arguments entries and observer:

        1. %~entry~list 内の ~EACH( %~entry ) に対し ,開発者が改変-可能な[ 配列~accessorや反復~hook ]は誘発しない反復~手法を利用して

          1. ~IF[ %~entry 上の `isIntersecting$m 取得子~手続き()※ ~EQ ~F ] ⇒ ~CONTINUE
          2. %~target ~LET %~entry 上の `target$m 取得子~手続き()※
          3. %再開~手続き ~LET %~target の`~lazy読込n再開~手続き$
          4. ~IF[ %再開~手続き ~EQ ~NULL ] ⇒ ~RET
          5. `~lazyに読込んでいる要素の交差~観測を停止する$( %~target )
          6. %~target の`~lazy読込n再開~手続き$ ~SET ~NULL
          7. %再開~手続き を呼出す
          ◎ For each entry in entries using a method of iteration which does not trigger developer-modifiable array accessors or iteration hooks: • Let resumptionSteps be null. • If entry.isIntersecting is true, then set resumptionSteps to entry.target's lazy load resumption steps. • If resumptionSteps is null, then return. • Stop intersection-observing a lazy loading element for entry.target. • Set entry.target's lazy load resumption steps to null. • Invoke resumptionSteps. ◎ The intention is to use the original value of the isIntersecting and target getters. See w3c/IntersectionObserver#464. [INTERSECTIONOBSERVER]
      • `IntersectionObserverInit$I 辞書 %options は、 次の~memberを伴う ⇒ «[ "`scrollMargin^c" → `~lazy読込n~scroll~margin$ ]» ◎ The options is an IntersectionObserverInit dictionary with the following dictionary members: «[ "scrollMargin" → lazy load scroll margin ]»

        注記: これは、[ 画像が まだ表示域に交差していなくても,~scrollしている間に そうなりつつある ]とき,画像を~fetchすることを許容する。 ◎ This allows for fetching the image during scrolling, when it does not yet — but is about to — intersect the viewport.

        `~lazy読込n~scroll~margin$用の示唆は,値に対する動的な変更を含意するが、 `IntersectionObserver$I ~APIは,~scroll~marginの変更-法を~supportしていない。 `w3c/IntersectionObserver 課題 #428@https://github.com/w3c/IntersectionObserver/issues/428$ を見よ。 ◎ The lazy load scroll margin suggestions imply dynamic changes to the value, but the IntersectionObserver API does not support changing the root margin. See issue w3c/IntersectionObserver#428.

  3. %文書 の`~lazy読込n交差~観測器$ の`observe$m ~method手続き( %要素 )※ ◎ Call doc's lazy load intersection observer's observe method with element as the argument. ◎ The intention is to use the original value of the observe method. See w3c/IntersectionObserver#464. [INTERSECTIONOBSERVER]

`~lazyに読込んでいる要素の交差~観測を停止する@ ときは、所与の ( %要素 ) に対し,次の手続きを走らす: ◎ To stop intersection-observing a lazy loading element element, run these steps:

  1. %文書 ~LET %要素 の`~node文書$ ◎ Let doc be element's node document.
  2. ~Assert: %文書 の`~lazy読込n交差~観測器$ ~NEQ ~NULL ◎ Assert: doc's lazy load intersection observer is not null.
  3. %文書 の`~lazy読込n交差~観測器$の `unobserve$m ~method手続き( %要素 )※ ◎ Call doc's lazy load intersection observer unobserve method with element as the argument. ◎ The intention is to use the original value of the unobserve method. See w3c/IntersectionObserver#464. [INTERSECTIONOBSERVER]

※ `Intersection Observer^cite 仕様に定義される これらの~interface~member ( `new IntersectionObserver()$m 構築子, 等々)には、 それぞれの元の【~JSにより改変されていない】値を利用して~accessすることが意図nにある 【そのように解釈されるよう、この訳では “構築子~手続き” 等々を利用しているが】 。 しかしながら,その仕様が他の仕様における利用-用に低~levelな~hookを公開するまでは、 この仕様は,~JSに公開される それらを利用するよう強いられる。 これを追跡している `w3c/IntersectionObserver 課題 #464@https://github.com/w3c/IntersectionObserver/issues/464$ を見よ。 `INTERSECTIONOBSERVER$r ◎ ↑↑

◎追跡路 `~lazy読込n~scroll~margin@ は,`実装定義$な値であるが、 考慮する示唆として,次が挙げられる: ◎ (This is a tracking vector.) The lazy load scroll margin is an implementation-defined value, but with the following suggestions to consider:

  • 次を満たす最小な値に設定する ⇒ 所与の機器~用の通常の用法~patternの下で、[ 対象が表示域に交差するより前に,その資源は読込n済みになる ]ことが最も多くなる。 ◎ Set a minimum value that most often results in the resources being loaded before they intersect the viewport under normal usage patterns for the given device.
  • [ 概して,他より速く~scrollする機器 ]用には、 値を増やす。 ◎ The typical scrolling speed: increase the value for devices with faster typical scrolling speeds.
  • 現在~scrollしている速さ/勢い ⇒ ~UAは、 ~scrollが停止しそうになる所を予測しようと試みて, それに則って値を調整できる。 ◎ The current scrolling speed or momentum: the UA can attempt to predict where the scrolling will likely stop, and adjust the value accordingly.
  • ~network品質 ⇒ 接続が遅いか, その待時間が長い場合には、 値を増やす。 ◎ The network quality: increase the value for slow or high-latency connections.
  • 利用者-選好は、 値に波及し得る。 ◎ User preferences can influence the value.

`~privacy用@~INFRA#tracking-vector$には、 `~lazy読込n~scroll~margin$は,追加的な情報を漏洩しないことが重要である。 例えば,現在の機器~上で~scrollする代表的な速さは、 新たな指紋収集~行路を導入しないよう,精確にしないこともできる。 ◎ It is important for privacy that the lazy load scroll margin not leak additional information. For example, the typical scrolling speed on the current device could be imprecise so as to not introduce a new fingerprinting vector.

2.5.8. 他を阻む属性

内容~属性には、 `他を阻む属性@ ( `blocking attribute^en ) とされるものもある。 【通例的に, `blocking^a と命名される。】 それは、[ 外部~資源の~fetchingに際して,ある種の演算は阻まれるべきである ]ことを明示的に指示する。 阻まれ得る演算は、 各種 `アリな他を阻む~token@ ( `possible blocking tokens^en )で表現される — それらは、 次の表tに挙げられる文字列である: ◎ A blocking attribute explicitly indicates that certain operations should be blocked on the fetching of an external resource. The operations that can be blocked are represented by possible blocking tokens, which are strings listed by the following table:

アリな他を阻む~token 記述
`render@l 要素は`具現化を阻む能性$がある。
◎ Possible blocking token Description "render" The element is potentially render-blocking.

注記: `アリな他を阻む~token$は、 将来には,もっと~~増やされ得る。 ◎ In the future, there might be more possible blocking tokens.

`他を阻む属性$の値は、 `~space等で分離された一意な~token集合$(無順序)であって, それを成す各~tokenは`アリな他を阻む~token$でなければナラナイ。 `他を阻む属性$が`~supportする~token集合$は、 すべての`アリな他を阻む~token$からなる。 どの要素も,それが有する`他を阻む属性$は 1 個までとする。 ◎ A blocking attribute must have a value that is an unordered set of unique space-separated tokens, each of which are possible blocking tokens. The supported tokens of a blocking attribute are the possible blocking tokens. Any element can have at most one blocking attribute.

所与の要素 %要素 用の `他を阻む~token集合@ ( `blocking tokens set^en ) は、 次の手続きの結果になる: ◎ The blocking tokens set for an element el are the result of the following steps:

  1. %値 ~LET %要素 は`他を阻む属性$を[ 有するならば,その値/ 有さないならば,空~文字列 ]

    【 所与の要素~型に対し,複数個の`他を阻む属性$が定義されることはない。 】

    ◎ Let value be the value of el's blocking attribute, or the empty string if no such attribute exists.
  2. %値 ~SET `~ASCII小文字~化する$( %値 ) ◎ Set value to value, converted to ASCII lowercase.
  3. %生の~token群 ~LET `~ASCII空白で分割する$( %値 ) ◎ Let rawTokens be the result of splitting value on ASCII whitespace.
  4. ~RET %生の~token群 から`アリな他を阻む~token$でないものすべてを除いた集合 ◎ Return a set containing the elements of rawTokens that are possible blocking tokens.

次を満たす要素は、 `具現化を阻む能性@ がある( `potentially render-blocking^en )とされる ⇒ [ `render$l ~IN 要素~用の`他を阻む~token集合$ ]~OR[ `暗黙的に具現化を阻む能性$がある ] ◎ An element is potentially render-blocking if its blocking tokens set contains "render", or if it is\

所与の要素が `暗黙的に具現化を阻む能性@ がある( `implicitly potentially render-blocking^en )かどうかは、 個々の要素ごとに定義される。 既定では、 要素は,`暗黙的に具現化を阻む能性$はないとする。 ◎ implicitly potentially render-blocking, which will be defined at the individual elements. By default, an element is not implicitly potentially render-blocking.

2.5.9 ~fetch優先度~属性

内容~属性には、 `~fetch優先度~属性@ ( `fetch priority attribute^en ) とされるものもある。 【通例的に, `fetchpriority^a と命名される。】 それは,`列挙d属性$であり、 次に挙げる~keyword, とり得る状態, それらの対応付けが定義される: ◎ A fetch priority attribute is an enumerated attribute with the following keywords and states:

~keyword 状態(文字列†) 概略的な記述
`high@v `高い@st ( `high^l ) `行先$rqが同じ他の資源に相対的な`~fetch$優先度は、 高いことを通達する。
`low@v `低い@st ( `low^l ) `行先$rqが同じ他の資源に相対的な`~fetch$優先度は、 低いことを通達する。
`auto@v `自動@st ( `auto^l ) `行先$rqが同じ他の資源に相対的な`~fetch$優先度は、 自動的に決定することを通達する。

【† 各~状態は,抽象的な定数であるが、 この仕様の各所では,括弧内に挙げた文字列に等しいものと見なされ、 文字列として,要請の`優先度$rqに利用される。 】

◎ Keyword|State|Brief description high|high|Signals a high-priority fetch relative to other resources with the same destination. low|low|Signals a low-priority fetch relative to other resources with the same destination. auto|auto|Signals automatic determination of fetch priority relative to other resources with the same destination.

この属性の[ `欠落~値~用の既定の状態$/`妥当でない値~用の既定の状態$ ]は、 `自動$st とする。 ◎ The attribute's missing value default and invalid value default are both the auto state.