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

Should parsing dimension values allow decimals with no digits before '.'? #4726

Closed
bzbarsky opened this issue Jun 20, 2019 · 5 comments · Fixed by #4747
Closed

Should parsing dimension values allow decimals with no digits before '.'? #4726

bzbarsky opened this issue Jun 20, 2019 · 5 comments · Fixed by #4747

Comments

@bzbarsky
Copy link
Contributor

Per https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#rules-for-parsing-dimension-values something like:

<img src="whatever" width=".5%">

should be a parse error at step 7. Both Chrome and Safari allow it, though.

@annevk

@annevk
Copy link
Member

annevk commented Jun 28, 2019

Perhaps we should fix this together with #4720.

@bzbarsky
Copy link
Contributor Author

Works for me.

annevk added a commit that referenced this issue Jul 1, 2019
In particular:

* Disallow a leading +. Fixes #4720.
* Allow a leading dot. Fixes #4726.
* Allow a trailing dot (in particular before %). Fixes #4736.
@bzbarsky
Copy link
Contributor Author

bzbarsky commented Jul 1, 2019

Hmm. I just retested this again, and it looks like Chrome does not allow ".5"? Safari does, though.

Given that, I'm not sure we should make this change...

@annevk
Copy link
Member

annevk commented Jul 2, 2019

Oh yeah, I wonder how I missed that. And it's the same on stable so it's not like this was changed overnight. Let's not adopt this part and file a bug against Safari instead.

@annevk
Copy link
Member

annevk commented Jul 2, 2019

Closing this as WONTFIX.

@annevk annevk closed this as completed Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants