-
Notifications
You must be signed in to change notification settings - Fork 20.5k
CSS: Don’t trim whitespace of undefined custom property #5106
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
Conversation
|
|
1d8ec8d to
df326d9
Compare
|
Thanks for the PR with a test! We’ll discuss what approach we want to take here and we’ll get back to you. |
mgol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment, otherwise it looks good to me. Thanks!
df326d9 to
92540d3
Compare
mgol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
92540d3 to
4fb461c
Compare
|
This is a cross-browser difference with I’ve changed the test to |
mgol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks! I'll need to ask you to rebase the PR once #5107 lands so that the build is green here. Other than that, LGTM.
Fixes jquerygh-5105 Signed-off-by: Anders Kaseorg <andersk@mit.edu>
4fb461c to
ee6718a
Compare
|
Rebased. |
Fixes jquerygh-5105 Closes jquerygh-5106 Signed-off-by: Anders Kaseorg <andersk@mit.edu> (cherry picked from commit ed306c0)
|
Backported to |
The spec requires that CSS variable values are trimmed. In browsers that do this - mainly, Safari, but also Firefox if the value only has leading whitespace - we currently return `undefined`; in other browsers, we return an empty string as the logic to fall back to `undefined` happens before trimming. This commit adds another explicit callback to `undefined`. Also, more explicit comments about behaviors we need to work around in various browsers have been added. Ref jquerygh-5106
I submitted #5120 to handle this case. |
The spec requires that CSS variable values are trimmed. In browsers that do this - mainly, Safari, but also Firefox if the value only has leading whitespace - we currently return `undefined`; in other browsers, we return an empty string as the logic to fall back to `undefined` happens before trimming. This commit adds another explicit callback to `undefined` to have it consistent across browsers. Also, more explicit comments about behaviors we need to work around in various browsers have been added. Ref jquerygh-5106
The spec requires that CSS variable values are trimmed. In browsers that do this - mainly, Safari, but also Firefox if the value only has leading whitespace - we currently return undefined; in other browsers, we return an empty string as the logic to fall back to undefined happens before trimming. This commit adds another explicit callback to `undefined` to have it consistent across browsers. Also, more explicit comments about behaviors we need to work around in various browsers have been added. Closes gh-5120 Ref gh-5106
The spec requires that CSS variable values are trimmed. In browsers that do this - mainly, Safari, but also Firefox if the value only has leading whitespace - we currently return undefined; in other browsers, we return an empty string as the logic to fall back to undefined happens before trimming. This commit adds another explicit callback to `undefined` to have it consistent across browsers. Also, more explicit comments about behaviors we need to work around in various browsers have been added. Closes gh-5120 Ref gh-5106 (cherry picked from commit 7eb0019)
Summary
Fixes gh-5105
Checklist