1. 2.4 URL
      1. 2.4.1 用語
      2. 2.4.2 CORS設定属性
      3. 2.4.3 リファラーポリシー属性
      4. 2.4.6 Nonce属性
      5. 2.4.5 遅延読み込み属性
      6. 2.4.6 ブロックキング属性
      7. 2.4.7 フェッチ優先属性

2.4 URL

2.4.1 用語

妥当なURL文字列であるが空文字列でない場合、文字列は妥当な空でないURLである。

先頭と末尾のASCII空白文字を取り除いたあとに妥当なURL文字列である場合、文字列は潜在的にスペースで囲まれた妥当なURLである。

先頭と末尾のASCII空白文字を取り除いたあとに、妥当な空でないURLである場合、文字列は潜在的にスペースで囲まれた妥当な空でないURLである。

この仕様は、たとえ解決不可能でも、XMLツールの互換性のために必要な場合、HTML文書DOCTYPEで用いるためのabout: URL予約としてURL about:legacy-compatを定義する。[ABOUT]

この仕様は、たとえ解決不可能でも、メディアトラック類のための識別子として用いられるabout: URLを予約としてURL about:html-kindを定義する。[ABOUT]

この仕様は、たとえ解決不可能でも、iframe srcdoc文書URLとして用いられるabout: URLを予約としてURL about:srcdocを定義する。[ABOUT]

Documentオブジェクトdocumentフォールバック基底URLは、次の手順を実行して得られるURLレコードである:

  1. If document is an iframe srcdoc document, then:

    1. Assert: document's about base URL is non-null.

    2. Return document's about base URL.

  2. If document's URL matches about:blank and document's about base URL is non-null, then return document's about base URL.

  3. documentURLを返す。

Documentオブジェクトの文書基底URLは、次の手順を実行して得られるURLレコードである:

  1. Documenthref属性を持つbase要素が存在しない場合、Documentフォールバック基底URLを返す。

  2. そうでなければ、ツリー順で、href属性を持つDocumentで最初のbase要素の凍結基底URLを返す。


スキームが "about"、パスが単一の文字列"blank"、ユーザー名ならびにパスワードが空の文字列、およびホストがnullの場合、URLabout:blankに一致する

そのようなURLのクエリーおよびフラグメントは非nullにすることができる。たとえば、"about:blank?foo#bar"を解析して作成されたURLレコードabout:blankと一致する

URLは、そのスキームが"about"であり、そのパスが単一の文字列"srcdoc"を含み、そのクエリーがnullであり、そのユーザー名パスワードが空の文字列であり、かつそのホストがnullである場合、about:srcdocよ一致する

about:srcdocと一致する理由は、 URLクエリーがnullであることを保証するためである。これは、URLabout:blankと一致するDocumentとは異なり、 URLがnullでないクエリーを持つiframe srcdocdocumentを作成できないためである。つまり、 about:srcdocに一致するすべてのURLのセットは、 フラグメントでのみ異なる。

2.4.2 CORS設定属性

Attributes/crossorigin

Support in all current engines.

Firefox8+Safari6+Chrome13+
Opera?Edge79+
Edge (Legacy)12+Internet ExplorerYes
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

A CORS settings attribute is an enumerated attribute with the following keywords and states:

キーワード状態概要
anonymousAnonymous要素に対するリクエストは、"cors"に設定されるリクエストのモードおよび"same-origin"に設定されるリクエストの資格情報モードを持つ。
(空文字列)
use-credentialsUse Credentials要素に対するリクエストは、"cors"に設定されるリクエストのモードおよび"include"に設定されるリクエストの資格情報モードを持つ。

The attribute's missing value default is the No CORS state, and its invalid value default is the Anonymous state. 反映の目的のため、Anonymous状態の正規キーワードanonymousキーワードである。

CORS設定属性によって管理されるフェッチの大部分は、潜在的なCORS要求アルゴリズムの作成によって行われる。

リクエストのモードが常に"cors"であるような、よりモダンな機能の場合、特定のCORS設定属性は、リクエスト資格情報モードにのみ影響する、わずかに異なる意味を持つように別の目的で利用されている。この変換を実行するために、属性の状態を切り替えることによって決定する、与えられたCORS設定属性CORS設定属性の資格情報モードを定義する:

No CORS
Anonymous
"same-origin"
Use Credentials
"include"

2.4.3 リファラーポリシー属性

リファラーポリシー属性は、列挙属性である。空文字列を含む各リファラーポリシーは、同じ名前の状態にマッピングする、この属性のためのキーワードである。

The attribute's missing value default and invalid value default are both the empty string state.

様々なフェッチの処理モデルにこの状態の影響は、Fetchで、およびReferrer Policyで、この仕様を通してより詳細に定義される。[FETCH] [REFERRERPOLICY]

複数の信号は、どの処理モデルが与えられるフェッチに使用されるかに寄与することができる。リファラーポリシー属性はそのうちの1つである。一般に、この信号が処理される順序は次のとおり:

  1. まず、noreferrerリンクタイプの存在

  2. 次に、リファラーポリシー属性の値

  3. それからreferrerに設定されるnameをもつ任意のmeta要素の存在

  4. 最後に、`Referrer-Policy` HTTPヘッダー。

2.4.4 Nonce属性

Global_attributes/nonce

Support in all current engines.

Firefox31+SafariYesChromeYes
Opera?EdgeYes
Edge (Legacy)?Internet ExplorerNo
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

nonceコンテンツ属性は、与えられたフェッチが処理されてもよいどうかを判断するためにContent Security Policyで使用することができる暗号ノンス("一度使用される数字")を表す。値はテキストである。[CSP]

nonceコンテンツ属性を持つ要素は、コンテンツ属性から値を抽出し、その値を[[CryptographicNonce]]という名前の内部スロットに移動し、HTMLOrSVGElementインターフェイスミックスインを介してスクリプトに公開し、コンテンツ属性を空の文字列に設定することで、暗号nonceがスクリプト(かつCSS属性セレクターなどのサイドチャネルではない)にのみ公開されることを保証する。特に指定しない限り、スロットの値は空の文字列である。

element.nonce

要素の暗号ナンスに設定された値を返す。 セッターが使用されなかった場合、これはnonceコンテンツ属性で最初に見つかった値になる。

element.nonce = value

要素の暗号ナンス値を更新する。

HTMLElement/nonce

Firefox75+Safari🔰 10+Chrome61+
Opera?Edge79+
Edge (Legacy)?Internet ExplorerNo
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

取得時に、nonce IDL属性は、この要素の[[CryptographicNonce]]の値を返さなければならない。この要素の[[CryptographicNonce]]を指定された値に設定する。

nonce IDL属性のセッターが対応するcontent属性を更新しないことに注意されたい。これは、要素がブラウジングコンテキストに接続されたときに以下のnonceコンテンツ属性を空の文字列に設定するのと同様に、セレクターなどのコンテンツ属性をより簡単に読み取ることができるメカニズムによるnonce値の流出を防ぐことを意味する。この動作が導入されたissue #2369で詳細を確認されたい。

The following attribute change steps are used for the nonce content attribute:

  1. If element does not include HTMLOrSVGElement, then return.

  2. If localName is not nonce or namespace is not null, then return.

  3. If value is null, then set element's [[CryptographicNonce]] to the empty string.

  4. Otherwise, set element's [[CryptographicNonce]] to value.

Whenever an element including HTMLOrSVGElement becomes browsing-context connected, the user agent must execute the following steps on the element:

  1. Let CSP list be element's shadow-including root's policy container's CSP list.

  2. 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. Let nonce be element's [[CryptographicNonce]].

    2. Set an attribute value for element using "nonce" and the empty string.

    3. Set element's [[CryptographicNonce]] to nonce.

    If element's [[CryptographicNonce]] were not restored it would be the empty string at this point.

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.4.5 遅延読み込み属性

Lazy_loading

Support in all current engines.

Firefox75+Safari15.4+Chrome77+
Opera?Edge79+
Edge (Legacy)?Internet ExplorerNo
Firefox Android?Safari iOS?Chrome Android?WebView Android?Samsung Internet?Opera Android?

A lazy loading attribute is an enumerated attribute with the following keywords and states:

キーワード状態概要
lazyLazyいくつかの条件が満たされるまでリソースのフェッチを延期するために使用される。
eagerEagerリソースをすぐにフェッチするために使用される。デフォルト状態。

この属性は、属性の現在の状態に応じて、すぐにリソースをフェッチする、または要素に関連付けられた条件が満たされるまでフェッチを延期するようユーザーエージェントに指示する。

属性の欠損値のデフォルト不正値のデフォルトは両方ともEager状態である。


The will lazy load element steps, given an element element, are as follows:

  1. If scripting is disabled for element, then return false.

    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 element's lazy loading attribute is in the Lazy state, then return true.

  3. falseを返す。

Each img and iframe element has associated lazy load resumption steps, initially null.

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.

Each Document has a lazy load intersection observer, initially set to null but can be set to an IntersectionObserver instance.

To start intersection-observing a lazy loading element element, run these steps:

  1. Let doc be element's node document.

  2. If doc's lazy load intersection observer is null, set it to a new IntersectionObserver instance, initialized as follows:

    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]

  3. 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]

To stop intersection-observing a lazy loading element element, run these steps:

  1. Let doc be element's node document.

  2. Assert: doc's lazy load intersection observer is not null.

  3. 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]

The lazy load scroll margin is an implementation-defined value, but with the following suggestions to consider:

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.4.6 ブロックキング属性

ブロッキング属性は、外部リソースのフェッチ時に特定の操作をブロックすべきであることを明示的に示す。ブロックされうる動作は、可能なブロックキングトークンで表され、次の表に記載される:

可能なブロックキングトークン説明
"render"要素が潜在的にレンダリングブロックキングである。

将来的には、より多くの可能なブロッキングトークンが存在するかもしれない。

ブロッキング属性は、一意なスペース区切りのトークンの順序付けられていないセットである値を持たなければならず、各トークンは、可能なブロッキングトークンである。ブロッキング属性サポートされるトークンは、可能なブロッキングトークンである。すべて要素は、多くとも1つのブロッキング属性を持つことがある。

The blocking tokens set for an element el are the result of the following steps:

  1. Let value be the value of el's blocking attribute, or the empty string if no such attribute exists.

  2. Set value to value, converted to ASCII lowercase.

  3. Let rawTokens be the result of splitting value on ASCII whitespace.

  4. Return a set containing the elements of rawTokens that are possible blocking tokens.

An element is potentially render-blocking if its blocking tokens set contains "render", or if it is implicitly potentially render-blocking, which will be defined at the individual elements. By default, an element is not implicitly potentially render-blocking.

2.4.7 フェッチ優先属性

A fetch priority attribute is an enumerated attribute with the following keywords and states:

キーワード状態概要
highhigh同じ宛先を持つ他のリソースに対して、優先度の高いフェッチを通知する。
lowlow同じ宛先を持つ他のリソースに対して、優先度の低いフェッチを通知する。
autoauto同じ宛先を持つ他のリソースに対するフェッチの優先度の自動決定を通知する。

この属性の欠損値のデフォルト不正値のデフォルトは両方ともauto状態である。