Skip to content
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

[css-typed-om] CSSNumericValue.parse() needs type checking for <dimension-token> #1064

Closed
xiaochengh opened this issue Jan 27, 2022 · 0 comments · Fixed by #1065
Closed

[css-typed-om] CSSNumericValue.parse() needs type checking for <dimension-token> #1064

xiaochengh opened this issue Jan 27, 2022 · 0 comments · Fixed by #1065

Comments

@xiaochengh
Copy link
Contributor

According to the spec, as long as the given string can be parsed into a <dimension-token>, the return value is the reification of the token. And reification doesn't have type checking, either.

So CSSNumericValue.parse('1xyz') should return something non-null, which doesn't make sense, and is inconsistent with the CSSUnitValue(value, type) constructor, which throws when the type is invalid.

I think we should throw a SyntaxError when the unit is invalid. I'll put up a PR to fix it.

xiaochengh added a commit to xiaochengh/css-houdini-drafts that referenced this issue Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant