Skip to content

Commit 0cc2fd8

Browse files
authored
[css-egg-1] Add the adafish unit and the performance media query (#5631)
* Fix compilation * [css-egg] Add the adafish unit and performance media query
1 parent d8dfa82 commit 0cc2fd8

File tree

1 file changed

+66
-2
lines changed

1 file changed

+66
-2
lines changed

css-egg-1/Overview.bs

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ spec:css-images-3; type:value;
1919
text: closest-corner
2020
text: farthest-corner
2121
spec:css-values-3; type:type; text:<time>
22+
spec:css-conditional-3; type:at-rule; text:@media
2223
</pre>
2324

2425
<style type="text/css">
@@ -62,14 +63,15 @@ Module Interactions</h3>
6263
<li>the data type definitions in [[!CSS3-VALUES]]
6364
<li>the <<gradient>> definition in [[!CSS4-IMAGES]]
6465
<li>the 'voice-rate' property in [[!CSS3SPEECH]]
66+
<li>the '@media' rule in [[!MEDIAQUERIES-5]]
6567
</ul>
6668

6769
<h3 id="values">
6870
Value Definitions</h3>
6971

7072
This specification follows the <a href="https://www.w3.org/TR/CSS2/about.html#property-defs">CSS property definition conventions</a> from [[!CSS2]]
71-
using the <a href="https://www.w3.org/TR/css-values-3/#value-defs">value definition syntax</a> from [[!CSS-VALUES-3]].
72-
Value types not defined in this specification are defined in CSS Values &amp; Units [[!CSS-VALUES-3]].
73+
using the <a href="https://www.w3.org/TR/css-values-3/#value-defs">value definition syntax</a> from [[!CSS3-VALUES]].
74+
Value types not defined in this specification are defined in CSS Values &amp; Units [[!CSS3-VALUES]].
7375
Combination with other CSS modules may expand the definitions of these value types.
7476

7577
In addition to the property-specific values listed in their definitions,
@@ -366,6 +368,68 @@ This specification extends the 'voice-rate' property, so that the ''tmbl'' unit
366368

367369
Issue: Should negative values be allowed for <<speech-rate>> for reversed speech?
368370

371+
372+
<h3 id=fps>
373+
Device performance</h3>
374+
375+
<div class="informative">
376+
Device performance is known to be a perfectly linear quantity with a total ordering consistent across different kinds of workloads. It is desirable to be able to design adaptive content that works across a range of user agent and device performance.</div>
377+
378+
This specification introduces an new <a spec="css-values">dimension</a>, together with a new unit to be used with this dimension.
379+
380+
The <dfn id="device-performance-value"><<device-performance>></dfn> describes the performance of the current device and user agent combination. It can be expressed using the ''adafish'' unit, as defined below.
381+
382+
383+
<table class="data" export>
384+
<thead>
385+
<tr><th>unit
386+
<th>name
387+
<th>definition
388+
<tbody>
389+
<tr><th><dfn>adafish</dfn>
390+
<td>Adafish
391+
<td>This is the maximum number of fish that can be displayed on the current device and user agent combination in <a href="https://ada.is/xrgarden/">Ada Rose Cannon's Fish Garden</a> without the user agent dropping any frames.
392+
</table>
393+
394+
Note: <a href="https://ada.is/xrgarden/">Ada Rose Cannon's Fish Garden</a> supports changing the number of fish through the `?fish=` query parameter, e.g. <a href="https://ada.is/xrgarden/?fish=50">this link will show 50 fish</a>
395+
396+
<h4 id="media-query-ext">
397+
Extension to the ''@media'' rule: The 'performance' feature</h4>
398+
399+
<pre class='descdef mq'>
400+
Name: performance
401+
Value: <<device-performance>>
402+
For: @media
403+
Type: range
404+
</pre>
405+
406+
The 'performance' media feature describes the performance characteristics of the current device and user agent combination at the current time. It SHOULD incorporate transient and permanent environmental factors affecting performance such as the current room temperature, the accumulation of dust in the device's cooling system, and the existence of spilled lemonade or coffee on the device's motherboard.
407+
408+
When querying the 'performance' feature the user agent SHOULD ensure that it is querying a recent value. The user agent MAY in the background run <a href="https://ada.is/xrgarden/">Ada's Fish Garden</a> with various parameters to estimate this value. If device performance characteristics change while content is being viewed, the user agent MUST recompute its value for 'performance', potentially restyling the document.
409+
410+
<div class=example>
411+
This feature is useful for designing robust content that adapts to different device characteristics.
412+
413+
<pre><code class="lang-css">
414+
@media (min-performance: 1000adafish) {
415+
#very-cool-demo-with-blinky-lights {
416+
display: block;
417+
}
418+
}
419+
420+
@media (max-performance: 1000adafish) {
421+
#really-bad-demo-with-no-blinky-lights-whatsoever {
422+
display: block;
423+
}
424+
}
425+
</code></pre>
426+
</div>
427+
428+
<h4 id="adafish-fingerprinting">Fingerprinting concerns</h4>
429+
430+
This API may be used for gleaning information about the user's environment, which may be used to fingerprint them. This is recognized to be an acceptable loss for the momentous benefits this API is expected to provide the web platform.
431+
432+
369433
<h2 id="rainbow">
370434
Double Rainbow</h2>
371435

0 commit comments

Comments
 (0)