Skip to content

Commit e45964e

Browse files
committed
[css-syntax] Drop the digit when serializating an+b with A=1 or -1. Fixes w3c#1504. Also update the link-defaults.
1 parent 320a990 commit e45964e

1 file changed

Lines changed: 37 additions & 23 deletions

File tree

css-syntax/Overview.bs

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ Editor: Simon Sapin, Mozilla, http://exyr.org/about/
1616
Abstract: This module describes, in general terms, the basic structure and syntax of CSS stylesheets. It defines, in detail, the syntax and parsing of CSS - how to turn a stream of bytes into a meaningful stylesheet.
1717
Ignored Terms: <keyframes-name>, <keyframe-rule>, <keyframe-selector>, <translation-value>, <media-query-list>, <unicode-range-token>
1818
Ignored Vars: +b, -b, foo
19-
Link Defaults: css-text-decor-3 (property) text-decoration, css-color-3 (property) color, css-transforms-1 (function) translatex()
19+
</pre>
20+
21+
<pre class=link-defaults>
22+
spec:css-text-decor-3; type:property; text:text-decoration
23+
spec:css-color-3; type:property; text:color
24+
spec:css-transforms-1; type:function; text:translatex()
25+
spec:infra; type:dfn; text:string
2026
</pre>
2127

2228
<h2 id="intro">
@@ -3333,33 +3339,41 @@ Serialization</h2>
33333339
<h3 id='serializing-anb'>
33343340
Serializing <var>&lt;an+b></var></h3>
33353341

3336-
To <dfn export>serialize an <var>&lt;an+b></var> value</dfn>,
3337-
let <var>s</var> initially be the empty string:
3342+
<div algorithm>
3343+
To <dfn export>serialize an <<an+b>> value</dfn>,
3344+
with integer values |A| and |B|:
33383345

3339-
<dl>
3340-
<dt><var>A</var> and <var>B</var> are both zero
3341-
<dd>
3342-
Append "0" to <var>s</var>.
3346+
1. If |A| is zero,
3347+
return the serialization of |B|.
33433348

3344-
<dt><var>A</var> is zero, <var>B</var> is non-zero
3345-
<dd>
3346-
Serialize <var>B</var> and append it to <var>s</var>.
3349+
2. Otherwise, let |result| initially be an empty [=string=].
33473350

3348-
<dt><var>A</var> is non-zero, <var>B</var> is zero
3349-
<dd>
3350-
Serialize <var>A</var> and append it to <var>s</var>.
3351-
Append "n" to <var>s</var>.
3351+
3.
3352+
<dl class=switch>
3353+
: |A| is <code>1</code>
3354+
:: Append "n" to |result|.
33523355

3353-
<dt><var>A</var> and <var>B</var> are both non-zero
3354-
<dd>
3355-
Serialize <var>A</var> and append it to <var>s</var>.
3356-
Append "n" to <var>s</var>.
3357-
If <var>B</var> is positive,
3358-
append "+" to <var>s</var>
3359-
Serialize <var>B</var> and append it to <var>s</var>.
3360-
</dl>
3356+
: |A| is <code>-1</code>
3357+
:: Append "-n" to |result|.
3358+
3359+
: |A| is non-zero
3360+
:: Serialize |A| and append it to |result|,
3361+
then append "n" to |result|.
3362+
</dl>
3363+
3364+
4.
3365+
<dl class=switch>
3366+
: |B| is greater than zero
3367+
:: Append "+" to |result|,
3368+
then append the serialization of |B| to |result|.
3369+
3370+
: |B| is less than zero
3371+
:: Append the serialization of |B| to |result|.
3372+
</dl>
3373+
3374+
5. Return |result|.
3375+
</div>
33613376

3362-
Return <var>s</var>.
33633377

33643378
<h2 id="priv-sec">
33653379
Privacy and Security Considerations</h2>

0 commit comments

Comments
 (0)