Skip to content

Commit d1f0651

Browse files
committed
[css-syntax] Add a type flag to the dimension token.
1 parent 26da212 commit d1f0651

2 files changed

Lines changed: 26 additions & 28 deletions

File tree

css-syntax/Overview.html

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,10 @@ <h2 id=tokenization><span class=secno>4. </span> Tokenization</h2>
692692
"unrestricted" if not otherwise set. Delim tokens have a value composed of
693693
a single character. Number, percentage, and dimension tokens have a
694694
representation composed of 1 or more character, and a numeric value.
695-
Number tokens additionally have a type flag set to either "integer" or
696-
"number". The type flag defaults to "integer" if not otherwise set.
697-
Dimension tokens additionally have a unit composed of one or more
698-
characters. Unicode-range tokens have a range of characters.
695+
Number and dimension tokens additionally have a type flag set to either
696+
"integer" or "number". The type flag defaults to "integer" if not
697+
otherwise set. Dimension tokens additionally have a unit composed of one
698+
or more characters. Unicode-range tokens have a range of characters.
699699

700700
<p class=note> The type flag of hash tokens is used in the Selectors syntax
701701
<a href="#SELECT" rel=biblioentry>[SELECT]<!--{{SELECT}}--></a>. Only hash
@@ -2119,12 +2119,10 @@ <h4 id=number-rest-state><span class=secno>4.4.10. </span> <dfn
21192119
U+0065 LATIN SMALL LETTER E (e) and the consumed characters to the number
21202120
token's representation. Switch to the <a
21212121
href="#sci-notation-state0"><i>sci-notation state</i></a>.
2122-
<p> Otherwise, create a dimension token with its representation set to
2123-
the number token's representation, its value set to the number produced
2124-
by interpreting the number token's representation as a base-10 number,
2125-
and its unit initially set to the <a
2126-
href="#current-input-character"><i>current input character</i></a>.
2127-
Switch to the <a href="#dimension-state0"><i>dimension state</i></a>.
2122+
<p> Otherwise, switch to the <a href="#number-end-state0"><i>number-end
2123+
state</i></a>. <a
2124+
href="#reconsume-the-current-input-character"><i>Reconsume the current
2125+
input character</i></a>.
21282126

21292127
<dt>anything else
21302128

@@ -2183,9 +2181,10 @@ <h4 id=number-end-state><span class=secno>4.4.12. </span> <dfn
21832181
href="#check-if-three-characters-would-start-an0"><i>starts with an
21842182
identifier</i></a>, create a dimension token with its representation set
21852183
to the number token's representation, its value set to the number token's
2186-
value, and a unit initially set to the <a
2187-
href="#current-input-character"><i>current input character</i></a>.
2188-
Switch to the <a href="#dimension-state0"><i>dimension state</i></a>.
2184+
value, its type flag set to the number token's type flag, and a unit
2185+
initially set to the <a href="#current-input-character"><i>current input
2186+
character</i></a>. Switch to the <a href="#dimension-state0"><i>dimension
2187+
state</i></a>.
21892188
<p> Otherwise, emit the number token. Switch to the <a
21902189
href="#data-state0"><i>data state</i></a>. <a
21912190
href="#reconsume-the-current-input-character"><i>Reconsume the current
@@ -2194,10 +2193,11 @@ <h4 id=number-end-state><span class=secno>4.4.12. </span> <dfn
21942193
<dt><a href="#name-start-character"><i>name-start character</i></a>
21952194

21962195
<dd> Create a dimension token with its representation set to the number
2197-
token's representation, its value set to the number token's value, and a
2198-
unit initially set to the <a href="#current-input-character"><i>current
2199-
input character</i></a>. Switch to the <a
2200-
href="#dimension-state0"><i>dimension state</i></a>.
2196+
token's representation, its value set to the number token's value, its
2197+
type flag set to the number token's type flag, and a unit initially set
2198+
to the <a href="#current-input-character"><i>current input
2199+
character</i></a>. Switch to the <a href="#dimension-state0"><i>dimension
2200+
state</i></a>.
22012201

22022202
<dt>U+005C REVERSE SOLIDUS (\)
22032203

@@ -2206,9 +2206,9 @@ <h4 id=number-end-state><span class=secno>4.4.12. </span> <dfn
22062206
escape</i></a>, <a href="#consume-an-escaped-character0"><i>consume an
22072207
escaped character</i></a>. Create a dimension token with its
22082208
representation set to the number token's representation, its value set to
2209-
the number token's value, and a unit initially set to the returned
2210-
character. Switch to the <a href="#dimension-state0"><i>dimension
2211-
state</i></a>.
2209+
the number token's value, its type flag set to the number token's type
2210+
flag, and a unit initially set to the returned character. Switch to the
2211+
<a href="#dimension-state0"><i>dimension state</i></a>.
22122212
<p> Otherwise, emit the number token. Switch to the <a
22132213
href="#data-state0"><i>data state</i></a>. <a
22142214
href="#reconsume-the-current-input-character"><i>Reconsume the current

css-syntax/Overview.src.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ <h2>
446446
Additionally, hash tokens have a type flag set to either "id" or "unrestricted". The type flag defaults to "unrestricted" if not otherwise set.
447447
Delim tokens have a value composed of a single character.
448448
Number, percentage, and dimension tokens have a representation composed of 1 or more character, and a numeric value.
449-
Number tokens additionally have a type flag set to either "integer" or "number". The type flag defaults to "integer" if not otherwise set.
449+
Number and dimension tokens additionally have a type flag set to either "integer" or "number". The type flag defaults to "integer" if not otherwise set.
450450
Dimension tokens additionally have a unit composed of one or more characters.
451451
Unicode-range tokens have a range of characters.
452452

@@ -1370,13 +1370,8 @@ <h4>
13701370

13711371
<p>
13721372
Otherwise,
1373-
create a dimension token
1374-
with its representation set to the number token's representation,
1375-
its value set to the number
1376-
produced by interpreting the number token's representation
1377-
as a base-10 number,
1378-
and its unit initially set to the <i>current input character</i>.
1379-
Switch to the <i>dimension state</i>.
1373+
switch to the <i>number-end state</i>.
1374+
<i>Reconsume the current input character</i>.
13801375

13811376
<dt>anything else
13821377
<dd>
@@ -1434,6 +1429,7 @@ <h4>
14341429
create a dimension token
14351430
with its representation set to the number token's representation,
14361431
its value set to the number token's value,
1432+
its type flag set to the number token's type flag,
14371433
and a unit initially set to the <i>current input character</i>.
14381434
Switch to the <i>dimension state</i>.
14391435

@@ -1448,6 +1444,7 @@ <h4>
14481444
Create a dimension token
14491445
with its representation set to the number token's representation,
14501446
its value set to the number token's value,
1447+
its type flag set to the number token's type flag,
14511448
and a unit initially set to the <i>current input character</i>.
14521449
Switch to the <i>dimension state</i>.
14531450

@@ -1458,6 +1455,7 @@ <h4>
14581455
Create a dimension token
14591456
with its representation set to the number token's representation,
14601457
its value set to the number token's value,
1458+
its type flag set to the number token's type flag,
14611459
and a unit initially set to the returned character.
14621460
Switch to the <i>dimension state</i>.
14631461

0 commit comments

Comments
 (0)