diff --git a/spec.bs b/spec.bs index 1fbdfeb..27fd86e 100644 --- a/spec.bs +++ b/spec.bs @@ -12,6 +12,7 @@ Abstract: in an always-on-top window.
+spec:dom; type:dfn; text:origin spec:html; type:dfn; for:navigable; text:top-level traversable spec:html; type:dfn; for:Window; text:navigable spec:url; type:dfn; for:/; text:url @@ -473,11 +474,94 @@ picture-in-picture window after focusing, they can always do so using ## CSS display-mode ## {#css-display-mode}-The CSS display mode media feature [=display mode/picture-in-picture=] lets web developers +The CSS display mode media feature ''@media/display-mode/picture-in-picture'' lets web developers write specific CSS rules that are only applied when (part of the) the web app is shown in picture-in-picture mode.
+## User activation propagation ## {#user-activation-propagation} + ++Due to the nature of document picture-in-picture windows, event handlers on +buttons within the window often end up actually running in the opener's context. +This can make it unergonomic for websites to call +activation consuming APIs, +since sometimes the document +picture-in-picture window has transient activation while the opener does +not. + +To make this easier, we will update the +activation notification +steps to also trigger user activation in the opener when triggering user +activation in a document picture-in-picture window. Additionally, when user +activation is triggered in the opener, we will activate same-origin frames +insides the document picture-in-picture window, similar to how same-origin +descendant frames are activated. +
+ ++Merge this into +activation notification +steps once it has enough consensus. +
+ +Add three new steps to +activation notification +after step 4, "Extend +|windows| with the active window of each of |document|'s +descendant navigables, filtered to include only those navigables +whose active document's origin is same origin with +|document|'s origin": + +5. If |document|'s node navigable's top-level traversable's + Is Document Picture-in-Picture boolean istrue
, then + extend |windows| with |document|'s node navigable's + top-level traversable's active browsing context's + opener browsing context's active window. + +6. Let |document picture-in-picture window| be |document|'s node navigable's + top-level traversable's active window's + documentPictureInPicture API's last-opened window. + +7. If |document picture-in-picture window| is notnull
then + extend |windows| with the active window of each of + |document picture-in-picture window|'s associated document's + descendant navigables, filtered to include only those + navigables whose active document's origin is + same origin with |document picture-in-picture window|'s + associated document's origin. + ++Additionally, we need to make sure that this activation is properly consumed so +it can't be used twice (once in the opener and once in the picture-in-picture +window). We do this by adding steps to consume user activation which +consume user activation from the opener when consuming a picture-in-picture +window's user activation, and consuming an associated picture-in-picture +window's user activation when consuming an opener's user activation. +
+ ++Merge this into consume user activation steps once it has enough +consensus. +
+ +Add three new steps to consume user activation after step 3, "Let +|navigables| be the inclusive descendant navigables of |top|'s +active document.": + +4. If |top|'s Is Document Picture-in-Picture boolean is +true
, then extend |navigables| with the + inclusive descendant navigables of |top|'s + active browsing context's opener browsing context's + active document. + +5. Let |document picture-in-picture window| be |top|'s active window's + documentPictureInPicture API's last-opened window. + +6. If |document picture-in-picture window| is notnull
then + extend |navigables| with the inclusive descendant navigables + of |document picture-in-picture window|'s associated document. + # Examples # {#examples} This section is non-normative