Skip to content

Commit 2d6c4df

Browse files
committed
Rewrite the informative intro to check() to make its behavior clearer.
1 parent 5b74b2c commit 2d6c4df

File tree

2 files changed

+39
-19
lines changed

2 files changed

+39
-19
lines changed

css-color/Overview.bs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ HWB Colors: ''hwb()'' function</h2>
11651165
<img src="images/color-picker.png">
11661166
<figcaption>
11671167
This is a screenshot of Chrome's color picker,
1168-
shown when a user activates an <code class='lang-markup'>&lt;input type='color'></code>.
1168+
shown when a user activates an <code class='lang-markup'>&lt;input type="color"></code>.
11691169
The outer wheel is used to select the hue,
11701170
then the relative amounts of white and black are selected by clicking on the inner triangle.
11711171
</figcaption>
@@ -1494,7 +1494,7 @@ Specifying Grays: the ''gray()'' functional notation</h2>
14941494
could actually compute the gray with the specified luminance.
14951495
The sRGB power curve means that grays are much darker than they "should" be;
14961496
50% gray has a luminance of .21, for example, rather than .5.
1497-
1497+
14981498
Reversing luminance to color is easy for grays:
14991499
if L &lt; .0774, <code>x * 12.92</code>;
15001500
otherwise, <code>(x ^ (5/12)) * 1.055 - .055</code>.
@@ -1516,36 +1516,36 @@ Specifying Grays: the ''gray()'' functional notation</h2>
15161516
Device-independent Colors: Lab and LCH</h2>
15171517

15181518
Physical measurements of a color are typically expressed in a color
1519-
space created in 1976 by the <abbr title='Commission Internationale
1519+
space created in 1976 by the <abbr title='Commission Internationale
15201520
de l'Eclairage'>CIE</abbr>, Lab. Color conversions from one device
1521-
to another also use Lab as an intermediate step. Derived from
1522-
human vision experiments, Lab represents the entire range of
1521+
to another also use Lab as an intermediate step. Derived from
1522+
human vision experiments, Lab represents the entire range of
15231523
color that humans can see.
15241524

1525-
<!-- Simplify by saying Lab throughout rather than CIELab or
1525+
<!-- Simplify by saying Lab throughout rather than CIELab or
15261526
CIE L*a*b*, because that is what people write in practice -->
1527-
Lab is a rectangular coordinate system with a central Lightness axis.
1527+
Lab is a rectangular coordinate system with a central Lightness axis.
15281528
L=0 is deep black (no light at all) while L=100 is white (with a color
1529-
temperature of 5000K). Usefully, L=50 is mid gray, by design: the
1529+
temperature of 5000K). Usefully, L=50 is mid gray, by design: the
15301530
Lab color space is intended to be <em>perceptually uniform</em>.
15311531
The a and b axes convey hue; positive values along the a axis are red
15321532
while negative values are the complementary color, green. Similarly
1533-
positive values along the b axis are yellow and negative are the
1534-
complementary blue/violet. Desaturated colors have small values
1535-
of a and b and are close to the L axis; saturated colors lie far from
1533+
positive values along the b axis are yellow and negative are the
1534+
complementary blue/violet. Desaturated colors have small values
1535+
of a and b and are close to the L axis; saturated colors lie far from
15361536
the L axis.
15371537

15381538
<!-- because Luv is not widely used nowadays, no need to say LCH(ab)
15391539
to distinguish from LCH(uv) -->
15401540
LCH has the same L axis as Lab, but uses polar coordinates C (chroma)
1541-
and H (hue). C is the geometric distance from the L axis and H
1541+
and H (hue). C is the geometric distance from the L axis and H
15421542
is the angle, in degrees, from the positive a axis.
15431543

15441544
<p class='note'>
15451545
The Lightness axis in Lab should not be confused with the L axis in HSL.
15461546
For example, in HSL, the sRGB colors blue (#00F) and yellow (#FF0)
15471547
have the same value of L even though visually, blue is much darker. In
1548-
Lab, if two colors have the same measured L value, they have
1548+
Lab, if two colors have the same measured L value, they have
15491549
identical visual lightness. HSL and related polar RGB models were
15501550
developed to give similar usability benefits for RGB that LCH gave
15511551
to Lab.</p>

css-font-loading/Overview.bs

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Previous Version: https://www.w3.org/TR/2014/WD-css-font-loading-3-20140522/
1212
Editor: Tab Atkins Jr., Google, http://xanthir.com/contact/
1313
Former Editor: John Daggett, Mozilla, jdaggett@mozilla.com
1414
Abstract: This CSS module describes events and interfaces used for dynamically loading font resources.
15-
Link Defaults: css-fonts-3 (descriptor) src, dom-ls (interface) Event, typedarray (interface) ArrayBuffer/ArrayBufferView
15+
Link Defaults: css-fonts-3 (descriptor) src, dom (interface) Event, typedarray (interface) ArrayBuffer/ArrayBufferView
1616
Ignored Terms: EventHandler, InvalidModificationError, WorkerGlobalScope, CanvasProxy, Document, add(), src
1717
</pre>
1818

1919
<pre class="link-defaults">
20-
spec:dom-ls; type:interface; text:EventTarget
20+
spec:dom; type:interface; text:EventTarget
2121
</pre>
2222

2323
<h2 id="introduction">
@@ -823,12 +823,32 @@ The <code>load()</code> method</h3>
823823
<h3 id='font-face-set-check'>
824824
The <code>check()</code> method</h3>
825825

826-
The {{FontFaceSet/check()}} method of {{FontFaceSet}} will determine whether all fonts in the given font list
827-
have been loaded and are available.
828-
If all fonts are available,
829-
it returns true;
826+
The {{FontFaceSet/check()}} method of {{FontFaceSet}} will determine you can "safely"
827+
render some provided text with a particular font list,
828+
such that it won't cause a "font swap" later.
829+
If the given text/font combo will not cause any font loads,
830+
and does not rely on currently-loading fonts,
831+
this method will return true;
830832
otherwise, it returns false.
831833

834+
<div class=note>
835+
Two special cases in this method's behavior should be noted,
836+
as they are non-obvious:
837+
838+
* If the specified fonts exist,
839+
but all possible faces are ruled out due to their unicode-range not covering the provided text,
840+
the method returns <code>true</code>,
841+
as the text will be rendered in the UA's fallback font instead,
842+
and won't trigger any font loads.
843+
* If none of the specified fonts exist,
844+
even tho this is technically similar to the previous case,
845+
in that text rendered with that font list would just use the UA fallback font.
846+
This is because such a situation is almost certainly either a typo,
847+
or the result of changing the name of a downloadable font
848+
and forgetting to update all places the old name was used,
849+
and an error is more useful than a vacuous <code>true</code>.
850+
</div>
851+
832852
When the <dfn method for="FontFaceSet" lt="check(font, text)|check(font)">check</dfn>(
833853
<span data-dfn-for="FontFaceSet/check(font, text)"><dfn argument>font</dfn>, <dfn argument>text</dfn>)</span>
834854
method is called,

0 commit comments

Comments
 (0)