7.8. Web の閲覧


7.8. ~webの閲覧

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

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

7.8.2. ~HTML~fileに対する頁~読込~処理~model

~HTML文書を `閲覧文脈$内に読込むことになるときは、~UAは 次を走らす`~taskを~queueし$~MUST: ◎ When an HTML document is to be loaded in a browsing context, the user agent must queue a task to\

  1. %文書 ~SET 新たな`文書$ ◎ create a Document object,\
  2. %文書 の`種別$doc ~SET `html^l ◎ mark it as being an HTML document,\
  3. %文書 の`内容~型$doc ~SET `text/html^l ◎ set its content type to "text/html",\
  4. `文書を初期化する$( %文書 ) ◎ initialize the Document object, and finally\
  5. %解析器 ~LET 新たな`~HTML構文解析器$ ◎ create an HTML parser and\
  6. %解析器 を %文書 に結付ける ◎ associate it with the Document.\

~fetchingを走らせている間に`~network用~task源$から `~task~queue$に入れられる各`~task$は、~fetchされた~byte列で %解析器 への`入力~byte~stream$を埋めた上で, %解析器 に入力~streamの適切な処理を遂行させ~MUST。 ◎ Each task that the networking task source places on the task queue while fetching runs must then fill the parser's input byte stream with the fetched bytes and cause the HTML parser to perform the appropriate processing of the input stream.

注記: `入力~byte~stream$に渡された~byte列は、文字~並びに変換されて`~tokenizer$に渡される。 この処理-の一部は、資源の~~真の `~Content-Type~metadata$ から見出される文字~符号化法~情報に依拠する — `資源から算出された~MIME型$V は、その目的には利用されない。 ◎ The input byte stream converts bytes into characters for use in the tokenizer. This process relies, in part, on character encoding information found in the real Content-Type metadata of the resource; the computed type is not used for this purpose.

可用な~byte列が尽きたときは、~UAは, %解析器 が暗黙の~EOF文字を処理する`~taskを~queueし$~MUST — それは、最終的に `load$et ~eventを発火させることになる。 ◎ When no more bytes are available, the user agent must queue a task for the parser to process the implied EOF character, which eventually causes a load event to be fired.

~UAは、`文書$が作成された後, かつ ~scriptが実行される前の, ほぼ間違いなく %解析器 が`停止-$する前に,`新たな頁で~session履歴を更新-$し~MUST。 ◎ After creating the Document object, but before any script execution, certainly before the parser stops, the user agent must update the session history with the new page.

注記: 【`~app~cache関連の注記$appCache】 ◎ Application cache selection happens in the HTML parser.

この節にて言及した各~taskの`~task源$は、`~network用~task源$で~MUST。 ◎ The task source for the two tasks mentioned in this section must be the networking task source.

7.8.3. ~XML~fileに対する頁~読込~処理~model

~XML~fileを~inlineに表示することになった場合、~UAは,次に挙げる各種 仕様に定義される要件に従わ~MUST ⇒ `XML$r, `XMLNS$r, `RFC7303$r, `DOM$r, および 関連する他の[ `文書$を作成するときの仕様 / 文書に対応する`~XML構文解析器$の仕様 ] ◎ When faced with displaying an XML file inline, user agents must follow the requirements defined in the XML and Namespaces in XML recommendations, RFC 7303, DOM, and other relevant specifications to create a Document object and a corresponding XML parser. [XML] [XMLNS] [RFC7303] [DOM]

注記: これを書いている時点では,~XML仕様~communityは、実際には,~XMLと~DOMとがどう相互作用するか まだ指定していない。 ◎ At the time of writing, the XML specification community had not actually yet specified how XML and the DOM interact.

~UAは、`文書$ %文書 を作成したときは: ◎ ↓

  • 次を走らせ~MUST ⇒ `文書を初期化する$( %文書 ) ◎ After the Document is created, the user agent must initialize the Document object.
  • 上に挙げた各 仕様の規則に則って,文字~符号化法を決定するときには、実際の~HTTP~headerや他の~metadataのうち[ この仕様が与える~algoにより[ 変異される/含意される ]~header ]でないものを利用した上で、 %文書 の`文字~符号化法$docは,そのように確立された符号化法に設定し~MUST。 ◎ The actual HTTP headers and other metadata, not the headers as mutated or implied by the algorithms given in this specification, are the ones that must be used when determining the character encoding according to the rules given in the above specifications. Once the character encoding is established, the document's character encoding must be set to that character encoding.
  • 【`~app~cache関連の処理~要件$appCache】 ◎ If the document element, as parsed according to the XML specifications cited above, is found to be an html element with an attribute manifest whose value is not the empty string, then, as soon as the element is inserted into the document, the user agent must parse the value of that attribute relative to that element's node document, and if that is successful, must apply the URL serializer algorithm to the resulting URL record with the exclude fragment flag set to obtain manifest URL, and then run the application cache selection algorithm with manifest URL as the manifest URL, passing in the newly-created Document. Otherwise, if the attribute is absent, its value is the empty string, or parsing its value fails, then as soon as the document element is inserted into the document, the user agent must run the application cache selection algorithm with no manifest, and passing in the Document. ◎ Because the processing of the manifest attribute happens only once the document element is parsed, any URLs referenced by processing instructions before the document element (such as <?xml-stylesheet?> PIs) will be fetched from the network and cannot be cached.
  • %文書 の根 `Element$I ~nodeの名前空間を精査して,その名前空間に基づいて,代替の処理~toolに~~処理を委託して~MAY — 例: その内容が,実際には syndication feed であると決定されたなら、それを feed ~handlerに渡すなど。 そのような処理に任せることになる場合、この節の手続きは中止した上で,`~navigate$手続きにおける`非~文書~内容として取扱う$とする。

    【 syndication feed — 連携サイト( syndication )から随時更新されるような情報( feed )。 】

    ◎ User agents may examine the namespace of the root Element node of this Document object to perform namespace-based dispatch to alternative processing tools, e.g. determining that the content is actually a syndication feed and passing it to a feed handler. If such processing is to take place, abort the steps in this section, and jump to the next step (labeled non-document content) in the navigate steps above.
  • 前項に該当しない場合, %文書 を伴う`新たな頁で~session履歴を更新-$し~MUST — その時機は:

    • 文書が完全に構文解析される前でもよい(したがって `増分的に具現化する^i ことになる)。
    • どの~script実行よりも前で~MUST。
    ◎ Otherwise, then, with the newly created Document, the user agent must update the session history with the new page. User agents may do this before the complete document has been parsed (thus achieving incremental rendering), and must do this before any scripts are to be executed.
  • 構文解析-時の~error(例えば ~XML名前空間 整形式性~error)に際しては、 %文書 を変異して~inlineに報告して~MAY。 ◎ Error messages from the parse process (e.g. XML namespace well-formedness errors) may be reported inline by mutating the Document.

7.8.4. ~text~fileに対する頁~読込~処理~model

素の~text文書を `閲覧文脈$内に読込むことになるときは、~UAは,次を走らす`~taskを~queueし$~MUST: ◎ When a plain text document is to be loaded in a browsing context, the user agent must queue a task to\

  1. %文書 ~SET 新たな`文書$ ◎ create a Document object,\
  2. %文書 の`種別$doc ~SET `html^l ◎ mark it as being an HTML document,\
  3. %文書 の`内容~型$doc ~SET `資源から算出された~MIME型$V ◎ set its content type to the computed MIME type of the resource (type in the navigate algorithm),\
  4. `文書を初期化する$( %文書 ) ◎ initialize the Document object,\
  5. %構文解析器 ~SET 新たな`~HTML構文解析器$ ◎ create an HTML parser,\
  6. %構文解析器 を %文書 に結付ける ◎ associate it with the Document,\
  7. %構文解析器 は,その~tokenizerが すでに次を順に行ったかのようにしておく ⇒# ~tag名 `pre^l の開始tag~tokenを発した; 1 個の文字 U+000A (LF)を発した; `~PLAINTEXT状態$に切替えた ◎ act as if the tokenizer had emitted a start tag token with the tag name "pre" followed by a single U+000A LINE FEED (LF) character, and switch the HTML parser's tokenizer to the PLAINTEXT state.\

~fetchingを走らせている間に`~network用~task源$から`~task~queue$に入れられる各`~task$は、 %構文解析器 の`入力~byte~stream$を~fetchされた~byte列で埋めて, %構文解析器 に入力~streamの適切な処理を遂行させ~MUST。 ◎ Each task that the networking task source places on the task queue while fetching runs must then fill the parser's input byte stream with the fetched bytes and cause the HTML parser to perform the appropriate processing of the input stream.

素の~text文書である %資源 に対しては、次に挙げる要件が~UAに課される: ◎ ↓

  • %資源 の~byte列を 実際の文字に変換する規則,および その~textを利用者~向けに実際に具現化する規則は、 `資源から算出された~MIME型$V の仕様により定義される。 ◎ The rules for how to convert the bytes of the plain text document into actual characters, and the rules for actually rendering the text to the user, are defined by the specifications for the computed MIME type of the resource (type in the navigate algorithm).
  • %資源 の`文字~符号化法$docは、 %資源 の復号-時に利用された文字~符号化法に設定され~MUST。 ◎ The document's character encoding must be set to the character encoding used to decode the document.
  • 【`~app~cache関連の処理~要件$appCache】 ◎ Upon creation of the Document object, the user agent must run the application cache selection algorithm with no manifest, and passing in the newly-created Document.
  • 可用な~byte列が尽きたときは、 構文解析器が暗黙の~EOF文字を処理する`~taskを~queueし$~MUST — それは、最終的に `load$et ~eventを発火させることになる。 ◎ When no more bytes are available, the user agent must queue a task for the parser to process the implied EOF character, which eventually causes a load event to be fired.
  • %資源 から`文書$ %文書 を作成した後, かつ 頁を構文解析し終えて`なければその前に$,`新たな頁で~session履歴を更新-$し~MUST。 ◎ After creating the Document object, but potentially before the page has finished parsing, the user agent must update the session history with the new page.

    【 “`なければその前に@” — 原文の “, but potentially before” の意図が[ 要件の一部 / 可能性があることを示す単なる説明 / 終える前にそうしてよいことの明示的な許可 ]のどれなのか はっきりしないが、同じ要件~文の一部として but 節の中に記されているので,要件と解釈する下で和訳している。 】

  • %文書 の `head$e 要素に内容を追加して~MAY — 例: ~stylesheetへ~linkする, ~scriptを供する, %文書 に `title$e を与える, 等々。 ◎ User agents may add content to the head element of the Document, e.g., linking to a style sheet, providing script, or giving the document a title.

    注記: 特に、 RFC 3676 の `Format=Flowed^c 特色機能を~supportする~UAは、[ ~textを正しく折返す/ 【行頭の ">" による】 引用用の特色機能を取扱う ]ために,何らかの~styleを適用する必要が生じることになる。 これは、例えば~CSS拡張を利用して遂行することもできる。 ◎ In particular, if the user agent supports the Format=Flowed feature of RFC 3676 then the user agent would need to apply extra styling to cause the text to wrap correctly and to handle the quoting feature. This could be performed using, e.g., a CSS extension.

この節に言及した 2 つの~taskの`~task源$は、`~network用~task源$で~MUST。 ◎ The task source for the two tasks mentioned in this section must be the networking task source.

7.8.5. `multipart/x-mixed-replace^c 資源に対する頁~読込~処理~model

型 `multipart/x-mixed-replace$c を伴う資源を `閲覧文脈$内に読込むことになるときは、~UAは,次に従わ~MUST: ◎ When a resource with the type multipart/x-mixed-replace is to be loaded in a browsing context, the user agent must\

  • `RFC2046$r による `multipart^c 型に対する規則を利用して資源を構文解析する。 ◎ parse the resource using the rules for multipart types. [RFC2046]
  • 資源から得られる ~EACH( %本体~部位 ) に対し,出現順に 次を走らす ⇒ 次を除いて、この節を呼出した`~navi$と同じものを与える下で,`~navigate応答を処理する$ ⇒ %応答 の本体には %本体~部位 を利用する。 また、これまでの反復で,`文書$が作成され`初期化-$docされていた場合は、[ `置換~可能化~flag$V ~SET ~ON ]にする。 ◎ For each body part obtained from the resource, the user agent must run process a navigate response using the new body part and the same browsing context, with replacement enabled if a previous body part from the same resource resulted in a Document object being created and initialized, and otherwise using the same setup as the navigate attempt that caused this section to be invoked in the first place.
  • 前項による,[ 各 本体~部位を,完全に自立的な資源であったかのように処理する目的 ]においては、各 本体~部位に対し[ それに後続する境界に達した所で,当の資源に対する~byte列は尽きた ]かのように動作する。 ◎ For the purposes of algorithms processing these body parts as if they were complete stand-alone resources, the user agent must act as if there were no more bytes for those resources whenever the boundary following the body part is reached.

注記: したがって, `load$et ~event(および,対になる `unload$et ~event)は、各~本体~部位が読込まれる度に発火されることになる。 ◎ Thus, load events (and for that matter unload events) do fire for each body part loaded.

7.8.6. 媒体に対する頁~読込~処理~model

[ 画像 / 動画 / 音声 ]資源を `閲覧文脈$内に読込むことになるときは、~UAは 次をするべきである: ◎ When an image, video, or audio resource is to be loaded in a browsing context, the user agent should\

  1. %文書 ~SET 新たな`文書$ ◎ create a Document object,\
  2. %文書 の`種別$doc ~SET `html^l ◎ mark it as being an HTML document,\
  3. %文書 の`内容~型$doc ~SET `資源から算出された~MIME型$V ◎ set its content type to the computed MIME type of the resource (type in the navigate algorithm),\
  4. `文書を初期化する$( %文書 ) ◎ initialize the Document object,\
  5. %文書 に `html$e 要素を付加する ◎ append an html element to the Document,\
  6. `html$e 要素に `head$e 要素, `body$e 要素を順に付加する ◎ append a head element and a body element to the html element,\
  7. `body$e 要素に[ 資源の媒体に応じて,次の表の 2 列目に与えられる要素 ]を付加する:

    媒体~型 要素 属性
    画像 `img$e `~src-img$a
    動画 `video$e `~src-media$a
    音声 `audio$e `~src-media$a
    ◎ append an element host element for the media, as described below, to the body element,\
  8. 前~段で付加した要素の[ 対応する,前~段の表の 3 列目の属性 ]の値 ~SET 資源の~address ◎ and set the appropriate attribute of the element host element, as described below, to the address of the image, video, or audio resource. ◎ The element host element to create for the media is the element given in the table below in the second cell of the row whose first cell describes the media. The appropriate attribute to set is the one given by the third cell in that same row. ◎ Type of media | Element for the media | Appropriate attribute Image | img | src Video | video | src Audio | audio | src

次に,~UAは、`構文解析を停止した$かのように動作し~MUST。 ◎ Then, the user agent must act as if it had stopped parsing.

【`~app~cache関連の処理~要件$appCache】 ◎ Upon creation of the Document object, the user agent must run the application cache selection algorithm with no manifest, and passing in the newly-created Document.

~UAは、`文書$が作成された後, かつ 頁を構文解析し終えて`なければその前に$,`新たな頁で~session履歴を更新-$し~MUST。 ◎ After creating the Document object, but potentially before the page has finished fully loading, the user agent must update the session history with the new page.

~UAは、`文書$の `head$e 要素に内容を追加して~MAY / %~host要素 に内容~属性を追加して~MAY — 例: ~stylesheetへの~link / ~scriptを供する / 文書に `title$e を与える / 媒体を `autoplay$a にする 等々。 ◎ User agents may add content to the head element of the Document, or attributes to the element host element, e.g., to link to a style sheet, to provide a script, to give the document a title, or to make the media autoplay.

7.8.7. ~pluginを利用する内容に対する頁~読込~処理~model

外部~資源を具現化することを要する資源を,`閲覧文脈$内に読込むことになるときは、~UAは 次をするべきである: ◎ When a resource that requires an external resource to be rendered is to be loaded in a browsing context, the user agent should\

  1. %文書 ~SET 新たな`文書$ ◎ create a Document object,\
  2. %文書 の`種別$doc ~SET `html^l ◎ mark it as being an HTML document and\
  3. %文書 を `~plugin文書@ とする ◎ mark it as being a plugin document,\
  4. %文書 の`内容~型$doc ~SET `資源から算出された~MIME型$V ◎ set its content type to the computed MIME type of the resource (type in the navigate algorithm),\
  5. `文書を初期化する$( %文書 ) ◎ initialize the Document object,\
  6. `文書$に `html$e 要素を付加する ◎ append an html element to the Document,\
  7. `html$e 要素に `head$e 要素, `body$e 要素を順に付加する ◎ append a head element and a body element to the html element,\
  8. `body$e 要素に `embed$e 要素を付加する ◎ append an embed to the body element,\
  9. `embed$e 要素の `~src-embed$a 属性を資源の~addressに設定する ◎ and set the src attribute of the embed element to the address of the resource.

注記: 用語 `~plugin文書$は、[ `plugin-types^dir 指令をかいくぐるために `iframe$e が利用されることは生じ得ない ]ことを確保するための仕組みの一部として, `CSP$r により利用される。 ◎ The term plugin document is used by Content Security Policy as part of the mechanism that ensures iframes can't be used to evade plugin-types directives. [CSP]

次に,~UAは、`構文解析を停止した$かのように動作し~MUST。 ◎ Then, the user agent must act as if it had stopped parsing.

【`~app~cache関連の処理~要件$appCache】 ◎ Upon creation of the Document object, the user agent must run the application cache selection algorithm with no manifest, and passing in the newly-created Document.

~UAは、`文書$が作成された後, かつ 頁を構文解析し終えて`なければその前に$,`新たな頁で~session履歴を更新-$し~MUST。 ◎ After creating the Document object, but potentially before the page has finished fully loading, the user agent must update the session history with the new page.

~UAは[ `文書$の `head$e 要素 / `embed$e 要素の属性 ]に内容を追加して~MAY — 例: ~stylesheetへ~linkする, 文書に `title$e を与える, 等々。 ◎ User agents may add content to the head element of the Document, or attributes to the embed element, e.g. to link to a style sheet or to give the document a title.

注記: [ `閲覧文脈~sandbox化( ~plugin )~flag$ ~IN `文書$の`作動中の~sandbox法~flag集合$ ]の下で[ 関連する`~plugin$を`保安化-$できなかった ]場合には、合成された `embed$e 要素は, 内容を具現化するのに失敗することになる。 ◎ If the Document's active sandboxing flag set has its sandboxed plugins browsing context flag set, the synthesized embed element will fail to render the content if the relevant plugin cannot be secured.

7.8.8. ~DOMを有さない~inline内容に対する頁~読込~処理~model

~UAは、頁を`閲覧文脈$内に~inlineに表示するときは、次をするべきである: ◎ When the user agent is to display a user agent page inline in a browsing context, the user agent should\

  1. %文書 ~SET 新たな`文書$ ◎ create a Document object,\
  2. %文書 の`種別$doc ~SET `html^l ◎ mark it as being an HTML document,\
  3. %文書 の`内容~型$doc ~SET `text/html^l ◎ set its content type to "text/html",\
  4. `文書を初期化する$( %文書 ) ◎ initialize the Document object,\
  5. 次のいずれかを行う: ◎ and then either\

    • %文書 を[ `文書$の通常の具現化~規則を利用して具現化されない ]ような~customな具現化に結付ける ◎ associate that Document with a custom rendering that is not rendered using the normal Document rendering rules, or\
    • %文書 を[ それが~UAが具現化しようと求める内容を表現する ]ように変異させる。 ◎ mutate that Document until it represents the content the user agent wants to render.

~UAは、頁が設定しておかれたなら,`構文解析を停止した$かのように動作し~MUST。 ◎ Once the page has been set up, the user agent must act as if it had stopped parsing.

【`~app~cache関連の処理~要件$appCache】 ◎ Upon creation of the Document object, the user agent must run the application cache selection algorithm with no manifest, passing in the newly-created Document.

~UAは、`文書$が作成された後, かつ 頁を完全に設定して`なければその前に$,`新たな頁で~session履歴を更新-$し~MUST。 ◎ After creating the Document object, but potentially before the page has been completely set up, the user agent must update the session history with the new page.

7.8.9. 素片へ~navigateするとき

~UAは,素片へ~navigateすることになったときは、所与の ( `閲覧文脈$ %B, `~URL$ %~URL, %置換~可能化~flag ) に対し,次を走らせ~MUST: ◎ When a user agent is supposed to navigate to a fragment, optionally with replacement enabled, then the user agent must run the following steps:

  1. ~Assert: %~URL の`素片$url ~NEQ ~NULL 【この段は、この訳による補完。】
  2. %履歴 ~LET %B の`~session履歴$ ◎ ↓
  3. ~IF[ %置換~可能化~flag ~EQ ~OFF ] ⇒ %履歴 内から, %履歴 の`現在の~entry$より後の~entryはすべて除去する ◎ If not with replacement enabled, then remove all the entries in the browsing context's session history after the current entry. If the current entry is the last entry in the session history, then no entries are removed.

    注記: これは、~UAの~UIに影響するとは限らない。 ◎ This doesn't necessarily have to affect the user agent's user interface.

  4. %B の`~top-level閲覧文脈$の`文書~族$内の ~EACH( `文書$ %D ) に対し ⇒ %D に結付けられている`履歴~走査~task源$により~queueされた`~task$があれば,それらを除去する ◎ Remove any tasks queued by the history traversal task source that are associated with any Document objects in the top-level browsing context's document family.
  5. %~entry ~LET 当の資源とその文書を表現する,次のものからなる新たな`~session履歴~entry$:

    • `文書$ ~SET %B にて`作動中の文書$
    • 関係する状態【おそらく、`直列形の状態$を指す】
    • `~scroll復旧~mode$ ~SET `現在の~entry$のそれ
    • `~URL$ ~SET %~URL

    %~entry の~titleは未設定のままにする

    ◎ Append a new entry at the end of the History object representing the new resource and its Document object, related state, and current entry's scroll restoration mode. Its URL must be set to the address to which the user agent was navigating. The title must be left unset.
  6. `History$I ~objの末尾に %~entry を付加する ◎ ↑
  7. `履歴を走査する$( %~entry, %置換~可能化~flag, `~non-blocking~event~flag$V ~SET ~ON ) — これは、今や文書の`~URL$docになった`素片へ~scroll$することになる。 ◎ Traverse the history to the new entry, with replacement enabled if this was invoked with replacement enabled, and with the non-blocking events flag set. This will scroll to the fragment given in what is now the document's URL.

注記: 素片が指す`~ID$を有する要素が まだ構文解析されていないため,~scrollできなかった場合、代わりに,元の`~navi$~algoから呼ばれる[ `新たな頁で~session履歴を更新-$する~algo ]の最後の方で,~scrollingが~careされることになる。 ◎ If the scrolling fails because the relevant ID has not yet been parsed, then the original navigation algorithm will take care of the scrolling instead, as the last few steps of its update the session history with the new page algorithm.


%文書 の `素片へ~scroll@ するよう要求されたときは、~UAは,次を行わ~MUST: ◎ When the user agent is required to scroll to the fragment and\

  1. %部位 ~LET %文書 内の`指示された部位$doc ◎ the indicated part of the document,\
  2. ~IF[ %部位 ~EQ ε ]~OR[ %部位 は`具現化されて$いない ] ⇒ ~RET ◎ if any, is being rendered,\
  3. 次のいずれかを行う: ◎ the user agent must either\

    • 下に述べるように,文書の~scroll位置を %部位 に変更する。 ◎ change the scrolling position of the document using the following algorithm,\
    • %部位 に利用者の注目を引くような他の何らかの動作を遂行する。 ◎ or perform some other action such that the indicated part of the document is brought to the user's attention. If there is no indicated part, or if the indicated part is not being rendered, then the user agent must do nothing.\

`文書$ %文書 の~scroll位置を %部位 に変更するときは: ◎ The aforementioned algorithm is as follows:

  1. %文書 の`標的~要素$ ~SET ~NULL ◎ If there is no indicated part of the document, set the Document's target element to null.
  2. %部位 に応じて:

    `文書の上端^i ◎ If the indicated part of the document is the top of the document, then:
    %文書 の`開始位置へ~scroll$する `CSSOMVIEW$r ◎ Set the Document's target element to null. ◎ Scroll to the beginning of the document for the Document. [CSSOMVIEW]
    要素である ◎ Otherwise:
    1. %文書 の`標的~要素$ ~SET %部位 ◎ Let target be element that is the indicated part of the document. ◎ Set the Document's target element to target.
    2. %部位 を`~viewの中へ~scrollする$( `auto^l, `start^l, `nearest^l ) `CSSOMVIEW$r ◎ Scroll target into view, with behavior set to "auto", block set to "start", and inline set to "nearest". [CSSOMVIEW]
    3. `~objを~focusする$( %部位, %文書 の`表示域$ ) ◎ Run the focusing steps for target, with the Document's viewport as the fallback target.
    4. %文書 における`逐次的~focus~naviの始点$ ~SET %部位 ◎ Move the sequential focus navigation starting point to target.

`文書$ %文書 内の `指示された部位@doc は、`素片$urlがあれば,それが指示するものになる。 `素片$urlから~nodeにどう対応付けるかの意味論は、 %文書 が利用している`~MIME型$を定義する仕様により定義される(例えば、`~XML~MIME型$に対する`素片$urlの処理は `RFC7303$r が責を負う)。 ◎ The indicated part of the document is the one that the fragment, if any, identifies. The semantics of the fragment in terms of mapping it to a node is defined by the specification that defines the MIME type used by the Document (for example, the processing of fragments for XML MIME types is the responsibility of RFC7303). [RFC7303]

各 `文書$には、 `target$ps 疑似類を定義するために利用される `標的~要素@ がある。 それは、初期~時は~NULLであり,上の~algoで更新される。 ◎ There is also a target element for each Document, which is used in defining the :target pseudo-class and is updated by the above algorithm. It is initially null.

~HTML文書(および, `~HTML~MIME型$ ) %文書 に対しては、 %文書 内の`指示された部位$docを決定するときは,次の処理~modelに従わ~MUST。 ◎ For HTML documents (and HTML MIME types), the following processing model must be followed to determine what the indicated part of the document is.

  1. %素片 ~LET %文書 の`~URL$docの`素片$url ◎ Let fragment be the document's URL's fragment.
  2. ~Assert: %素片 ~NEQ ~NULL 【この段は、この訳による補完。】
  3. ~IF[ %素片 ~EQ 空~文字列 ] ⇒ ~RET `文書の上端^i ◎ If fragment is the empty string, then the indicated part of the document is the top of the document; return.
  4. ~IF[ `指示された要素を見出す$( %文書, %素片 ) ~NEQ ~NULL ] ⇒ ~RET その結果 ◎ If find a potential indicated element with fragment returns non-null, then the return value is the indicated part of the document; return.
  5. %素片~byte列 ~SET `文字列を~byte列に~percent-復号する$( %素片 ) ◎ Let fragmentBytes be the result of string percent decoding fragment.
  6. %復号-済み素片 ~LET `~BOMはそのままに~UTF-8復号する$( %素片~byte列 ) ◎ Let decodedFragment be the result of running UTF-8 decode without BOM on fragmentBytes.
  7. ~IF[ `指示された要素を見出す$( %文書, %復号-済み素片 ) ~NEQ ~NULL ] ⇒ ~RET その結果 ◎ If find a potential indicated element with decodedFragment returns non-null, then the return value is the indicated part of the document; return.
  8. ~IF[ %復号-済み素片 ~EQ`大小無視$sub `top^l ] ⇒ ~RET `文書の上端^i ◎ If decodedFragment is an ASCII case-insensitive match for the string top, then the indicated part of the document is the top of the document; return.
  9. ~RET ε ◎ There is no indicated part of the document.

`指示された要素を見出す@ ときは、所与の ( `文書$ %文書, 文字列 %素片 ) に対し,次を走らす: ◎ To find a potential indicated element given a string fragment, run these steps:

  1. ~IF[ %文書 の`木~内$に[ `~ID$ ~EQ %素片 ]を満たす要素はある ] ⇒ ~RET 該当する要素のうち,`木~順序$で最初のもの ◎ If there is an element in the document tree that has an ID equal to fragment, then return the first such element in tree order.
  2. ~IF[ %文書 の`木~内$に[ `name$a 属性を有していて,その値 ~EQ %素片 ]を満たす `a$e 要素はある ] ⇒ ~RET 該当する要素のうち,`木~順序$で最初のもの ◎ If there is an a element in the document tree that has a name attribute whose value is equal to fragment, then return the first such element in tree order.
  3. ~RET ~NULL ◎ Return null.

この節に言及した~taskの`~task源$は `~DOM操作~task源$で~MUST。 ◎ The task source for the task mentioned in this section must be the DOM manipulation task source.

7.8.10. 履歴の走査

`履歴を走査する@ ときは、所与の:

  • `~session履歴~entry$ %~entry
  • `置換~可能化~flag@V (省略時は ~OFF )
  • `~non-blocking~event~flag@V (省略時は ~OFF )
  • `履歴~navi~flag@V (省略時は ~OFF )

に対し,次を走らせ~MUST:

◎ To traverse the history to a session history entry entry, optionally with replacement enabled, optionally with the non-blocking events flag set, and optionally with the history-navigation flag set:

注記: この~algoは、明示的に`履歴を前/後に走査する$ときのみならず,他の状況においても呼出される — 例えば、閲覧文脈を`~navigate$するときに,`新たな頁で~session履歴を更新-$する一部として。 ◎ This algorithm is not just invoked when explicitly going back or forwards in the session history — it is also invoked in other situations, for example when navigating a browsing context, as part of updating the session history with the new page.

  1. %履歴 ~LET %~entry が属する`~session履歴$ ◎ ↓
  2. %B ~LET %履歴 を有する`閲覧文脈$ ◎ ↓
  3. ~IF[ %~entry はもはや`文書$を保持していない ]: ◎ If entry no longer holds a Document object, then:

    1. %要請 ~LET 次のようにされた新たな`要請$ ⇒ `~url$rq ~SET %~entry の`~URL$ ◎ Let request be a new request whose url is entry's URL.
    2. ~IF[ `履歴~navi~flag$V ~EQ ~ON ] ⇒ %要請 の`履歴~navi~flag$rq ~SET ~ON ◎ If the history-navigation flag is set, then set request's history-navigation flag.
    3. `~entryを更新する$ためとして,[ %~entry を最初に作成したときに利用した`~source閲覧文脈$ ]を %要請 へ`~navigate$する(これは、[ `置換~可能化~flag$V ~EQ ~ON ]の下では決して起こらない) ◎ Navigate the browsing context to request to perform an entry update of entry. The navigation must be done using the same source browsing context as was used the first time entry was created. (This can never happen with replacement enabled.)

      注記: `~navigate$ ~algoは、走査を完了するために,この~algoを再び呼出す — その時点で %~entry は`文書$を保持することになる。 ◎ The "navigate" algorithm reinvokes this "traverse" algorithm to complete the traversal, at which point entry holds a Document object.

      注記: 資源が非冪等~動作を利用して得られたものであった場合( 例えば `POST^hm による~form提出)や, 資源はもはや可用でない場合(例えば~computerは今や~offlineになっていて,頁も~cacheされていないため)など、再度そこへ~navigateできないこともある。 この事例では、~naviの結果は,以前と異なる頁になる — 例えば,問題を説明する~error~messageや, ~formを再度~提出する~UIを提供するなど。 ◎ If the resource was obtained using a non-idempotent action, for example a POST form submission, or if the resource is no longer available, for example because the computer is now offline and the page wasn't cached, navigating to it again might not be possible. In this case, the navigation will result in a different page than previously; for example, it might be an error message explaining the problem or offering to resubmit the form.

    4. ~RET ◎ Return.
  4. %現~entry ~LET %履歴 の`現在の~entry$ ◎ ↓
  5. ~IF[ %現~entry の~titleは[ `pushState()$m / `replaceState()$m ]~methodにより設定されていない ] ⇒ %現~entry の~title ~SET `document.title$m ~IDL属性の値を取得した結果 ◎ If the current entry's title was not set by the pushState() or replaceState() methods, then set its title to the value returned by the document.title IDL attribute.
  6. 適切になる, かつ ~UAが持続化するよう望む状態があれば、それらを反映するように,%現~entry を更新する — この~entryは、`持続的な利用者~状態$を伴うものとされる。 ◎ If appropriate, update the current entry in the browsing context's Document object's History object to reflect any state that the user agent wishes to persist. The entry is then said to be an entry with persisted user state.
  7. %文書 ~LET %~entry の`文書$ ◎ ↓
  8. %現~文書 ~LET %現~entry の`文書$( ~EQ %B にて`作動中の文書$) ◎ ↓
  9. ~IF[ %文書 ~NEQ %現~文書 ]: ◎ If entry has a different Document object than the current entry, then run the following substeps:

    1. %B の`~top-level閲覧文脈$の`文書~族$内の ~EACH( `文書$ ) に対し ⇒ `文書$に結付けられている`履歴~走査~task源$により~queueされた`~task$があれば,それらを除去する ◎ Remove any tasks queued by the history traversal task source that are associated with any Document objects in the top-level browsing context's document family.
    2. ~IF[ ( %文書 の`生成元$, %現~文書 の`生成元$ ) は`同一生成元$でない ]: ◎ If the origin of entry's Document object is not the same as the origin of the current entry's Document object, then run the following subsubsteps:

      1. %履歴 内の ~EACH( ~entry %e ) に対し ⇒ ~IF[ ( %e の`文書$の`生成元$, %現~文書 の`生成元$ ) は`同一生成元$である ]~AND[ %e は %現~entry と連続的である 【~~参照】 ] ⇒ %e の`閲覧文脈~名$ ~SET %B の`閲覧文脈~名$ ◎ The current browsing context name must be stored with all the entries in the history that are associated with Document objects with the same origin as the active document and that are contiguous with the current entry.
      2. ~IF[ %B は`~top-level閲覧文脈$である ]~AND[ %B は`補助~閲覧文脈$でない ] ⇒ %B の`閲覧文脈~名$ ~SET 空~文字列 ◎ If the browsing context is a top-level browsing context, but not an auxiliary browsing context, then set the browsing context's name to the empty string.
    3. `閲覧文脈にて作動中の文書を設定する$( %B, %文書 ) ◎ Set the active document of the browsing context to entry's Document object.
    4. ~IF[ %~entry の`閲覧文脈~名$ ~NEQ ε ]: ◎ If entry has a browsing context name, then run the following subsubsteps:

      1. %B の`閲覧文脈~名$ ~SET %~entry の`閲覧文脈~名$ ◎ Set the browsing context's browsing context name to entry's browsing context name.
      2. %履歴 内の ~EACH( ~entry %e ) に対し ⇒ ~IF[ ( %e の`文書$の`生成元$, %文書 の`生成元$ ) は`同一生成元$である ]~AND[ %e は %~entry と連続的である ] ⇒ %e の`閲覧文脈~名$ ~SET ε ◎ Clear any browsing context names of all entries in the history that are associated with Document objects with the same origin as the new active document and that are contiguous with entry.
    5. %文書 内の ~EACH( ~form~control %E ) に対し ⇒ ~IF[ %E の`自動充填~欄~名$ ~EQ `off$v ] ⇒ %E の`再設定~algo$を呼出す ◎ If entry's Document object has any form controls whose autofill field name is "off", invoke the reset algorithm of each of those elements.
    6. ~IF[ %文書 の`現在の文書の準備度$ ~EQ `complete^l ] ⇒ 次を走らす`~taskを~queueする$: ◎ If the current document readiness of entry's Document object is "complete", then queue a task to run the following subsubsteps:

      1. ~IF[ %文書 の`頁~表示中~flag$doc ~EQ ~T ] ⇒ ~RET ◎ If the Document's page showing flag is true, then abort these steps.
      2. %文書 の`頁~表示中~flag$doc ~SET ~T ◎ Set the Document's page showing flag to true.
      3. `適用-可能な仕様$により定義されている `~session履歴~文書の可視性を変更する手続き@ があれば、それらの各~手続きを %文書 を渡して走らす ◎ Run any session history document visibility change steps for Document that are defined by other applicable specifications.

        注記: これは、 Page Visibility 仕様からの利用-に特に意図されている。 `PAGEVIS$r ◎ This is specifically intended for use by the Page Visibility specification. [PAGEVIS]

      4. %文書 の`~window$に向けて,名前 `pageshow$et の`~eventを発火する$( `~targetを上書きする^i ) — `PageTransitionEvent$I を利用し,次のように初期化して ⇒# `persisted$m 属性 ~SET ~T ◎ Fire an event named pageshow at the Document object's Window object, using PageTransitionEvent, with the persisted attribute initialized to true, and legacy target override flag set.
  10. %文書 の`~URL$doc ~SET %~entry の`~URL$ ◎ Set the document's URL to entry's URL.
  11. %~hash変化あり ~LET ~F ◎ ↓
  12. ~IF[ %~entry の~URLの`素片$url ~NEQ %現~entry の`素片$url ]~AND[ %文書 ~EQ %現~文書 ] ⇒# %~hash変化あり ~LET ~T; %旧~URL ~LET %現~entry の~URL; %新~URL ~LET %~entry の~URL ◎ If entry has a URL whose fragment differs from that of the current entry's when compared in a case-sensitive manner, and the two share the same Document object, then let hash changed be true, and let old URL be the current entry's URL and new URL be entry's URL. Otherwise, let hash changed be false.
  13. ~IF[ `置換~可能化~flag$V ~EQ ~ON ] ⇒ %履歴 内で %~entry の直前にある~entryを除去する ◎ If the traversal was initiated with replacement enabled, remove the entry immediately before the specified entry in the session history.
  14. ~IF[ %~entry は`持続的な利用者~状態$を伴わない ]~AND[ %~entry の`~URL$の`素片$url ~NEQ ~NULL ] ⇒ `素片へ~scroll$する ◎ If entry is not an entry with persisted user state, but its URL's fragment is non-null, then scroll to the fragment.
  15. %履歴 の`現在の~entry$ ~SET %~entry ◎ Set the current entry to entry.
  16. %状態 ~LET %~entry の`直列形の状態$ ◎ ↓
  17. ~IF[ %状態 ~NEQ ~NULL ] ⇒ %状態 ~SET `StructuredDeserialize$jA( %状態, `現在の~Realm~Record$ ) ⇒ 例外が投出されたときは、~catchして ⇒ %状態 ~SET ~NULL (例外は無視する) ◎ Let targetRealm be the current Realm Record. ◎ If entry has serialized state, then let state be StructuredDeserialize(entry's serialized state, targetRealm). If this throws an exception, catch it, ignore the exception, and let state be null. ◎ Otherwise, let state be null.
  18. `history.state$m ~SET %状態 ◎ Set history.state to state.
  19. %状態~変化あり ~LET [ %文書 の`最近の~entry$ ~NIN { ε, %~entry } ならば ~T / ~ELSE_ ~F ] ◎ Let state changed be true if entry's Document object has a latest entry, and that entry is not entry; otherwise let it be false.
  20. %文書 の`最近の~entry$ ~SET %~entry ◎ Set entry's Document object's latest entry to entry.
  21. 次に与える~taskを, `~non-blocking~event~flag$V に応じて ⇒# ~OFF ならば`即時に$走らす / ~ON ならば`~queueする$ ◎ If the non-blocking events flag is not set, then run the following substeps immediately. Otherwise, the non-blocking events flag flag is set; queue a task to run the following substeps instead.

    ~taskは、次の下位手続きを走らす: ◎ ↑

    1. ~IF[ %状態~変化あり ~EQ ~T ] ⇒ %文書 の`~window$に向けて,名前 `popstate$et の`~eventを発火する$ — `PopStateEvent$I を利用し,次のように初期化して ⇒# `state$m 属性 ~SET %状態 ◎ If state changed is true, then fire an event named popstate at the Document object's Window object, using PopStateEvent, with the state attribute initialized to state.
    2. ~IF[ %~entry は`持続的な利用者~状態$を伴う ] ⇒ ~UAは、`持続的な利用者~状態を復旧-$して, %文書 と その具現化の側面を更新して~MAY ◎ If entry is an entry with persisted user state, then the user agent may restore persisted user state and update aspects of the document and its rendering.
    3. ~IF[ %~hash変化あり ~EQ ~T ] ⇒ %B の`~window$に向けて,名前 `hashchange$et の`~eventを発火する$ — `HashChangeEvent$I を利用し,次のように初期化して ⇒# `oldURL$m 属性 ~SET %旧~URL, `newURL$m 属性 ~SET %新~URL ◎ If hash changed is true, then fire an event named hashchange at the browsing context's Window object, using HashChangeEvent, with the oldURL attribute initialized to old URL and the newURL attribute initialized to new URL.

上に言及された~taskの`~task源$は `~DOM操作~task源$で~MUST。 ◎ The task source for the tasks mentioned above is the DOM manipulation task source.

7.8.10.1. 持続的な利用者~状態の復旧

~UAは、`~session履歴~entry$ %~entry から `持続的な利用者~状態を復旧-@ するときは,次の手続きを即時に走らせ~MUST: ◎ When the user agent is to restore persisted user state from a history entry, it must run the following steps immediately:

  1. %文書 ~LET %~entry の`文書$ ◎ ↓
  2. ~IF[ %~entry の`~scroll復旧~mode$ ~EQ `manual$l ] ⇒ ~UAは、[ %文書 / %文書 の~scroll可能域 ]に対する~scroll位置を復旧するべきでない — ただし、~scroll可能域のうち,その~scroll復旧が[ %文書 が`入子にして$いる`閲覧文脈$の`~session履歴~entry$の`~scroll復旧~mode$ ]により制御されているものは除く

    ~ELSE ⇒ ~UAは、~scroll位置を復旧して~MAY

    ◎ If the entry has a scroll restoration mode, let scrollRestoration be that. Otherwise let scrollRestoration be "auto" ◎ If scrollRestoration is "manual" the user agent should not restore the scroll position for the Document or any of its scrollable regions, with the exception of any nested browsing contexts whose scroll restoration is controlled by their own history entry's scroll restoration mode, otherwise, it may do so.
  3. ~UAの任意選択で ⇒ %文書 とその具現化の他の側面を更新する — 具体例として,~UAが以前に記録した~form欄の値など。 ◎ Optionally, update other aspects of the document and its rendering, for instance values of form fields, that the user agent had previously recorded.

注記: 持続的~状態が,そのような~controlにおける利用者~入力の書字方向性を含む場合、これには,次に該当する要素の `dir$a 属性を更新することも含まれる ⇒ `textarea$e 要素 / `input$e 要素のうち[ その `type$a 属性の状態 ~IN { `Text$st, `Search$st } ]を満たすもの ◎ This can even include updating the dir attribute of textarea elements or input elements whose type attribute is in either the Text state or the Search state, if the persisted state includes the directionality of user input in such controls.

注記: ~UAが~scroll位置を復旧しないことは、~scroll位置が特定0の値(例: (0,0) )に~~維持されることを含意するものではない。 実際の~scroll位置は[ ~naviの種別や, ~UAによる~caching-strategy ]に依存する。 なので、~web~appは,特定0の~scroll位置に決まるとは見做せない — ~appには、自身が求めるものに設定することが督促される。 ◎ Not restoring the scroll position by user agent does not imply that the scroll position will be left at any particular value (e.g., (0,0)). The actual scroll position depends on the navigation type and the user agent's particular caching strategy. So web applications cannot assume any particular scroll position but rather are urged to set it to what they want it to be.

7.8.10.2. `PopStateEvent^I ~interface

[Exposed=Window,
Constructor(DOMString type, optional `PopStateEventInit$I eventInitDict)]
interface `PopStateEvent@I : `Event$I {
  readonly attribute any `state$m;
};

dictionary `PopStateEventInit@I : `EventInit$I {
  any state = null;
};
%event . `state$m
`pushState()$m / `replaceState()$m に供された情報の複製を返す。 ◎ Returns a copy of the information that was provided to pushState() or replaceState().
`state@m
取得子は、初期化-時の値を返さ~MUST。 ◎ The state attribute must return the value it was initialized to.\
この~eventに対する文脈~情報を表現する。 表現される状態が`文書$の初期~状態の場合は ~NULL になる。 ◎ It represents the context information for the event, or null, if the state represented is the initial state of the Document.

7.8.10.3. `HashChangeEvent^I ~interface

[Exposed=Window,
Constructor(DOMString type, optional `HashChangeEventInit$I eventInitDict)]
interface `HashChangeEvent@I : `Event$I {
  readonly attribute USVString `oldURL$m;
  readonly attribute USVString `newURL$m;
};

dictionary `HashChangeEventInit@I : `EventInit$I {
  USVString oldURL = "";
  USVString newURL = "";
};
%event . `oldURL$m
履歴を走査する直前の`~session履歴~entry$の`~URL$を返す。 ◎ Returns the URL of the session history entry that was previously current.
%event . `newURL$m
履歴を走査した直後の`~session履歴~entry$の`~URL$を返す。 ◎ Returns the URL of the session history entry that is now current.
`oldURL@m
取得子は、初期化-時の値を返さ~MUST。 ◎ The oldURL attribute must return the value it was initialized to.\
これは、この~event用の文脈~情報 — 特定的には、履歴を走査する直前の`~session履歴~entry$の~URL — を表現する。 ◎ It represents context information for the event, specifically the URL of the session history entry that was traversed from.
`newURL@m
取得子は、初期化-時の値を返さ~MUST。 ◎ The newURL attribute must return the value it was initialized to.\
これは、この~event用の文脈~情報 — 特定的には、履歴を走査した直後の`~session履歴~entry$の~URL — を表現する。 ◎ It represents context information for the event, specifically the URL of the session history entry that was traversed to.

7.8.10.4. `PageTransitionEvent^I ~interface

[Exposed=Window,
Constructor(DOMString type, optional `PageTransitionEventInit$I eventInitDict)]
interface `PageTransitionEvent@I : `Event$I {
  readonly attribute boolean `persisted$m;
};

dictionary `PageTransitionEventInit@I : `EventInit$I {
  boolean persisted = false;
};
%event . `persisted$m
`pageshow$et ~eventに対しては、[ 頁が新たに読込まれつつある(したがって `load$et ~eventが発火されることになる)ならば ~F / ~ELSE_ ~T ]を返す。 ◎ For the pageshow event, returns false if the page is newly being loaded (and the load event will fire). Otherwise, returns true.
`pagehide$et ~eventに対しては、[ 当の頁が最後に消え去るときには ~F / ~ELSE_ ~T ]を返す。 ~T は、この頁は,利用者がこの頁に~navigateして戻った場合に(その頁を回復可能でなくするものが他になければ)再利用され得ることを意味する。 ◎ For the pagehide event, returns false if the page is going away for the last time. Otherwise, returns true, meaning that (if nothing conspires to make the page unsalvageable) the page might be reused if the user navigates back to this page.

頁を回復可能でなくするものには次が含まれる:

  • `document.open(type, replace)$m
  • `beforeunload$et ~eventに対する~listenerがあるとき
  • `unload$et ~eventに対する~listenerがあるとき
  • 回復可能でない `iframe$e があるとき
  • 作動中の `WebSocket$I ~objがあるとき
  • `文書を中止-$したとき
◎ Things that can cause the page to be unsalvageable include: • document.open(type, replace) • Listening for beforeunload events • Listening for unload events • Having iframes that are not salvageable • Active WebSocket objects • Aborting a Document
`persisted@m
取得子は、初期化-時の値を返さ~MUST。 ◎ The persisted attribute must return the value it was initialized to.\
これは~eventの文脈~情報を表現する。 ◎ It represents the context information for the event.

7.8.11. 文書の~unload法

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

`回復可能~状態@doc
初期~時には ~T にされ~MUST。
`~unload発火-済み~flag@doc
初期~時には ~F にされ~MUST。
`頁~表示中~flag@doc
初期~時には ~F にされ~MUST。 この~flagは、~scriptが[ `pageshow$et, `pagehide$et ]~eventを整合的に受信する(例: `pageshow$et を間に挟むことなく 2 つの `pagehide$et ~eventを続けて受信したり,その逆が生じることは決してない)ことを確保するために利用される。
◎ A Document has a salvageable state, which must initially be true, a fired unload flag, which must initially be false, and a page showing flag, which must initially be false. The page showing flag is used to ensure that scripts receive pageshow and pagehide events in a consistent manner (e.g. that they never receive two pagehide events in a row without an intervening pageshow, or vice versa).

各`~event-loop$は、 `終了入子~level@ と呼ばれる~counterを有する — 初期~時には 0 にされ~MUST。 ◎ Event loops have a termination nesting level counter, which must initially be 0.

`文書の~unloadを~promptする@ ときは、所与の ( `文書$ %文書, %再帰的~flag ~IN { `再帰的^i, ε }(省略時は ε ) ) に対し,次を走らす: ◎ To prompt to unload, given a Document object document and optionally a recursiveFlag, run these steps:

  1. `~event-loop$の`終了入子~level$ ~INCBY 1 ◎ Increase the event loop's termination nesting level by 1.
  2. %文書 の`~unload中の~openは無視する~counter$ ~INCBY 1 ◎ Increase the document's ignore-opens-during-unload counter by 1.
  3. %event ~LET `BeforeUnloadEvent$I ~interfaceを利用する`~eventを作成-$した結果 ◎ Let event be the result of creating an event using BeforeUnloadEvent.
  4. %event の ( `type$m, `cancelable$m ) 属性 ~SET ( `beforeunload$et, ~T ) に初期化する ◎ Initialize event's type attribute to beforeunload and its cancelable attribute true.
  5. %文書 の`~window$に向けて %event を`配送-$する ◎ Dispatch: Dispatch event at document's Window object.
  6. `~event-loop$の`終了入子~level$ ~DECBY 1 ◎ Decrease the event loop's termination nesting level by 1.
  7. ~IF[ %event 配送-時に何らかの~event~listenerが誘発された ] ⇒ %文書 の`回復可能~状態$doc ~SET ~F ◎ If any event listeners were triggered by the earlier dispatch step, then set document's salvageable state to false.
  8. ~IF[ 次のいずれも満たされる ]…: ◎ ↓

    • `~sandbox化( ~modal )~flag$ ~NIN %文書 の`作動中の~sandbox法~flag集合$ ◎ If document's active sandboxing flag set does not have its sandboxed modals flag set, and\
    • [ %event の `returnValue$m 属性 ~NEQ 空~文字列 ]~OR[ %event は取消された ] ◎ the returnValue attribute of the event object is not the empty string, or if the event was canceled, then\

    …ならば ⇒ ~UAは、利用者に %文書 の~unloadを望むかどうかを確認をとって~MAY: ◎ the user agent may ask the user to confirm that they wish to unload the document.

    注記: 利用者に示される~messageは、~custom化することはできず,~UAにより決定される。 特に、 `returnValue$m 属性の実際の値は無視される。 ◎ The message shown to the user is not customizable, but instead determined by the user agent. In particular, the actual value of the returnValue attribute is ignored.

    • ~UAは,そうすることが利用者にとって[ いらつく/紛らわしい/的外れである ]と判定したときは、利用者に確認をとらないことが奨励される。 単純な経験則として、利用者が %文書 とやりとりしていなければ,とらないことが挙げられる。 ◎ The user agent is encouraged to avoid asking the user for confirmation if it judges that doing so would be annoying, deceptive, or pointless. A simple heuristic might be that if the user has not interacted with the document, the user agent would not ask for confirmation before unloading it.
    • ~UAは,利用者に確認をとる場合には、利用者の応答を待機している間,`静止-$し~MUST。 ◎ If the user agent asks the user for confirmation, it must pause while waiting for the user's response.
    • 利用者から頁~naviの確認をとれなかった場合、 %文書 の `~unloadを拒否-@doc したとされる。 ◎ If the user did not confirm the page navigation, then the user agent refused to allow the document to be unloaded.
  9. ~IF[ %再帰的~flag ~EQ ε ]: ◎ If the recursiveFlag is not set, then:

    1. %文書 の`子孫~閲覧文脈~list$ 内の ~EACH( `閲覧文脈$ %B ) に対し: ◎ Let descendants be the list of the descendant browsing contexts of document. ◎ For each browsingContext in descendants:

      1. %作動中の文書 ~LET %B にて`作動中の文書$ ◎ ↓
      2. `文書の~unloadを~promptする$( %作動中の文書, `再帰的^i ) ⇒ ~IF[ 利用者は文書の`~unloadを拒否-$docした ] ⇒ ~BREAK (利用者は、 %文書 についても暗黙的に`~unloadを拒否-$docしたことになる) ◎ Prompt to unload browsingContext's active document with the recursiveFlag set. If the user refused to allow the document to be unloaded, then the user implicitly also refused to allow document to be unloaded; break.
      3. ~IF[ %作動中の文書 の`回復可能~状態$doc ~EQ ~F ] ⇒ %文書 の`回復可能~状態$doc ~SET ~F ◎ If the salvageable state of browsingContext's active document is false, then set the salvageable state of document to false.
  10. %文書 の`~unload中の~openは無視する~counter$ ~DECBY 1 ◎ Decrease the document's ignore-opens-during-unload counter by 1.

`文書を~unloadする@ ときは、所与の ( `文書$ %文書, 真偽値 %使回す~flag ~IN { `使回す^i, ε }(省略時は ε ), %再帰的~flag ~IN { `再帰的^i, ε }(省略時は ε ) ) に対し,次を走らす: ◎ To unload a Document document, given a boolean recycle and optionally a recursiveFlag:

注記: %使回す~flag は、非 ε ならば %文書 を再利用することを指示する — `document.open(type, replace)$m ~methodは、これに `使回す^i を渡して この手続きを呼出す。 【 %使回す~flag (原文では真偽値)の省略時に対する ε は、この訳による追加。】 ◎ The recycle argument indicates whether the Document object is going to be reused; it is set by the document.open(type, replace) method.

  1. `~event-loop$の`終了入子~level$ ~INCBY 1 ◎ Increase the event loop's termination nesting level by one.
  2. %文書 の`~unload中の~openは無視する~counter$ ~INCBY 1 ◎ Increase document's ignore-opens-during-unload counter by one.
  3. ~IF[ %文書 の`頁~表示中~flag$doc ~EQ ~T ]: ◎ If document's page showing flag is false, then jump to the step labeled unload event below (i.e. skip firing the pagehide event and don't rerun the unloading document visibility change steps).

    1. %文書 の`頁~表示中~flag$doc ~SET ~F ◎ Set document's page showing flag to false.
    2. %文書 の`~window$に向けて,名前 `pagehide$et の`~eventを発火する$( `~targetを上書きする^i ) — `PageTransitionEvent$I を利用し,次のように初期化して ⇒ `persisted$m 属性 ~SET %文書 の`回復可能~状態$doc ◎ Fire an event named pagehide at document's Window object, using PageTransitionEvent, with the persisted attribute initialized to true if document's salvageable state is true, and false otherwise, and legacy target override flag set.
    3. `適用-可能な仕様$により定義される `~unload中の文書の可視性を変更する手続き@ があれば、それらの各~手続きを %文書 を渡して走らす ◎ Run any unloading document visibility change steps for document that are defined by other applicable specifications.

      注記: これは、 Page Visibility 仕様からの利用-に特に意図されている。 `PAGEVIS$r ◎ This is specifically intended for use by the Page Visibility specification. [PAGEVIS]

  4. ~IF[ %文書 の`~unload発火-済み~flag$doc ~EQ ~F ] ⇒ %文書 の`~window$に向けて,名前 `unload$et の`~eventを発火する$( `~targetを上書きする^i ) ◎ Unload event: If document's fired unload flag is false, then fire an event named unload at document's Window object, with legacy target override flag set.
  5. `~event-loop$の`終了入子~level$ ~DECBY 1 ◎ Decrease the event loop's termination nesting level by one.
  6. ~IF[ 前~前~段にて,何らかの~event~listenerが誘発された ] ⇒# %文書 の`回復可能~状態$doc ~SET ~F; %文書 の`~unload発火-済み~flag$doc ~SET ~T ◎ If any event listeners were triggered by the earlier unload event step, then set document's salvageable state to false and set document's fired unload flag to true.
  7. この仕様も含む`適用-可能な仕様$にて定義される `文書~unload時の片付け手続き$があれば、それらの各~手続きを %文書 を渡して走らす ◎ Run any unloading document cleanup steps for document that are defined by this specification and other applicable specifications.
  8. ~IF[ %再帰的~flag ~EQ ε ]: ◎ If the recursiveFlag is not set, then:

    1. %子孫~list ~LET %文書 の`子孫~閲覧文脈~list$ ◎ Let descendants be the list of the descendant browsing contexts of document.
    2. %子孫~list 内の ~EACH( `閲覧文脈$ %B ) に対し: ◎ For each browsingContext in descendants:

      1. %作動中の文書 ~LET %B にて`作動中の文書$ ◎ ↓
      2. `文書を~unloadする$( %作動中の文書, ε, `再帰的^i ) ◎ Unload the active document of browsingContext with the recycle parameter set to false, and the recursiveFlag set.
      3. ~IF[ %作動中の文書 の`回復可能~状態$doc ~EQ ~F ] ⇒ %文書 の`回復可能~状態$doc ~SET ~F ◎ If the salvageable state of the active document of browsingContext is false, then set the salvageable state of document to false also.
    3. ~IF[ %文書 の`回復可能~状態$doc ~EQ ~F ]~AND[ %使回す~flag ~EQ ε ] ⇒ `文書を破棄する$( %文書 ) ◎ If both document's salvageable state and recycle are false, then discarddocument.
  9. %文書 の`~unload中の~openは無視する~counter$ ~DECBY 1 ◎ Decrease document's ignore-opens-during-unload counter by one.

`適用-可能な仕様$は、 `文書~unload時の片付け手続き@ を定義できる。 この仕様が定義する`文書~unload時の片付け手続き$は、所与の ( `文書$ %文書 ) に対し,次を走らす: ◎ This specification defines the following unloading document cleanup steps. Other specifications can define more. Given a Document document:

  1. %~window ~LET %文書 の`~window$ ◎ Let window be document's Window object.
  2. ~EACH( `WebSocket$I ~obj %O ) に対し ⇒ ~IF[ %O に`関連する大域~obj$ ~EQ %~window ] ⇒ %O を`消滅させる$ ◎ For each WebSocket object webSocket whose relevant global object is equal to window, make disappear webSocket.
  3. ~IF[ 前~段により影響された `WebSocket$I ~objはある ] ⇒ %文書 の`回復可能~状態$doc ~SET ~F ◎ If this affected any WebSocket objects, then set document's salvageable state to false.
  4. ~IF[ %文書 の`回復可能~状態$doc ~EQ ~F ]: ◎ If document's salvageable state is false, then:

    1. ~EACH( `EventSource$I ~obj %O ) に対し ⇒ ~IF[ %O に`関連する大域~obj$ ~EQ %~window ] ⇒ %O を`強制的に閉じる$ ◎ For each EventSource object eventSource whose relevant global object is equal to window, forcibly close eventSource.
    2. %文書 の`~window$の`作動中の~timer~list$を空にする ◎ Empty window's list of active timers.

7.8.11.1. `BeforeUnloadEvent^I ~interface

[Exposed=Window]
interface `BeforeUnloadEvent@I : `Event$I {
  attribute DOMString `returnValue$m;
};

注記: `BeforeUnloadEvent$I に特有の初期化~methodはない。 ◎ There are no BeforeUnloadEvent-specific initialization methods.

`BeforeUnloadEvent$I ~interfaceは、旧来の~interfaceである — それは、~eventを取消すのみならず, `returnValue$m 属性を空~文字列でない値に設定することで `文書の~unloadを~promptする$処理を制御できるようにする。 作者は `returnValue$m を利用する代わりに `preventDefault()$m ~method, または~eventを取消す他の手段を利用するべきである。 ◎ The BeforeUnloadEvent interface is a legacy interface which allows prompting to unload to be controlled not only by canceling the event, but by setting the returnValue attribute to a value besides the empty string. Authors should use the preventDefault() method, or other means of canceling events, instead of using returnValue.

`returnValue@m
この属性は、`文書の~unloadを~promptする$処理-を制御する。 ◎ The returnValue attribute controls the process of prompting to unload.\
~eventの作成-時には、この属性は空~文字列に設定され~MUST。 ◎ When the event is created, the attribute must be set to the empty string.\
取得子は、この属性に最後に設定された値を返さ~MUST。 ◎ On getting, it must return the last value it was set to.\
設定子は、この属性を所与の値に設定し~MUST。 ◎ On setting, the attribute must be set to the new value.
注記: この属性が `DOMString^I にされているのは、もっぱら歴史的~理由による。 空~文字列~以外のどの値も,利用者に確認をとるよう要請するものと扱われる。 ◎ This attribute is a DOMString only for historical reasons. Any value besides the empty string will be treated as a request to ask the user for confirmation.

7.8.12. 文書~読込の中止-法

`文書を中止する@ ときは、所与の ( `文書$ %文書 ) に対し,次を走らす: ◎ To abort a Document document:

  1. %文書 が`属する閲覧文脈$の ~EACH( `子~閲覧文脈$ %子 ) に対し:

    1. %子~文書 ~LET %子 にて`作動中の文書$
    2. `文書を中止する$( %子~文書 )
    3. ~IF[ %子~文書 の`回復可能~状態$doc ~EQ ~F ] ⇒ %文書 の`回復可能~状態$doc ~SET ~F
    ◎ Abort the active documents of every child browsing context. If this results in any of those Document objects having their salvageable state set to false, then set document's salvageable state to false also.
  2. ~IF[ %文書 の文脈~下にある`~fetch$~algoの~instanceたちがある ] ⇒

    1. それらを取消す — 以降 ⇒# それらに対し`~queueされ$る`~task$は破棄する / それらに対し~networkから受信される更なる~dataは破棄する

    2. %文書 の`回復可能~状態$doc ~SET ~F
    ◎ Cancel any instances of the fetch algorithm in the context of document, discarding any tasks queued for them, and discarding any further data received from the network for them. If this resulted in any instances of the fetch algorithm being canceled or any queued tasks or any network data getting discarded, then set document's salvageable state to false.
  3. ~IF[ %文書 には`作動中の構文解析器$がある ]:

    1. その`構文解析器を中止する$
    2. %文書 の`回復可能~状態$doc ~SET ~F
    ◎ If document has an active parser, then abort that parser and set document's salvageable state to false.

~UAは、利用者が明示的に`文書を中止する$~algoを呼出すことを許容して~MAY。 利用者がそれをした場合、その`文書$が`作動中の文書$であるならば、~UAは,`文書を中止する$~algoを呼出す前に,次を走らす`~taskを~queueする$べきである ⇒ その`文書$の`~window$に向けて,名前 `abort$et の`~eventを発火する$ ◎ User agents may allow users to explicitly invoke the abort a document algorithm for a Document. If the user does so, then, if that Document is an active document, the user agent should queue a task to fire an event named abort at that Document's Window object before invoking the abort algorithm.

7.9. ~offline~Web~app

この特色機能は、~Web~platformから除去されつつある過程にある(何年もかかるであろう)。 今では、~offline~Web~app特色機能は,利用しないことが強く奨励される。 代わりに、~service-worker `SW$r を利用すること。 ◎ This feature is in the process of being removed from the Web platform. (This is a long process that takes many years.) Using any of the offline Web application features at this time is highly discouraged. Use service workers instead. [SW]

【 以下、この節の内容は未訳。 このサイトのこの仕様の和訳における `~app~cache関連の…@appCache と記された箇所も未訳であり、実際の原文では,この節にて定義される各種~用語を利用する内容が記述されている。 言い換えれば、和訳は,~UAがこの節に述べられる機能を~supportしていないかのように単純化して記述している。 】