CSS: Don’t trim whitespace of undefined custom property#5106
CSS: Don’t trim whitespace of undefined custom property#5106mgol merged 1 commit intojquery:mainfrom
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.
Just one comment, otherwise it looks good to me. Thanks!
df326d9 to
92540d3
Compare
92540d3 to
4fb461c
Compare
|
This is a cross-browser difference with I’ve changed the test to |
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