Skip to content

Commit 739046b

Browse files
committed
[css-syntax] Fix <an+b> parsing: '-n-3' is (-1, -3), not (-1, 3)
1 parent 1b7a57a commit 739046b

2 files changed

Lines changed: 33 additions & 14 deletions

File tree

css-syntax/Overview.html

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3601,7 +3601,7 @@ <h3 id=the-anb-type><span class=secno>6.2. </span> The <a
36013601
<dt><a href="#ltinteger"><code><var>&lt;integer></var></code></a>
36023602

36033603
<dd> <a href="#a"><var>A</var></a> is 0, <a href="#b"><var>B</var></a>
3604-
is the integer.
3604+
is the integer’s value.
36053605

36063606
<dt><a
36073607
href="#ltn-dimension"><code><var>&lt;n-dimension></var></code></a>
@@ -3619,13 +3619,19 @@ <h3 id=the-anb-type><span class=secno>6.2. </span> The <a
36193619
<dt><code>'+'? <a
36203620
href="#ltndashdigit-ident"><var>&lt;ndashdigit-ident></var></a></code>
36213621

3622+
<dd> <a href="#a"><var>A</var></a> is the dimension's value or 1,
3623+
respectively. <a href="#b"><var>B</var></a> is the dimension's unit
3624+
or ident's value, respectively, with the first character removed and
3625+
the remainder interpreted as a base-10 number. <span class=note>B is
3626+
negative.</span>
3627+
36223628
<dt><a
36233629
href="#ltdashndashdigit-ident"><code><var>&lt;dashndashdigit-ident></var></code></a>
36243630

3625-
<dd> <a href="#a"><var>A</var></a> is the dimension's value, 1, or -1,
3626-
respectively. <a href="#b"><var>B</var></a> is the dimension's unit
3627-
or ident's value, as appropriate, with the first two characters
3628-
removed and the remainder interpreted as a base-10 number.
3631+
<dd> <a href="#a"><var>A</var></a> is -1. <a
3632+
href="#b"><var>B</var></a> is the ident's value, with the first two
3633+
characters removed and the remainder interpreted as a base-10 number.
3634+
<span class=note>B is negative.</span>
36293635

36303636
<dt><code><a href="#ltn-dimension"><var>&lt;n-dimension></var></a> <a
36313637
href="#ltsigned-integer"><var>&lt;signed-integer></var></a></code>
@@ -3637,7 +3643,7 @@ <h3 id=the-anb-type><span class=secno>6.2. </span> The <a
36373643
href="#ltsigned-integer"><var>&lt;signed-integer></var></a></code>
36383644

36393645
<dd> <a href="#a"><var>A</var></a> is the dimension's value, 1, or -1,
3640-
respectively. <a href="#b"><var>B</var></a> is the integer.
3646+
respectively. <a href="#b"><var>B</var></a> is the integer’s value.
36413647

36423648
<dt><code><a href="#ltn-dimension"><var>&lt;n-dimension></var></a>
36433649
['+' | '-'] <a
@@ -3650,9 +3656,10 @@ <h3 id=the-anb-type><span class=secno>6.2. </span> The <a
36503656
href="#ltsignless-integer"><var>&lt;signless-integer></var></a></code>
36513657

36523658
<dd> <a href="#a"><var>A</var></a> is the dimension's value, 1, or -1,
3653-
respectively. <a href="#b"><var>B</var></a> is the integer. If a
3654-
<code class=property>-</code>’ was provided between the two, <a
3655-
href="#b"><var>B</var></a> is instead the negation of the integer.
3659+
respectively. <a href="#b"><var>B</var></a> is the integer’s value.
3660+
If a ‘<code class=property>-</code>’ was provided between the
3661+
two, <a href="#b"><var>B</var></a> is instead the negation of the
3662+
integer’s value.
36563663
</dl>
36573664

36583665
<h2 id=rule-defs><span class=secno>7. </span> Defining Grammars for

css-syntax/Overview.src.html

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2530,31 +2530,43 @@ <h3 id="the-anb-type">
25302530

25312531
<dt><code><var>&lt;integer></var></code>
25322532
<dd>
2533-
<var>A</var> is 0, <var>B</var> is the integer.
2533+
<var>A</var> is 0, <var>B</var> is the integer’s value.
25342534

25352535
<dt><code><var>&lt;n-dimension></var></code>
25362536
<dt><code>'+'? n</code>
25372537
<dt><code>-n</code>
25382538
<dd>
2539-
<var>A</var> is the dimension's value, 1, or -1, respectively. <var>B</var> is 0.
2539+
<var>A</var> is the dimension's value, 1, or -1, respectively.
2540+
<var>B</var> is 0.
25402541

25412542
<dt><code><var>&lt;ndashdigit-dimension></var></code>
25422543
<dt><code>'+'? <var>&lt;ndashdigit-ident></var></code>
2544+
<dd>
2545+
<var>A</var> is the dimension's value or 1, respectively.
2546+
<var>B</var> is the dimension's unit or ident's value, respectively,
2547+
with the first character removed and the remainder interpreted as a base-10 number.
2548+
<span class=note>B is negative.</span>
2549+
25432550
<dt><code><var>&lt;dashndashdigit-ident></var></code>
25442551
<dd>
2545-
<var>A</var> is the dimension's value, 1, or -1, respectively. <var>B</var> is the dimension's unit or ident's value, as appropriate, with the first two characters removed and the remainder interpreted as a base-10 number.
2552+
<var>A</var> is -1.
2553+
<var>B</var> is the ident's value, with the first two characters removed and the remainder interpreted as a base-10 number.
2554+
<span class=note>B is negative.</span>
25462555

25472556
<dt><code><var>&lt;n-dimension></var> <var>&lt;signed-integer></var></code>
25482557
<dt><code>'+'? n <var>&lt;signed-integer></var></code>
25492558
<dt><code>-n <var>&lt;signed-integer></var></code>
25502559
<dd>
2551-
<var>A</var> is the dimension's value, 1, or -1, respectively. <var>B</var> is the integer.
2560+
<var>A</var> is the dimension's value, 1, or -1, respectively.
2561+
<var>B</var> is the integer’s value.
25522562

25532563
<dt><code><var>&lt;n-dimension></var> ['+' | '-'] <var>&lt;signless-integer></var></code>
25542564
<dt><code>'+'? n ['+' | '-'] <var>&lt;signless-integer></var></code>
25552565
<dt><code>-n ['+' | '-'] <var>&lt;signless-integer></var></code>
25562566
<dd>
2557-
<var>A</var> is the dimension's value, 1, or -1, respectively. <var>B</var> is the integer. If a '-' was provided between the two, <var>B</var> is instead the negation of the integer.
2567+
<var>A</var> is the dimension's value, 1, or -1, respectively.
2568+
<var>B</var> is the integer’s value.
2569+
If a '-' was provided between the two, <var>B</var> is instead the negation of the integer’s value.
25582570
</dl>
25592571

25602572

0 commit comments

Comments
 (0)