diff --git a/core/lib/Drupal/Core/Asset/CssOptimizer.php b/core/lib/Drupal/Core/Asset/CssOptimizer.php index ab0f2f9..858cc5f 100644 --- a/core/lib/Drupal/Core/Asset/CssOptimizer.php +++ b/core/lib/Drupal/Core/Asset/CssOptimizer.php @@ -61,6 +61,8 @@ public function clean($contents) { protected function processFile($css_asset) { $contents = $this->loadFile($css_asset['data'], TRUE); + $contents = $this->clean($contents); + // Get the parent directory of this file, relative to the Drupal root. $css_base_path = substr($css_asset['data'], 0, strrpos($css_asset['data'], '/')); // Store base path. @@ -177,7 +179,7 @@ protected function loadNestedFile($matches) { */ protected function processCss($contents, $optimize = FALSE) { // Remove unwanted CSS code that cause issues. - $this->clean($contents); + $contents = $this->clean($contents); if ($optimize) { // Perform some safe CSS optimizations. diff --git a/core/tests/Drupal/Tests/Core/Asset/css_test_files/charset_newline.css b/core/tests/Drupal/Tests/Core/Asset/css_test_files/charset_newline.css index 68f3f42..21aacf2 100644 --- a/core/tests/Drupal/Tests/Core/Asset/css_test_files/charset_newline.css +++ b/core/tests/Drupal/Tests/Core/Asset/css_test_files/charset_newline.css @@ -1,2 +1,2 @@ -@charset 'UTF-8'; +@charset "UTF-8"; html{font-family:"sans-serif";} diff --git a/core/tests/Drupal/Tests/Core/Asset/css_test_files/charset_sameline.css.optimized.css b/core/tests/Drupal/Tests/Core/Asset/css_test_files/charset_sameline.css.optimized.css deleted file mode 100644 index c9e6ade..0000000 --- a/core/tests/Drupal/Tests/Core/Asset/css_test_files/charset_sameline.css.optimized.css +++ /dev/null @@ -1 +0,0 @@ -html{font-family:"sans-serif";}