Skip to content

Commit

Permalink
Make ownContributionEstimate experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
kenchris committed Nov 20, 2024
1 parent 1a34ac5 commit dc39754
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,24 @@
ul li::marker {
font-family: "Segoe UI Emoji", "Noto Color Emoji";
}
.hidden {
display: none;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", async () => {
const params = new URLSearchParams(location.search);
const q = parseInt(params.get("experimental"));

document.querySelectorAll('[experimental]').forEach(el => {
if (q) {
el.setAttribute("class", el.getAttribute("klazz"));
} else {
el.remove();
}
})
});
</script>
<section id="abstract">
<p>
The <cite>Compute Pressure API</cite> provides a way for websites to react to changes
Expand Down Expand Up @@ -940,11 +957,15 @@ <h3>The <dfn>PressureRecord</dfn> interface</h3>
interface PressureRecord {
readonly attribute PressureSource source;
readonly attribute PressureState state;
readonly attribute double? ownContributionEstimate;
readonly attribute DOMHighResTimeStamp time;
[Default] object toJSON();
};
</pre>
<pre class="hidden" klazz="idl" experimental>
partial interface PressureRecord {
readonly attribute double? ownContributionEstimate;
};
</pre>
<p>
A constructed {{PressureRecord}} object has the following internal slots:
</p>
Expand All @@ -955,7 +976,7 @@ <h3>The <dfn>PressureRecord</dfn> interface</h3>
<li>
a <dfn>[[\State]]</dfn> value of type {{PressureState}}, which represents the current [=pressure state=].
</li>
<li>
<li class="hidden" experimental>
<p>
an <dfn>[[\OwnContributionEstimate]]</dfn> value of type double?, which represents an estimated percentage
(value between 0 and 1) of the current web site contribution to the global pressure for the current source.
Expand Down Expand Up @@ -987,7 +1008,7 @@ <h3>The <dfn>state</dfn> attribute</h3>
The {{PressureRecord/state}} [=getter steps=] are to return its {{PressureRecord/[[State]]}} internal slot.
</p>
</section>
<section>
<section class="hidden" experimental>
<h3>The <dfn>ownContributionEstimate</dfn> attribute</h3>
<p>
The {{PressureRecord/ownContributionEstimate}} [=getter steps=] are to return its {{PressureRecord/[[OwnContributionEstimate]]}} internal slot.
Expand Down Expand Up @@ -1242,7 +1263,7 @@ <h3>Supporting algorithms</h3>
</li>
</ol>
The <dfn>has change in data</dfn> steps given the argument |observer:PressureObserver|, |source:PressureSource|,
|state:PressureState|. |ownContributionEstimate:double?|, are as follows:
|state:PressureState|, <span class="hidden" experimental>|ownContributionEstimate:double?|,</span> are as follows:
<ol>
<li>
If |observer|.{{PressureObserver/[[LastRecordMap]]}}[|source|] does not [=map/exist=], return true.
Expand All @@ -1253,7 +1274,7 @@ <h3>Supporting algorithms</h3>
<li>
If |record|.{{PressureRecord/[[State]]}} is not equal to |state|, return true.
</li>
<li>
<li class="hidden" experimental>
If |record|.{{PressureRecord/[[OwnContributionEstimate]]}} is not equal to |ownContributionEstimate|, return true.
</li>
<li>
Expand Down Expand Up @@ -1423,7 +1444,7 @@ <h3>Data Collection and Delivery</h3>
<li>
Let |state:PressureState| be null.
</li>
<li>
<li class="hidden" experimental>
Let |ownContributionEstimate| be null.
</li>
<li>
Expand Down Expand Up @@ -1453,7 +1474,7 @@ <h3>Data Collection and Delivery</h3>
</p>
</aside>
</li>
<li>
<li class="hidden" experimental>
If the [=user agent=] can calculate an |estimation| of the current site's
contribution to the overall pressure in an [=implementation-defined=] manner,
given |sample|'s [=pressure source sample/data=], then set |ownContributionEstimate|
Expand Down Expand Up @@ -1485,14 +1506,17 @@ <h3>Data Collection and Delivery</h3>
returns false, [=iteration/continue=].
</li>
<li>
If running [=has change in data=] with |observer|, |source|, |state| and |ownContributionEstimate|
If running [=has change in data=] with |observer|, |source|, |state|
<span class="hidden" experimental> and |ownContributionEstimate|</span>
returns false, [=iteration/continue=].
</li>
<li>
Let |record:PressureRecord| be a new {{PressureRecord}} object with its
{{PressureRecord/[[Source]]}} set to |source|,
{{PressureRecord/[[State]]}} set to |state|,
{{PressureRecord/[[OwnContributionEstimate]]}} set to |ownContributionEstimate|
<span class="hidden" experimental>
{{PressureRecord/[[OwnContributionEstimate]]}} set to |ownContributionEstimate|
</span>
and {{PressureRecord/[[Time]]}} set to |timeValue|.
</li>
<li>
Expand Down

0 comments on commit dc39754

Please sign in to comment.