Bug #60675
closedCSS compressor is removing white spaces (font directive)
0%
Description
Today I noticed the internal CSS compressor is removing white spaces between the font size and the font family. Of course the white space should stay there. Some browsers will still render the font family correct, some other's dont, but the CSS syntax is clearly wrong without the white space.
The white space is removed when you use a font-family surrounded with quotation marks, and only in this particular case. If you remove the quotation marks the white space won't get removed. According to the W3C the apostrophes are needed for strings with white spaces, as stated here: 4.3.7 Strings
This is a snippet of the code where I was facing this symptom:
Before minifying
body { font: 0.875em "Open Sans", Arial, Helvetica, sans-serif; line-height: 2em; }
After minifying
body{font:0.875em"Open Sans",Arial,Helvetica,sans-serif;line-height:2em}
It doesn't matter if you use a single quotation or a double quotation mark, the white space is removed as soon as you surround the font-face with (single or double) quotation marks. Is this a bug?
Kind regards,
Nico
Updated by Markus Klein over 10 years ago
- Category changed from Miscellaneous to Content Rendering
- Status changed from New to Accepted
- Priority changed from Should have to Must have
- Target version set to next-patchlevel
- Complexity changed from medium to hard
Yes it is! Thanks for reporting.
The problem seems to be in ResourceCompressor::compressCssFile().
Unfortunately there are no unit tests.
Updated by Gerrit Code Review over 10 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31954
Updated by Jigal van Hemert over 10 years ago
- Status changed from Under Review to Accepted
- Assignee set to Jigal van Hemert
Updated by Jigal van Hemert over 10 years ago
- Status changed from Accepted to Under Review
Updated by Gerrit Code Review over 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31954
Updated by Gerrit Code Review over 10 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32303
Updated by Gerrit Code Review over 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31954
Updated by Gerrit Code Review over 10 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/31954
Updated by Mathias Schreiber almost 10 years ago
- Target version changed from next-patchlevel to 7.2 (Frontend)
Updated by Riccardo De Contardi over 9 years ago
- Status changed from Under Review to Closed
Please continue the disussion on #63974