Skip to content

Commit

Permalink
Merge pull request #187 from w3c/dropped-entries-count
Browse files Browse the repository at this point in the history
Update dropped entries count processing logic
  • Loading branch information
npm1 committed Aug 19, 2021
2 parents acb771c + deeb36e commit 9d1e443
Showing 1 changed file with 28 additions and 17 deletions.
45 changes: 28 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ <h2>The <dfn>PerformanceObserver</dfn> interface</h2>
</li>
<li>A <code>DOMString</code> <dfn>observer type</dfn> which is initially
<code>"undefined"</code>.</li>
<li>A boolean <dfn>requires dropped entries</dfn> which is initially set to false.</li>
</ul>
<p>The `PerformanceObserver(callback)` constructor must create a new
<a>PerformanceObserver</a> object with its <a>observer callback</a>
Expand Down Expand Up @@ -403,7 +404,8 @@ <h2><dfn>PerformanceObserverCallbackOptions</dfn> dictionary</h2>
<dl>
<dt><dfn>droppedEntriesCount</dfn></dt>
<dd>An integer representing the dropped entries count for the entry types that the
observer is observing when its callback is run.</dd>
observer is observing when the <a>PerformanceObserver</a>'s <a>requires dropped entries</a>
is set.</dd>
</dl>
</section>
<section>
Expand Down Expand Up @@ -448,6 +450,7 @@ <h2><dfn>observe()</dfn> method</h2>
</li>
</ol>
</li>
<li>Set <a>this</a>'s <a>requires dropped entries</a> to true.</li>
<li>If <a>this</a>'s <a>observer type</a> is
<code>"multiple"</code>, run the following steps:
<ol>
Expand Down Expand Up @@ -753,28 +756,36 @@ <h2>Queue the PerformanceObserver task</h2>
{{PerformanceObserverEntryList}}, with its <a>entry list</a> set
to <var>entries</var>.
</li>
<li>Let <var>droppedEntriesCount</var> be 0.</li>
<li>For each <a>PerformanceObserverInit</a> <var>item</var> in
<var>registeredObserver</var>'s <a>options list</a>:
<li>Let <var>droppedEntriesCount</var> be null.</li>
<li>If <var>po</var>'s <a>requires dropped entries</a> is set, perform the following
steps:
<ol>
<li>For each <a data-cite="WEBIDL#idl-DOMString">DOMString</a>
<var>entryType</var> that appears either as <var>item</var>'s <a data-link-for=
"PerformanceObserverInit">type</a> or in <var>item</var>'s
<a data-link-for="PerformanceObserverInit">entryTypes</a>:
<ol>
<li>Let <var>map</var> be <var>relevantGlobal</var>'s <a>performance entry
buffer map</a>.</li>
<li>Let <var>tuple</var> be the result of <a>getting the value of entry</a>
on <var>map</var> given <var>entryType</var> as <a>key</a>.</li>
<li>Increase <var>droppedEntriesCount</var> by <var>tuple</var>'s
<a>dropped entries count</a>.</li>
</ol>
<li>Set <var>droppedEntriesCount</var> to 0.</li>
<li>For each <a>PerformanceObserverInit</a> <var>item</var> in
<var>registeredObserver</var>'s <a>options list</a>:
<ol>
<li>For each <a data-cite="WEBIDL#idl-DOMString">DOMString</a>
<var>entryType</var> that appears either as <var>item</var>'s <a data-link-for=
"PerformanceObserverInit">type</a> or in <var>item</var>'s
<a data-link-for="PerformanceObserverInit">entryTypes</a>:
<ol>
<li>Let <var>map</var> be <var>relevantGlobal</var>'s <a>performance entry
buffer map</a>.</li>
<li>Let <var>tuple</var> be the result of <a>getting the value of entry</a>
on <var>map</var> given <var>entryType</var> as <a>key</a>.</li>
<li>Increase <var>droppedEntriesCount</var> by <var>tuple</var>'s
<a>dropped entries count</a>.</li>
</ol>
</li>
</ol>
</li>
<li>Set <var>po</var>'s <a>requires dropped entries</a> to false.</li>
</ol>
</li>
<li>Let <var>callbackOptions</var> be a <a>PerformanceObserverCallbackOptions</a>
with its <a data-link-for="PerformanceObserverCallbackOptions">droppedEntriesCount</a>
set to <var>droppedEntriesCount</var>.</li>
set to <var>droppedEntriesCount</var> if <var>droppedEntriesCount</var> is not null,
otherwise unset.</li>
<li>Call <var>po</var>’s <a>observer callback</a> with
<var>observerEntryList</var> as the first argument, with <var>po</var>
as the second argument and as <a>callback this value</a>, and with
Expand Down

0 comments on commit 9d1e443

Please sign in to comment.