Project

General

Profile

Actions

Bug #91071

closed

Inline CSS automatically disable "Comments and whitespace" compression

Added by Timo Poppinga over 4 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Start date:
2020-04-16
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If an CSS files in marked as inline the compression is automatically disabled this effects "comments and whitespace" and "gzip" compression.

This behevior works fine for "gzip" compression.

"Comments and whitespace" compression should not be automatically disbaled


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #90820: CSS/JS compression problem if css is used inlineClosed2020-03-23

Actions
Actions #1

Updated by Timo Poppinga over 4 years ago

  • Related to Task #63884: Remove dependency to $this->formEngine->getIconHtml() added
Actions #2

Updated by Timo Poppinga over 4 years ago

  • Related to deleted (Task #63884: Remove dependency to $this->formEngine->getIconHtml())
Actions #3

Updated by Timo Poppinga over 4 years ago

  • Related to Bug #90820: CSS/JS compression problem if css is used inline added
Actions #4

Updated by Timo Poppinga over 4 years ago

btw: this also effects the fix of relative url paths:

TYPO3\CMS\Core\Resource\ResourceCompressor Line 356

        if (!file_exists(Environment::getPublicPath() . '/' . $targetFile) || $this->createGzipped && !file_exists(Environment::getPublicPath() . '/' . $targetFile . '.gzip')) {
            $contents = $this->compressCssString(file_get_contents($filenameAbsolute));
            if (strpos($filename, $this->targetDirectory) === false) {
                $contents = $this->cssFixRelativeUrlPaths($contents, PathUtility::dirname($filename) . '/');
            }
            $this->writeFileAndCompressed($targetFile, $contents);
        }
        return $this->returnFileReference($targetFile);

this was an side effect of compression but comes in really handy for inline css.

To fix this issue some more refactoring is necessary because TYPO3 dose not difference between gzip and whitespace compression this is done one process flow.

As well there should be an option to run cssFixRelativeUrlPaths without compression.

Actions #5

Updated by Christian Eßl over 4 years ago

  • Target version changed from 10 LTS to Candidate for patchlevel
  • TYPO3 Version changed from 10 to 9
Actions #6

Updated by Riccardo De Contardi almost 4 years ago

  • Category set to Frontend
Actions #7

Updated by Garvin Hicking 4 months ago

  • Status changed from New to Closed

Following along the reason to close #75127 I would like to ask if you agree that we could close this issue, too.

Todays recommendation is to try to not rely on compression/concatenation through these TypoScript options, but either use distinct bundlers or rely on HTTP/2 multiplexing. There are several edge-case scenarios at play here, which did not really gain traction to be fixed in the many years now, so it's unlikely moving forward this would change. Especially white-space removal mentioned here (minifying) is something that bundlers can address much more safely and specifically and should maybe not be done "on-the-fly" as in the past.

I hope you can understand the reasoning of this and an team discussion about this and agree. If not, please let me know and we'll see how to proceed with this. :-)

Actions

Also available in: Atom PDF