1. 各種用語
この仕様は、 `INFRA$r に依存する。 ◎ This specification depends on the Infra Standard. [INFRA]
この仕様に利用される各種用語のほとんどは、 `CSS$r, `DOM$r, `HTML$r, `WEBIDL$r による。 ◎ Most terminology used in this specification is from CSS, DOM, HTML, and Web IDL. [CSS] [DOM] [HTML] [WEBIDL] ◎ A browsing context A is called a descendant browsing context of a browsing context B if and only if B is an ancestor browsing context of A. この訳では、この用語は利用しない。
【この訳に固有の表記規約】
この訳の,~algoの記述に利用されている各種記号(此れ, ~LET, ~ON, ~IF, ~RET, 等々)の意味や定義の詳細は、~SYMBOL_DEF_REFを~~参照されたし。 加えて、明確化するため,次の定義も導入する:
`文書$ %文書 を `入子にしている閲覧文脈~容器@ は、次の手続きの結果で与えられる:
- %B ~LET %文書 が`属する閲覧文脈$
- ~IF[ %B ~NEQ ε ]~AND[ ある`閲覧文脈~容器$ %容器 があって, %B は %容器 を`通して入子にされて$いる ] ⇒ ~RET %容器
- ~RET ε
2. ~model
各 `要素$には `~fullscreen~flag@ が結付けられる。 他が言明されない限り ~OFF とする。 ◎ All elements have an associated fullscreen flag. Unless stated otherwise it is unset.
各 `iframe$e `要素$には `~iframe~fullscreen~flag@ が結付けられる。 他が言明されない限り ~OFF とする。 ◎ All iframe elements have an associated iframe fullscreen flag. Unless stated otherwise it is unset.
`文書$の `~fullscreen要素@ は、`文書$の`上端~層$内の`要素$のうち[ `~fullscreen~flag$ ~EQ ~ON ]なるものが[ あれば それらのうち最上端【最も手前に塗られる/最後】のもの/ 他の場合は ~NULL ]とする。 ◎ All documents have an associated fullscreen element. The fullscreen element is the topmost element in the document’s top layer whose fullscreen flag is set, if any, and null otherwise.
各 `文書$には `処理待ち~fullscreen~eventの~list@ が結付けられる。 それは、 0 個~以上の[ ( `文字列$, `要素$ ) が成す`~pair$ ]かならる`有順序~集合$であり,初期~時には空とする。 ◎ All documents have an associated list of pending fullscreen events, which is an ordered set of (string, element) pairs. It is initially empty.
`要素を~fullscreen化する@ ときは、所与の ( %要素 ) に対し ⇒# %要素 の`~fullscreen~flag$ ~SET ~ON; %要素 の`~node文書$の`上端~層$に %要素 を`追加する$ ◎ To fullscreen an element, set element’s fullscreen flag and add it to its node document’s top layer.
`要素を~unfullscreenする@ ときは、所与の ( %要素 ) に対し:
- %要素 の`~fullscreen~flag$ ~SET ~OFF
- ~IF[ %要素 は `iframe$e 要素である ] ⇒ %要素 の`~iframe~fullscreen~flag$ ~SET ~OFF
- %要素 の`~node文書$の`上端~層$から %要素 を`除去する$
`文書を~unfullscreenする@ ときは、所与の ( %文書 ) に対し ⇒ %文書 の`上端~層$を成す ~EACH( `要素$ %要素 ) に対し ⇒ ~IF[ %要素 の`~fullscreen~flag$ ~EQ ~ON ] ⇒ `要素を~unfullscreenする$( %要素 ) ◎ To unfullscreen a document, unfullscreen all elements, within document’s top layer, whose fullscreen flag is set.
`~fullscreenから全部的に抜出る@ ときは、所与の ( `文書$ %文書 ) に対し,次を走らす: ◎ To fully exit fullscreen a document document, run these steps:
- ~IF[ %文書 の`~fullscreen要素$ ~EQ ~NULL ] ⇒ ~RET ◎ If document’s fullscreen element is null, terminate these steps.
- %文書 の`上端~層$内の~EACH( %要素 ) に対し ⇒ ~IF[ %要素 の`~fullscreen~flag$ ~EQ ~ON ]~AND[ %要素 ~NEQ %文書 の`~fullscreen要素$ ] ⇒ `要素を~unfullscreenする$( %要素 ) ◎ Unfullscreen elements whose fullscreen flag is set, within document’s top layer, except for document’s fullscreen element.
- `~fullscreenから抜出る$( %文書 ) ◎ Exit fullscreen document.
`除去-時の手続き$は、所与の ( %除去された~node ) に対し,次を走らす: ◎ Whenever the removing steps run with a removedNode, run these steps:
-
%除去された~node の~EACH( `~shadowも含む広義-子孫$ %~node ) に対し,`~shadowも含む木~順序$で: ◎ Let nodes be removedNode’s shadow-including inclusive descendants that have their fullscreen flag set, in shadow-including tree order. ◎ For each node in nodes:
- ~IF[ %~node の`~fullscreen~flag$ ~EQ ~OFF ] ⇒ ~CONTINUE ◎ ↑
- %~node文書 ~LET %~node の`~node文書$ ◎ ↓
- ~IF[ %~node ~EQ %~node文書 の`~fullscreen要素$ ] ⇒ `~fullscreenから抜出る$( %~node文書 ) ◎ If node is its node document’s fullscreen element, exit fullscreen that document.
- ~ELSE ⇒ `要素を~unfullscreenする$( %~node ) ◎ Otherwise, unfullscreen node within its node document.
`文書~unload時の片付け手続き$は、所与の ( %文書 ) に対し,走らす ⇒ `~fullscreenから全部的に抜出る$( %文書 ) ◎ Whenever the unloading document cleanup steps run with a document, fully exit fullscreen document.
`~fullscreenは~supportされて@ いるとは、それまでに確立されている 【すなわち、所与の時点で,~fullscreen化を防止するような】 [ 利用者~選好, ~security~risk, ~platform制限 ]は無いことを意味する。 ◎ Fullscreen is supported if there is no previously-established user preference, security risk, or platform limitation.
~algo %A に `~fullscreen要請は許容されて@ いるとは、 %A は次のいずれかを満たすことを意味する: ◎ An algorithm is allowed to request fullscreen if one of the following is true:
- `利用者の作動化により誘発されて$いる。 ◎ The algorithm is triggered by user activation.
- `利用者が生成した方位~変更により誘発されて$いる。 ◎ The algorithm is triggered by a user generated orientation change.
`~fullscreen化~手続き@ は、所与の ( `文書$ %文書 ) に対し,次を走らす: ◎ To run the fullscreen steps for a document document, run these steps:
- %~pair~list ~LET %文書 の`処理待ち~fullscreen~eventの~list$【の複製】 ◎ Let pairs be document’s list of pending fullscreen events.
- %文書 の`処理待ち~fullscreen~eventの~list$を`空にする$ ◎ Empty document’s list of pending fullscreen events.
-
%~pair~list 内の ~EACH( ( %型, %要素 ) ) に対し: ◎ For each (type, element) in pairs:
- %~target ~LET [ 次が満たされるならば %要素 / ~ELSE_ %文書 ] ⇒ [ %要素 は`接続されて$いる ]~AND[ %要素 の`~node文書$ ~EQ %文書 ] ◎ Let target be element if element is connected and its node document is document, and otherwise let target be document.
- %~target に向けて,名前 %型 の`~eventを発火する$ — 次のように初期化して ⇒# `bubbles$m 属性 ~SET ~T, `composed$m 属性 ~SET ~T ◎ Fire an event named type, with its bubbles and composed attributes set to true, at target.
注記: この手続きは、 `HTML$r にて定義される`~event-loop$に統合されている。 【参照】 ◎ These steps integrate with the event loop defined in HTML. [HTML]
3. ~API
partial interface `Element$I {
Promise<void> `requestFullscreen$mE();
attribute `EventHandler$I `onfullscreenchange@mE;
attribute `EventHandler$I `onfullscreenerror@mE;
};
partial interface `Document$I {
[`LenientSetter$] readonly attribute `boolean$ `fullscreenEnabled$m;
[`LenientSetter$, `Unscopable$] readonly attribute `boolean$ `fullscreen$m; // 歴史的
Promise<void> `exitFullscreen$m();
attribute `EventHandler$I `onfullscreenchange$m;
attribute `EventHandler$I `onfullscreenerror$m;
};
partial interface `DocumentOrShadowRoot$I {
[`LenientSetter$] readonly attribute `Element$I? `fullscreenElement$m;
};
- %promise = %element . `requestFullscreen()$mE
- %element を~fullscreenに表示する — 済んだ時点で %promise を解決する。 ◎ Displays element fullscreen and resolves promise when done.
- %document . `fullscreenEnabled$m
- [ 次が満たされるならば ~T / ~ELSE_ ~F ]を返す ⇒ [ %document は `要素$を~fullscreenに表示する能を備える ]~AND[ `~fullscreenは~supportされて$いる ] ◎ Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.
- %promise = %document . `exitFullscreen()$m
- %document の`~fullscreen要素$の~fullscreen表示-を停止する — 済んだ時点で %promise を解決する。 ◎ Stops document’s fullscreen element from being displayed fullscreen and resolves promise when done.
- %document . `fullscreenElement$m
- %document の`~fullscreen要素$を返す。 ◎ Returns document’s fullscreen element.
- %shadowroot . `fullscreenElement$m
- %shadowroot の`~fullscreen要素$を返す。 ◎ Returns shadowroot’s fullscreen element.
`~fullscreen要素~準備済み検査@ は、所与の ( `要素$ %要素 ) に対し,[ 次が満たされるならば ~T / ~ELSE_ ~F ]を返す ⇒ [ %要素 は`接続されて$いる ]~AND[ %要素 の`~node文書$には `fullscreen$l `特色機能の利用は許容され$ている ] ◎ A fullscreen element ready check for an element element returns true if all of the following are true, and false otherwise: • element is connected. • element’s node document is allowed to use the "fullscreen" feature.
- `requestFullscreen()@mE
-
被呼出時には、次を走らせ~MUST: ◎ The requestFullscreen() method, when invoked, must run these steps:
- %処理待ち文書 ~LET 此れの`~node文書$ ◎ Let pending be the context object. ◎ Let pendingDoc be pending’s node document.
- %~promise ~LET `新たな~promise$ ◎ Let promise be a new promise.
- ~IF[ %処理待ち文書 は`全部的に作動中$でない ] ⇒# `TypeError^E 例外で %~promise を`却下する$; ~RET %~promise ◎ If pendingDoc is not fully active, then reject promise with a TypeError exception and return promise.
-
%~error ~LET [ 次のすべてが満たされるならば ~F / ~ELSE_ ~T ]: ◎ Let error be false. ◎ If any of the following conditions are false, then set error to true:
- 此れは次のいずれかを満たす ⇒# `名前空間$elは`~HTML名前空間$である / SVG `svg$e 要素である `SVG$r / MathML `math$e 要素である `MATHML$r ◎ pending’s namespace is the HTML namespace or pending is an SVG svg or MathML math element. [SVG] [MATHML]
- 此れは `dialog$e 要素でない ◎ pending is not a dialog element.
- `~fullscreen要素~準備済み検査$( 此れ ) ~EQ ~T ◎ The fullscreen element ready check for pending returns true.
- `~fullscreenは~supportされて$いる ◎ Fullscreen is supported.
- この~algoには`~fullscreen要請は許容されて$いる ◎ This algorithm is allowed to request fullscreen.
- ~RET %~promise — ただし,以降の手続きも`並列的$に走らす。 ◎ Return promise, and run the remaining steps in parallel.
- ~IF[ %~error ~EQ ~F ] ⇒ %処理待ち文書 の`~top-level閲覧文脈$にて`作動中の文書$の表示域の寸法を,出力-機器の~screenの寸法に合致するよう~resizeする — 加えて,~UAの任意選択で ⇒ 末端利用者~向けに、これを復帰する方法について~~述べる~messageを表示する ◎ If error is false: Resize pendingDoc’s top-level browsing context’s active document’s viewport’s dimensions to match the dimensions of the screen of the output device. Optionally display a message how the end user can revert this.
-
~IF[ %~error ~EQ ~T ]~OR[ 次のいずれかが満たされない ]…: ◎ If any of the following conditions are false, then set error to true:
- 此れの`~node文書$ ~EQ %処理待ち文書 ◎ pending’s node document is pendingDoc.
- `~fullscreen要素~準備済み検査$( 此れ ) ~EQ ~T ◎ The fullscreen element ready check for pending returns true.
…ならば: ◎ If error is true:
- %処理待ち文書 の`処理待ち~fullscreen~eventの~list$に ( `fullscreenerror^et, 此れ ) を`付加する$set ◎ Append (fullscreenerror, pending) to pendingDoc’s list of pending fullscreen events.
- `TypeError^E 例外で %~promise を`却下する$ ◎ Reject promise with a TypeError exception and\
- ~RET ◎ terminate these steps.
- %~fullscreen要素たち ~LET 此れのみからなる`有順序~集合$ ◎ Let fullscreenElements be an ordered set initially consisting of pending.
- ~WHILE [ %~fullscreen要素たち の最初の【最後の?】要素の`~node文書$を`入子にしている閲覧文脈~容器$ %容器 ~NEQ ε ] ⇒ %~fullscreen要素たち に %容器 を`付加する$set ◎ While the first element in fullscreenElements is in a nested browsing context: append its browsing context container to fullscreenElements.
-
%~fullscreen要素たち 内の~EACH( %要素 ) に対し: ◎ For each element in fullscreenElements:
- %文書 ~LET %要素 の`~node文書$ ◎ Let doc be element’s node document.
-
~IF[ %要素 ~EQ %文書 の`~fullscreen要素$ ] ⇒ ~CONTINUE ◎ If element is doc’s fullscreen element, continue.
注記: 何も変化しない場合、~observerに通知する必要は無い。 ◎ No need to notify observers when nothing has changed.
- ~IF[ %要素 ~EQ 此れ ]~AND[ 此れは `iframe$e `要素$である ] ⇒ %要素 の`~iframe~fullscreen~flag$ ~SET ~ON ◎ If element is pending and pending is an iframe element, then set element’s iframe fullscreen flag.
- `要素を~fullscreen化する$( %要素 ) ◎ Fullscreen element within doc.
- %文書 の`処理待ち~fullscreen~eventの~list$に ~pair( `fullscreenchange^et, %要素 ) を`付加する$set ◎ Append (fullscreenchange, element) to doc’s list of pending fullscreen events.
注記: 要素たちが~fullscreen化される順序は、観測され得ない — `~fullscreen化~手続き$は、`木~順序$で呼出されるので。 【なぜ観測され得ない?】 ◎ The order in which elements are fullscreened is not observable, because run the fullscreen steps is invoked in tree order.
- `undefined^jv で %~promise を`解決する$ ◎ Resolve promise with undefined.
- 注記: ~process外の`閲覧文脈$【?】での実装は、読者【実装者】への演習に残しておく。 改善案があれば歓迎する。 ◎ Implementations with out-of-process browsing contexts are left as an exercise to the reader. Input welcome on potential improvements.
- `fullscreenEnabled@m
- 取得子は、[ 次が満たされるならば ~T / ~ELSE_ ~F ]を返さ~MUST ⇒ [ 此れには `fullscreen$l `特色機能の利用は許容され$ている ]~AND[ `~fullscreenは~supportされて$いる ] ◎ The fullscreenEnabled attribute’s getter must return true if the context object is allowed to use the "fullscreen" feature and fullscreen is supported, and false otherwise.
- `fullscreen@m
- 取得子は、[ 此れの`~fullscreen要素$ ~NEQ ~NULL ならば ~T / ~ELSE_ ~F ]を返さ~MUST。 ◎ The fullscreen attribute’s getter must return false if context object’s fullscreen element is null, and true otherwise.
- 注記: 作者は、代わりに `fullscreenElement$m 属性を利用するように。 ◎ Use the fullscreenElement attribute instead.
- `fullscreenElement@m
-
取得子は、次を走らせ~MUST: ◎ The fullscreenElement attribute’s getter must run these steps:
- ~IF[ 此れは`~shadow根$である ]~AND[ 此れの`~host$は`接続されて$いない ] ⇒ ~RET ~NULL ◎ If the context object is a shadow root and its host is not connected, then return null.
- %候補 ~LET 此れの`~fullscreen要素$を此れに向けて`~targetし直す$ ◎ Let candidate be the result of retargeting fullscreen element against the context object.
- ~IF[ ( %候補, 此れ ) は同じ`木$内にある ] ⇒ ~RET %候補 ◎ If candidate and the context object are in the same tree, then return candidate.
- ~RET ~NULL ◎ Return null.
次を満たす`文書$ %文書 は `単純~fullscreen文書@ という ⇒ [ %文書 の`上端~層$内の`要素$のうち[ `~fullscreen~flag$ ~EQ ~ON ]を満たすもの ]の個数 ~EQ 1 ◎ A document is said to be a simple fullscreen document if there is exactly one element in its top layer that has its fullscreen flag set.
注記: `上端~層$内に 2 個の `要素$がある`文書$でも,`単純~fullscreen文書$になり得る。 例えば、`~fullscreen要素$に加えて,開いている `dialog$e 要素がある場合。 ◎ A document with two elements in its top layer can be a simple fullscreen document. For example, in addition to the fullscreen element there could be an open dialog element.
`~unfullscreenする文書を収集する@ ときは、所与の ( %文書 ) に対し,次を走らす: ◎ To collect documents to unfullscreen given doc, run these steps:
- %文書たち ~LET 新たな`有順序~集合$ ◎ Let docs be an ordered set consisting of doc.
-
~WHILE 無条件
- ~Assert: %文書 の`~fullscreen要素$ ~NEQ ~NULL
- %文書たち に %文書 を`付加する$set
- ~IF[ %文書 は`単純~fullscreen文書$でない ] ⇒ ~BREAK
- %容器 ~LET %文書 を`入子にしている閲覧文脈~容器$
- ~IF[ %容器 ~NEQ ε ]~AND[ %容器 の`~iframe~fullscreen~flag$ ~EQ ~ON ] ⇒ %文書 ~SET %容器 の`~node文書$
- ~ELSE ⇒ ~BREAK
-
~RET %文書たち ◎ Return docs.
注記: %文書たち は,文書のうち[ その`~fullscreen要素$が~unfullscreenされることになるもの ]からなるが、その最後の文書 %文書 の`上端~層$内には[ `~fullscreen~flag$ ~EQ ~ON ]にされた`要素$が複数個あるかもしれない — その事例では、 %文書 は依然として,~fullscreenであり続けることになる。 ◎ This is the set of documents for which the fullscreen element will be unfullscreened, but the last document in docs might have more than one element in its top layer with the fullscreen flag set, in which case that document will still remain in fullscreen.
`~fullscreenから抜出る@ ときは、所与の ( `文書$ %文書 ) に対し,次を走らす: ◎ To exit fullscreen a document doc, run these steps:
- %~promise ~LET `新たな~promise$ ◎ Let promise be a new promise.
- ~IF[ %文書 は`全部的に作動中$でない ]~OR[ %文書 の`~fullscreen要素$ ~EQ ~NULL ] ⇒# `TypeError^E 例外で %~promise を`却下する$; ~RET %~promise ◎ If doc is not fully active or doc’s fullscreen element is null, then reject promise with a TypeError exception and return promise.
- %~resize ~LET ~F ◎ Let resize be false.
- %文書たち ~LET `~unfullscreenする文書を収集する$( %文書 ) ◎ Let docs be the result of collecting documents to unfullscreen given doc.
- %~top-level文書 ~LET %文書 の`~top-level閲覧文脈$にて`作動中の文書$ ◎ Let topLevelDoc be doc’s top-level browsing context’s active document.
- ~IF[ %~top-level文書 ~IN %文書たち ]~AND[ %~top-level文書 は`単純~fullscreen文書$である ] ⇒# %文書 ~SET %~top-level文書; %~resize ~SET ~T ◎ If topLevelDoc is in docs, and it is a simple fullscreen document, then set doc to topLevelDoc and resize to true.
- ~RET %~promise — ただし,以降の手続きも`並列的$に走らす。 ◎ Return promise, and run the remaining steps in parallel.
- ~IF[ %~resize ~EQ ~T ] ⇒ %文書 の表示域を その “通常の” 寸法に~resizeする ◎ If resize is true, resize doc’s viewport to its "normal" dimensions.
- ~IF[ %文書 の`~fullscreen要素$ ~EQ ~NULL ] ⇒# `undefined^jv で %~promise を`解決する$; ~RET ◎ If doc’s fullscreen element is null, then resolve promise with undefined and terminate these steps.
- %抜出る文書たち ~LET `~unfullscreenする文書を収集する$( %文書 ) ◎ Let exitDocs be the result of collecting documents to unfullscreen given doc.
-
%子孫~文書たち ~LET 次をいずれも満たす文書 %子孫~文書 からなる,`木~順序$†による`有順序~集合$(無ければ空)
- ある`閲覧文脈$ %B があって,次が満たされる ⇒ [ %子孫~文書 は %B にて`作動中の文書$である ]~AND[ %文書 が`属する閲覧文脈$は %B の`先祖~閲覧文脈$である ]
- %子孫~文書 の`~fullscreen要素$ ~NEQ ~NULL
-
%抜出る文書たち 内の~EACH( %抜出る文書 ) に対し: ◎ For each exitDoc in exitDocs:
- %抜出る文書 の`処理待ち~fullscreen~eventの~list$に ~pair( `fullscreenchange^et, %抜出る文書 の`~fullscreen要素$ ) を`付加する$set ◎ Append (fullscreenchange, exitDoc’s fullscreen element) to exitDoc’s list of pending fullscreen events.
- ~IF[ %~resize ~EQ ~T ] ⇒ `文書を~unfullscreenする$( %抜出る文書 ) ◎ If resize is true, unfullscreen exitDoc.
- ~ELSE ⇒ `要素を~unfullscreenする$( %抜出る文書 の`~fullscreen要素$ ) ◎ Otherwise, unfullscreen exitDoc’s fullscreen element.
-
%子孫~文書たち 内の~EACH( %子孫~文書 ) に対し: ◎ For each descendantDoc in descendantDocs:
- %子孫~文書 の`処理待ち~fullscreen~eventの~list$に ~pair( `fullscreenchange^et, %子孫~文書 の`~fullscreen要素$ ) を`付加する$set ◎ Append (fullscreenchange, descendantDoc’s fullscreen element) to descendantDoc’s list of pending fullscreen events.
- `文書を~unfullscreenする$( %子孫~文書 ) ◎ Unfullscreen descendantDoc.
注記: 文書たちが~unfullscreenされる順序は観測され得ない — `~fullscreen化~手続き$は、`木~順序$で呼出されるので。 【なぜ観測され得ない?】 ◎ The order in which documents are unfullscreened is not observable, because run the fullscreen steps is invoked in tree order.
- `undefined^jv で %~promise を`解決する$ ◎ Resolve promise with undefined.
- `exitFullscreen()@m
- 被呼出時には、次の結果を返さ~MUST ⇒ `~fullscreenから抜出る$( 此れ ) ◎ The exitFullscreen() method, when invoked, must return the result of running exit fullscreen on the context object.
以下に挙げる各種`~event~handler$(および,対応する`~event~handler~event型$)は、[ `Element$I / `Document$I ]~objにより,`~event~handler~IDL属性$として~supportされ~MUST: ◎ The following are the event handlers (and their corresponding event handler event types) that must be supported by Element and Document objects as event handler IDL attributes:
`~event~handler$ | `~event~handler~event型$ |
---|---|
`onfullscreenchange@m | `fullscreenchange^et |
`onfullscreenerror@m | `fullscreenerror^et |
注記: これらは、[ `ShadowRoot$I / `Window$I ]~objからは~supportされない。 また、 `Element$I ~obj用の対応する`~event~handler内容~属性$も無い — 名前空間を問わず。 ◎ These are not supported by ShadowRoot or Window objects, and there are no corresponding event handler content attributes for Element objects in any namespace.
4. ~UI
~UAには、[ `requestFullscreen()$mE, `exitFullscreen()$m ]の手続きを通して,~native媒体の~fullscreen制御を実装することが奨励される。 ◎ User agents are encouraged to implement native media fullscreen controls in terms of requestFullscreen() and exitFullscreen().
末端利用者は、[ `requestFullscreen()$mE を介して起動された ~fullscreen~sessionを終止する ]よう,~UAに指図している場合 ⇒ `~fullscreenから全部的に抜出る$( `~top-level閲覧文脈$にて`作動中の文書$ ) ◎ If the end user instructs the user agent to end a fullscreen session initiated via requestFullscreen(), fully exit fullscreen the top-level browsing context’s active document.
~UAは、[ 末端利用者からの指図 / `exitFullscreen()$m の~call ]が無いときでも,必要と判断されるならば ~fullscreen~sessionを終止して~MAY。 ◎ The user agent may end any fullscreen session without instruction from the end user or call to exitFullscreen() whenever the user agent deems it necessary.
5. 描画
この節は、~HTMLの具現化~節と等価に解釈されることになる。 `HTML$r ◎ This section is to be interpreted equivalently to the Rendering section of HTML. [HTML]
~CSSは、ゆくゆくは,`上端~層$の概念を定義した上で [ それに結付けられる `backdrop$pe 疑似要素は、~CSSの積層~文脈~modelの一部を成す ]ものとして定義することになる。 ここで行う~CSSへの継当ては、大雑把な~~素描に過ぎない。 ◎ Long term CSS will define the top layer concept and its associated ::backdrop pseudo-element as part of CSS' stacking context model. Patching CSS as done here is sketchy as hell.
【 この訳では、この節の一部の~CSS[ 用語 / ~prop ]に,リンクを補完している。 】
5.1. 新たな積層~層
この仕様は、 CSS 2.1 による 積層~文脈の詳説 に,新たな積層~層を導入する。 それは, `上端~層@ ( top layer )と呼ばれ、塗り順序における段 10 【最後の段】の後に来る — したがって、`表示域$の中で,利用者から見て最も手前に描画される。 各 `文書$には, 1 個の`表示域$が結付けられる — したがって、 1 個の`上端~層$がある。 `CSS$r ◎ This specification introduces a new stacking layer to the Elaborate description of Stacking Contexts of CSS 2.1. It is called the top layer, comes after step 10 in the painting order, and is therefore rendered closest to the user within a viewport. Each document has one associated viewport and therefore also one top layer. [CSS]
注記: 以下のこの節とその下位節に利用される各種用語は、 CSS 2.1, 付録 E に合致するよう試みる。 ◎ The terminology used in this and following subsection attempts to match CSS 2.1 Appendix E.
`上端~層$は、一連の要素が成す`有順序~集合$であり,集合~内に現れる順序で描画される。 この集合の最後の要素は、最後に描画され,したがって上端【最も手前】に現れる。 ◎ The top layer is an ordered set of elements, rendered in the order they appear in the set. The last element in the set is rendered last, and thus appears on top.
注記: `z-index$p ~propによる`上端~層$に対する効果は無い。 ◎ The z-index property has no effect in the top layer.
`上端~層$を成す各[ 要素, 【要素を`出自の要素$とする】 `backdrop$pe `疑似要素$ ] %E は、以下の特徴を備える: ◎ Each element and ::backdrop pseudo-element in a top layer has the following characteristics:
- %E は新たな`積層~文脈$を生成する。 ◎ It generates a new stacking context.
- %E の親~積層~文脈は、根~積層~文脈である。 ◎ Its parent stacking context is the root stacking context.
- %E が複数の~layout~boxからなる場合、それらのうち最初の~boxが利用される。 ◎ If it consists of multiple layout boxes, the first box is used.
-
%E は、[ %E の`根$の同胞であった ]かのように,不可分な単位として描画される。 ◎ It is rendered as an atomic unit as if it were a sibling of its root.
注記: %E の`先祖$要素の `overflow$p, `opacity$p, `mask$p, 等々の~propは、 %E に影響し得ない。 ◎ Ancestor elements with overflow, opacity, masks, etc. cannot affect it.
- %E の`包含塊$は、 %E の `position$p ~propの`算出値$に応じて,[ `fixed^v ならば `表示域$ / ~ELSE_ `初期~包含塊$ ]になる ◎ If its position property computes to fixed, its containing block is the viewport, and the initial containing block otherwise.
- %E は要素であって,次を満たす場合、[ %E , および %E を`出自の要素$とする `backdrop$pe `疑似要素$ ]は,描画されない ⇒ %E の`~shadowも含む広義-先祖$【のうち,いずれか】の `display$p ~propの値 ~EQ `none^v ◎ If it is an element, it and its ::backdrop pseudo-element are not rendered if its shadow-including inclusive ancestor has the display property set to none.
- %E の `display$p ~propは、その`指定値$が `contents^v ならば,`算出値$は `block^v になる。 ◎ If its specified display property is contents, it computes to block.
- %E の `position$p ~propは、その`指定値$ ~NIN { `absolute^v, `fixed^v } ならば,`算出値$は `absolute^v になる。 ◎ If its specified position property is not absolute or fixed, it computes to absolute.
-
%E の外形線( `outline$p )は、あるならば 塗り順序における段 10 の前に描画される。
【 段 10 は最後の段。 外形線は,任意選択で この段か 別の段で塗るものとされているので、段 10 “の前” という言い回しはおかしく,単に別の段で塗る選択肢は除外されることを表す — すなわち,必ず最後に塗る。 】
◎ Its outline, if any, is to be rendered before step 10 in the painting order. - 別の仕様により上書きされない限り、 %E の[ `left$p / `right$p / `top$p ]用の`静的位置$は 0 になる。 ◎ Unless overridden by another specification, its static position for left, right, and top is zero.
%要素 を %上端~層 に `追加する@ ときは ⇒# %上端~層 から %要素 を`除去する$; %上端~層 に %要素 を`付加する$set ◎ To add an element to a top layer, remove it from top layer and then append it to top layer.
注記: 言い換えれば、 %要素 が %上端~層 内にすでに在るならば %上端~層 の末尾に移動する。 ◎ In other words, element is moved to the end of top layer if it is already present.
5.2. `backdrop^pe 疑似要素
`上端~層$内の各~要素は `backdrop@pe `疑似要素$を持つ。 この疑似要素は、同じ`上端~層$の中で要素の直下(集合~内で要素の直前にある要素の直上)に描画される~boxである。 ◎ Each element in a top layer has a ::backdrop pseudo-element. This pseudo-element is a box rendered immediately below the element (and above the element before the element in the set, if any), within the same top layer.
注記: `backdrop$pe 疑似要素は、`上端~層$内の要素(~fullscreenに表示される要素など)用に[ 下層の文書を隠す後景 ]を作成するために利用できる。 ◎ The ::backdrop pseudo-element can be used to create a backdrop that hides the underlying document for an element in a top layer (such as an element that is displayed fullscreen).
この疑似要素は、要素から何も継承しない/何からも継承されない。 また、どの~propを適用し得るかについても,制約は無い。 ◎ It does not inherit from any element and is not inherited from. No restrictions are made on what properties apply to this pseudo-element either.
5.3. `fullscreen^ps 疑似類
`fullscreen@ps `疑似類$は、次のいずれかを満たすどの`要素$ %要素 にも合致し~MUST: ◎ The :fullscreen pseudo-class must match any element element for which one of the following conditions is true:
- %要素 の`~fullscreen~flag$ ~EQ ~ON ◎ element’s fullscreen flag is set.
- [ %要素 は`~shadow~host$である ]~AND[[[ %要素 の`~node文書$の`~fullscreen要素$ ]を %要素 に向けて`~targetし直す$ ]~EQ %要素 ] ◎ element is a shadow host and the result of retargeting its node document’s fullscreen element against element is element.
注記: これは、最上端の`~fullscreen要素$を返す `fullscreenElement$m ~APIとは異なる。 ◎ This makes it different from the fullscreenElement API, which returns the topmost fullscreen element.
5.4. ~UA~levelの既定の~stylesheet
@namespace "http://www.w3.org/1999/xhtml"; *|*:not(:root):fullscreen { position:fixed !important; top:0 !important; right:0 !important; bottom:0 !important; left:0 !important; margin:0 !important; box-sizing:border-box !important; min-width:0 !important; max-width:none !important; min-height:0 !important; max-height:none !important; width:100% !important; height:100% !important; transform:none !important; /* intentionally not !important */ object-fit:contain; } iframe:fullscreen { border:none !important; padding:0 !important; } ::backdrop { position:fixed; top:0; right:0; bottom:0; left:0; } *|*:not(:root):fullscreen::backdrop { background:black; }
6. 特色機能~施策の統合
この仕様は、文字列 `fullscreen@l で識別される`施策により制御される特色機能$を定義する。 その`既定の許容list$は、 `'self'^l とする。 ◎ This specification defines a policy-controlled feature identified by the string "fullscreen". Its default allowlist is self.
注記: `文書$の`特色機能~施策$docは、その文書~内の内容は,~fullscreenにすることが許容されるかを決定する。 文書~内で不能化された場合、文書~内のどの内容にも,~fullscreen`特色機能の利用は許容され$ない。 ◎ A document’s feature policy determines whether any content in that document is allowed to go fullscreen. If disabled in any document, no content in the document will be allowed to use fullscreen.
~HTML `iframe$e 要素の `allowfullscreen$a 属性は、 `allow$a 属性により上書きされない限り,それが入子にしている文書の`容器~施策$に影響する。 ~iframe上に `allowfullscreen$a を設定することは, `<iframe allow="fullscreen *">^c と等価になる — `FEATURE-POLICY$r の § ~iframe `allowfullscreen^a 属性 に述べられるように。 ◎ The allowfullscreen attribute of the HTML iframe element affects the container policy for any document nested in that iframe. Unless overridden by the allow attribute, setting allowfullscreen on an iframe is equivalent to <iframe allow="fullscreen *">, as described in Feature Policy §iframe-allowfullscreen-attribute.
7. ~securityと~privacy上の考慮点
~UAは、重層するなどの手段により,末端利用者が[ 何かが~fullscreenで表示されていること ]に気付けることを確保するべきである。 ~UAは、[ 常に働くような,~fullscreenから抜出る手段 ]を供して,利用者に告知するべきである。 これは、ある~siteが[ ~fullscreenにある間、~UAや~OS環境までも~~模造して,末端利用者を欺く ]のを防止する。 `requestFullscreen()$mE の定義も見よ。 ◎ User agents should ensure, e.g. by means of an overlay, that the end user is aware something is displayed fullscreen. User agents should provide a means of exiting fullscreen that always works and advertise this to the user. This is to prevent a site from spoofing the end user by recreating the user agent or even operating system environment when fullscreen. See also the definition of requestFullscreen().
`入子の閲覧文脈$内の内容が~fullscreenになるのを可能化するためには、特色機能~施策を介して特定的に許容される必要がある — 次のいずれかを通して ⇒# ~HTML `iframe$e 要素の `allowfullscreen$a 属性 / ~HTML `iframe$e 要素の `allow$a 属性における適切な宣言 / 内容を入子にしている`文書$と伴に `Feature-Policy$h ~HTTP~headerを送達する ◎ To enable content in a nested browsing context to go fullscreen, it needs to be specifically allowed via feature policy, either through the allowfullscreen attribute of the HTML iframe element, or an appropriate declaration in the allow attribute of the HTML iframe element, or through a `Feature-Policy` HTTP header delivered with the document through which it is nested.
これは例えば、[ 第三者主体からの内容が,明示的な許可なく~fullscreenになる ]のを防止する。 ◎ This prevents e.g. content from third parties to go fullscreen without explicit permission.
謝辞
Many thanks to Robert O’Callahan for designing the initial model and being awesome.
Thanks to Andy Earnshaw, Chris Pearce, Darin Fisher, fantasai, Giuseppe Pascale, Glenn Maynard, Ian Clelland, Ian Hickson, Ignacio Solla, João Eiras, Josh Soref, Matt Falkenhagen, Mihai Balan, Mounir Lamouri, Øyvind Stenhaug, Pat Ladd, Rafał Chłodnicki, Riff Jiang, Rune Lillesveen, Sigbjørn Vik, Simon Pieters, Tab Atkins, Takayoshi Kochi, Theresa O’Connor, triple-underscore, Vincent Scheib, and Xidorn Quan for also being awesome.
This standard is edited by Philip Jägenstedt (Google, philip@foolip.org). It was originally written by Anne van Kesteren (Mozilla, annevk@annevk.nl). Tantek Çelik (Mozilla, tantek@cs.stanford.edu) sorted out legal hassles.
Copyright © 2018 WHATWG (Apple, Google, Mozilla, Microsoft). This work is licensed under a Creative Commons Attribution 4.0 International License.