Project

General

Profile

Actions

Bug #60675

closed

CSS compressor is removing white spaces (font directive)

Added by Nico Niebergall over 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Must have
Category:
Content Rendering
Target version:
Start date:
2014-07-30
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
hard
Is Regression:
No
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #63974: CSS concatination and compression failes with fontClosed2014-12-18

Actions
Actions #1

Updated by Markus Klein over 9 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.

Actions #2

Updated by Gerrit Code Review over 9 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

Actions #3

Updated by Jigal van Hemert over 9 years ago

  • Status changed from Under Review to Accepted
  • Assignee set to Jigal van Hemert
Actions #4

Updated by Jigal van Hemert over 9 years ago

  • Status changed from Accepted to Under Review
Actions #5

Updated by Gerrit Code Review over 9 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

Actions #6

Updated by Gerrit Code Review over 9 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

Actions #7

Updated by Gerrit Code Review over 9 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

Actions #8

Updated by Gerrit Code Review over 9 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

Actions #9

Updated by Mathias Schreiber over 9 years ago

  • Target version changed from next-patchlevel to 7.2 (Frontend)
Actions #10

Updated by Riccardo De Contardi almost 9 years ago

  • Status changed from Under Review to Closed

Please continue the disussion on #63974

Actions

Also available in: Atom PDF