diff --git a/index.html b/index.html index 2321374..9149cb7 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,7 @@ "check-punctuation": true, }, doJsonLd: true, - xref: ["hr-time-3", "infra", "html", "dom"], + xref: ["hr-time-3", "infra", "html", "dom", "document-policy"], mdn: "performance-timeline", }; @@ -69,6 +69,8 @@
  • Adds support for {{PerformanceObserver}}.
  • +
  • Adds support for cross-frame timeline sharing. +
  • @@ -261,8 +263,14 @@

    Extensions to the {{Performance}} interface

    hosts performance related attributes and methods used to retrieve the performance metric data from the Performance Timeline.

    +      dictionary PerformanceEntryOptions {
    +        DOMString type;
    +        DOMString name;
    +        boolean includeFrames;
    +      };
    +
           partial interface Performance {
    -        PerformanceEntryList getEntries ();
    +        PerformanceEntryList getEntries (optional PerformanceEntryOptions options = {});
             PerformanceEntryList getEntriesByType (DOMString type);
             PerformanceEntryList getEntriesByName (DOMString name, optional DOMString type);
           };
    @@ -271,26 +279,43 @@ 

    Extensions to the {{Performance}} interface

    The PerformanceEntryList represents a sequence of PerformanceEntry, providing developers with all the convenience methods found on JavaScript arrays.

    +
    +

    PerformanceEntryOptions dictionary

    +
    +
    type
    +
    A single entry type to be retrieved.
    +
    name
    +
    A string representing the name of entries to be retrieved.
    +
    includeFrames
    +
    A flag to indicate whether entries from child frames should be + retrieved.
    +
    +

    getEntries() method

    Returns a PerformanceEntryList object returned by the filter buffer map by name and type algorithm with - name and type set to null.

    + name, type and includeFrames set to the + corresponding members of the method's input options + parameter.

    getEntriesByType() method

    Returns a PerformanceEntryList object returned by filter buffer map by name and type algorithm with name set to - null, and type set to the method's input - type parameter.

    + null, type set to the method's input + type parameter, and includeFrames set to + false.

    getEntriesByName() method

    Returns a PerformanceEntryList object returned by filter buffer map by name and type algorithm with name set to - the method input name parameter, and type set - to null if optional `entryType` is omitted, or set to the - method's input type parameter otherwise.

    + the method's input name parameter, type set to + either null if optional `entryType` is omitted, or the + method's input type parameter otherwise, and + includeFrames set to false.

    @@ -305,6 +330,7 @@

    The PerformanceEntry interface

    readonly attribute DOMString entryType; readonly attribute DOMHighResTimeStamp startTime; readonly attribute DOMHighResTimeStamp duration; + readonly attribute object? source; [Default] object toJSON(); };
    @@ -341,9 +367,16 @@

    The PerformanceEntry interface

    duration concept doesn't apply, a performance metric may choose to return a `duration` of 0. +
    source
    +
    + This attribute MUST return the [=global object=] for the realm in which + this PerformanceEntry was recorded. +

    When toJSON is called, run [[WebIDL]]'s default toJSON steps.

    +

    The toJSON method should not attempt to serialize + the source object reference.

    @@ -402,7 +435,7 @@

    PerformanceObserverCallbackOptions dictionary

    observer is observing when the PerformanceObserver's requires dropped entries is set. -
    +

    observe() method

    The observe() method instructs the user agent to register @@ -556,6 +589,7 @@

    PerformanceObserverInit dictionary

    sequence<DOMString> entryTypes; DOMString type; boolean buffered; + boolean includeFrames; };
    @@ -574,6 +608,11 @@

    PerformanceObserverInit dictionary

    A flag to indicate whether buffered entries should be queued into observer's buffer.
    +
    +
    includeFrames
    +
    A flag to indicate whether entries from child frames should be + observed.
    +
    @@ -657,8 +696,8 @@

    supportedEntryTypes attribute

    Processing

    Queue a PerformanceEntry

    -

    To queue a PerformanceEntry (newEntry), run - these steps:

    +

    To queue a PerformanceEntry (newEntry) + with optional boolean traverse, run these steps:

    1. Let interested observers be an initially empty set of PerformanceObserver objects. @@ -669,6 +708,8 @@

      Queue a PerformanceEntry

    2. Let relevantGlobal be newEntry's relevant global object.
    3. +
    4. Set newEntry's {{PerformanceEntry/source}} to relevantGlobal. +
    5. For each registered performance observer regObs in relevantGlobal's list of registered performance observer objects:
        @@ -712,6 +753,25 @@

        Queue a PerformanceEntry

      1. Queue the PerformanceObserver task with relevantGlobal as input.
      2. +
      3. If traverse is true: +
          +
        1. Let origins be the result of calling + [=get-policy-value=] with `share-performance-timeline-with` + and relevantGlobal's active document.
        2. +
        3. For each browsing context context which is an + ancestor browsing context of relevantGlobal's + browsing context: +
            +
          1. If origins contains the token `*`, or + origins contains context's origin, + Queue a global task on the performance timeline task + source with context's [=browsing context/active + window=] to queue a PerformanceEntry with + newEntry.
          2. +
          +
        4. +
        +
    @@ -800,8 +860,8 @@

    Queue the PerformanceObserver task

    Filter buffer map by name and type

    When asked to run the filter buffer map by name and type - algorithm with optional name and type, run the - following steps:

    + algorithm with optional name, type, and + includeFrames, run the following steps:

    1. Let result be an initially empty list.
    2. @@ -826,8 +886,8 @@

      Filter buffer map by name and type

      continue to the next tuple.
    3. Let entries be the result of running filter - buffer by name and type with buffer, name - and type as inputs. + buffer by name and type with buffer, name, + type and includeFrames as inputs.
    4. For each entry in entries, [=list/append=] entry to result.
    5. @@ -842,14 +902,17 @@

      Filter buffer map by name and type

      Filter buffer by name and type

      When asked to run the filter buffer by name and type - algorithm, with buffer, name, and type - as inputs, run the following steps:

      + algorithm, with buffer, name, type and + includeFrames as inputs, run the following steps:

      1. Let result be an initially empty list.
      2. For each PerformanceEntry entry in buffer, run the following steps:
          +
        1. If includeFrames is not true and this's + relevant global object is not the same as entry's + {{PerformanceEntry/source}}, continue to next entry.
        2. If type is not null and if type is not identical to entry's entryType attribute, continue to next entry. @@ -884,6 +947,19 @@

          Determine if a performance entry buffer is full

    +
    +

    Integrations with other Specifications

    +
    +

    Integration with Document Policy

    +

    This specification defines a [=configuration point=] with the name + share-performance-timeline-with. Its type is + set, and its default value is the empty set.

    +

    Set members must be strings representing origins, or the token `*`, + representing all origins.

    +

    This integration requires a currently-non-specified + "set" type and "string" type in Document Policy.

    +
    +

    Privacy Considerations

    This specification extends the {{Performance}} interface defined by [[HR-TIME-3]] and