From 5d9f665f34dc16cf550c346f3b45a0267c33eae4 Mon Sep 17 00:00:00 2001 From: "mark a. foltz" Date: Thu, 26 Sep 2024 16:56:03 -0700 Subject: [PATCH] Fix tasks --- index.bs | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/index.bs b/index.bs index 3cc9f3e..b742039 100644 --- a/index.bs +++ b/index.bs @@ -34,14 +34,21 @@ spec: Remote-Playback; urlPrefix: https://w3c.github.io/remote-playback/#dfn- type: dfn text: local playback device text: local playback state +spec: ecmascript; urlPrefix: https://tc39.es/ecma262/multipage/ + type: dfn; + text: current realm; url: executable-code-and-execution-contexts.html#sec-code-realms # Introduction # {#intro} @@ -207,7 +214,7 @@ the user agent MUST run the following steps: {{PictureInPictureWindow}} associated with {{pictureInPictureElement}}. 10. Append relevant settings object's origin to initiators of active Picture-in-Picture sessions. -11. Queue a task to fire an event named +11. Queue a picture-in-picture task to fire an event named {{enterpictureinpicture}} using {{PictureInPictureEvent}} at the |video| with its {{bubbles}} attribute initialized to `true` and its {{PictureInPictureEvent/pictureInPictureWindow}} attribute initialized to @@ -242,7 +249,7 @@ the user agent MUST run the following steps: abort these steps. 2. Run the close window algorithm with the Picture-in-Picture window associated with {{pictureInPictureElement}}. -3. Queue a task to fire an event named +3. Queue a picture-in-picture task to fire an event named {{leavepictureinpicture}} using {{PictureInPictureEvent}} at the |video| with its {{bubbles}} attribute initialized to `true` and its {{PictureInPictureEvent/pictureInPictureWindow}} attribute initialized to @@ -348,10 +355,10 @@ parallel: 1. Let |video| be the video element on which the method was invoked. 2. Run the request Picture-in-Picture algorithm with |video|. -3. If the previous step threw an exception, reject |promise| with that - exception and abort these steps. -4. [=/Resolve=] |promise| with the Picture-in-Picture window associated with - {{pictureInPictureElement}}. +3. If the previous step threw an exception, [=queue a picture-in-picture task=] + to reject |promise| with that exception and abort these steps. +4. [=Queue a picture-in-picture task=] to [=/resolve=] |promise| with the + Picture-in-Picture window associated with {{pictureInPictureElement}}. ## Extensions to Document ## {#document-extensions} @@ -376,9 +383,10 @@ return a new promise |promise| and run the following steps in parallel: 1. Run the exit Picture-in-Picture algorithm. -2. If the previous step threw an exception, reject |promise| with that +2. If the previous step threw an exception, + [=queue a picture-in-picture task=] to reject |promise| with that exception and abort these steps. -3. [=/Resolve=] |promise|. +3. [=Queue a picture-in-picture task=] to [=/resolve=] |promise|. ## Extension to DocumentOrShadowRoot ## {#documentorshadowroot-extension} @@ -426,8 +434,9 @@ The {{height}} attribute MUST return the height in CSS pixels the |state| is `opened`. Otherwise, it MUST return 0. When the size of the Picture-in-Picture window associated with -{{pictureInPictureElement}} changes, the user agent MUST queue a task to -fire an event named {{resize}} at {{pictureInPictureElement}}. +{{pictureInPictureElement}} changes, the user agent MUST +queue a picture-in-picture task to fire an event named +{{resize}} at {{pictureInPictureElement}}. ## Event types ## {#event-types} @@ -455,6 +464,11 @@ dictionary PictureInPictureEventInit : EventInit { The task source for all the tasks queued in this specification is the media element event task source of the video element in question. +When an algorithm queues a +picture-in-picture task T, the user agent MUST +[=queue a global task=] T on the [[media element task source]] +using the [=global object=] of the [=current realm=]. + ## CSS pseudo-class ## {#css-pseudo-class} The `:picture-in-picture` pseudo-class MUST match the Picture-in-Picture