 .../Asset/AssetOptimizationTest.php                | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/core/tests/Drupal/FunctionalTests/Asset/AssetOptimizationTest.php b/core/tests/Drupal/FunctionalTests/Asset/AssetOptimizationTest.php
index 4833797796..df18a9c9a8 100644
--- a/core/tests/Drupal/FunctionalTests/Asset/AssetOptimizationTest.php
+++ b/core/tests/Drupal/FunctionalTests/Asset/AssetOptimizationTest.php
@@ -278,4 +278,30 @@ protected function invalidExclude(string $url): string {
     return $this->getAbsoluteUrl($parts['path'] . '?' . $query . '#' . $parts['fragment']);
   }
 
+  /**
+   * Regression?
+   */
+  public function testRootRelativeUrlsInAggregates() {
+    $this->config('system.performance')->set('css', [
+      'preprocess' => TRUE,
+      'gzip' => TRUE,
+    ])->save();
+    $this->rebuildAll();
+
+    $this->drupalGet('<front>');
+
+    // Find the first stylesheet and assert it is an aggregate.
+    $href = $this->cssSelect('link[rel=stylesheet]')[0]->getAttribute('href');
+    $regexp = '#^' . base_path() . $this->siteDirectory . '/files/css/css_[a-zA-Z0-9_-]{43}\.css#';
+    $this->assertMatchesRegularExpression($regexp, $href);
+
+    // Fetch the first aggregate and assert it references images using
+    // root-relative URLs.
+    $css = $this->drupalGet($this->baseUrl . $href);
+    // CSS references other files.
+    $this->assertStringContainsString('url(', $css);
+    // CSS references other files by root-relative URL.
+    $this->assertStringContainsString('url(' . base_path() . 'core/misc/tree.png)', $css);
+  }
+
 }
