From 61682d0258762519dd571d88d0ffb38b2a8af7e8 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Tue, 19 Dec 2023 16:58:23 +0000 Subject: [PATCH] WIP render as task --- source | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/source b/source index 66f36ec10eb..98ee0cbb759 100644 --- a/source +++ b/source @@ -3380,6 +3380,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute data-x-href="https://w3c.github.io/hr-time/#dfn-unsafe-shared-current-time">unsafe shared current time, the shared monotonic clock, + the unsafe moment, the coarsen time algorithm, and the DOMHighResTimeStamp @@ -108122,8 +108123,8 @@ import "https://example.com/foo/../module2.mjs";
  • -

    Update the rendering: if this is a window event loop, - then:

    +

    Let Update the rendering be the following steps given an + unsafe moment frameTimestamp:

    1. @@ -108233,7 +108234,7 @@ import "https://example.com/foo/../module2.mjs";
    2. For each fully active Document in docs, update animations and send events for that Document, passing in - relative high resolution time given now and that + relative high resolution time given frameTimestamp and that Document's relevant global object as the timestamp. WEBANIMATIONS

    3. @@ -108278,7 +108279,7 @@ import "https://example.com/foo/../module2.mjs";
    4. For each fully active Document in docs, run the animation frame callbacks for that Document, passing in the - relative high resolution time given now and that + relative high resolution time given frameTimestamp and that Document's relevant global object as the timestamp.

    5. @@ -108389,6 +108390,33 @@ import "https://example.com/foo/../module2.mjs";
  • +
  • +

    If this is a window event loop, then run the following steps + in parallel:

    + +
      +
    1. Wait until at least one navigable navigable whose active document's relevant agent's event loop is this event loop might have a + rendering opportunity.

    2. + +
    3. Let frameTimestamp be the unsafe shared current time.

    4. + +
    5. +

      For each navigable that might have a rendering opportunity, + queue a global task on the rendering task source given + navigable's active document's + relevant global object to update the rendering given + frameTimestamp.

      + +

      The update the rendering steps would update all documents in this + event loop that have a rendering opportunity. The purpose of these + in parallel steps is to guarantee that the update the rendering step + is scheduled as a task.

      +
    6. +
    +
  • +
  • If all of the following are true:

    @@ -108844,6 +108872,12 @@ import "https://example.com/foo/../module2.mjs"; data-x="navigate">navigation and history traversal.

    + +
    The rendering task source
    + +
    +

    This task source us used solely to update the rendering. +

    Dealing with the event loop from other specifications