Skip to content

[css-syntax-3] <percentage-token> type flag is never set #5483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Fayti1703 opened this issue Aug 28, 2020 · 4 comments
Closed

[css-syntax-3] <percentage-token> type flag is never set #5483

Fayti1703 opened this issue Aug 28, 2020 · 4 comments
Labels
css-syntax-3 Needs Edits Testing Unnecessary Memory aid - issue doesn't require tests

Comments

@Fayti1703
Copy link
Contributor

Fayti1703 commented Aug 28, 2020

Tokenization defines the type flag on three tokens -- <number-token>, <percentage-token> and <dimension-token>, and assigns it a default value of "integer".

Consume a numeric token specifically sets the type flag on <number-token>s and <dimension-token>s to the one in the number returned from Consume a number, using the wording

create a <xxx-token> with the same value and type flag as number

However, this type flag isn't assigned for <percentage-token>s, as that just says

create a <percentage-token> with the same value as number, and return it.

A strict reading of the spec suggests that therefore, a <percentage-token> always has a type of "integer", even if it's value is, for instance, 50.90, which seems wrong.

@tabatkins
Copy link
Member

Huh, that's a clear mistake. Thanks for the catch!

@tabatkins tabatkins added Closed Accepted as Obvious Bugfix Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-syntax-3 Testing Unnecessary Memory aid - issue doesn't require tests labels Aug 28, 2020
@triple-underscore
Copy link

I don't think it was a mistake, because the type flag is not defined for <percentage-token>.
The spec states in section 4:

<number-token>, <percentage-token>, and <dimension-token> have a numeric value. <number-token> and <dimension-token> additionally have a type flag set to either "integer" or "number". The type flag defaults to "integer" if not otherwise set. <dimension-token> additionally have a unit composed of one or more code points.

(and there is no such kind of things defined for <percentage-token> anywhere else.)

@tabatkins
Copy link
Member

Ah, you're right! Dang it, I thought it was weird I had such an obvious error! Okay, I'll revert, but put a note into the source to remind myself in the future.

@tabatkins tabatkins reopened this Sep 4, 2020
@fantasai fantasai added Needs Edits and removed Closed Accepted as Obvious Bugfix Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. labels Sep 16, 2020
@fantasai fantasai added this to the CSS Syntax 3 January 2021 CR milestone Dec 17, 2021
@fantasai
Copy link
Collaborator

Reverted the text; leaving this open for Tab to add his note later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-syntax-3 Needs Edits Testing Unnecessary Memory aid - issue doesn't require tests
Projects
None yet
Development

No branches or pull requests

4 participants