From 7a6602c86322e0c3ee4522f5a8289f843f110b90 Mon Sep 17 00:00:00 2001
From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org>
Date: Fri, 21 Aug 2015 15:03:56 +0100
Subject: [PATCH] Issue #977844 by Wim Leers: Remove the 'every_page' option
 for CSS/JS assets: it is confusing, even damaging

---
 core/core.libraries.yml                       |  6 +-
 core/includes/common.inc                      |  1 -
 core/lib/Drupal/Core/Asset/AssetResolver.php  | 13 ---
 .../Core/Asset/CssCollectionGrouper.php       |  5 +-
 .../Core/Asset/CssCollectionRenderer.php      | 10 +--
 .../Drupal/Core/Asset/JsCollectionGrouper.php |  5 +-
 core/modules/system/system.libraries.yml      | 84 ++++++++---------
 .../Asset/CssCollectionGrouperUnitTest.php    | 90 ++++++++-----------
 .../Asset/CssCollectionRendererUnitTest.php   | 12 +--
 .../Tests/Core/Asset/CssOptimizerUnitTest.php | 12 ---
 10 files changed, 95 insertions(+), 143 deletions(-)

diff --git a/core/core.libraries.yml b/core/core.libraries.yml
index 179382bf0c93..e539dc7468c4 100644
--- a/core/core.libraries.yml
+++ b/core/core.libraries.yml
@@ -332,7 +332,7 @@ html5shiv:
     url: http://www.gnu.org/licenses/gpl-2.0.html
     gpl-compatible: true
   js:
-    assets/vendor/html5shiv/html5shiv.min.js: { every_page: true, weight: -22, browsers: { IE: 'lte IE 8', '!IE': false }, minified: true }
+    assets/vendor/html5shiv/html5shiv.min.js: { weight: -22, browsers: { IE: 'lte IE 8', '!IE': false }, minified: true }
 
 jquery:
   remote: https://github.com/jquery/jquery
@@ -826,7 +826,7 @@ modernizr:
     gpl-compatible: true
   version: "v2.8.3"
   js:
-    assets/vendor/modernizr/modernizr.min.js: { every_page: true, preprocess: 0, weight: -21, minified: true }
+    assets/vendor/modernizr/modernizr.min.js: { preprocess: 0, weight: -21, minified: true }
 
 normalize:
   remote: https://github.com/necolas/normalize.css
@@ -837,7 +837,7 @@ normalize:
     gpl-compatible: true
   css:
     base:
-      assets/vendor/normalize-css/normalize.css: { every_page: true, weight: -20 }
+      assets/vendor/normalize-css/normalize.css: { weight: -20 }
 
 picturefill:
   remote: https://github.com/scottjehl/picturefill
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 7e86eb251496..85d5f3a1c3bc 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -521,7 +521,6 @@ function drupal_js_defaults($data = NULL) {
   return array(
     'type' => 'file',
     'group' => JS_DEFAULT,
-    'every_page' => FALSE,
     'weight' => 0,
     'scope' => 'header',
     'cache' => TRUE,
diff --git a/core/lib/Drupal/Core/Asset/AssetResolver.php b/core/lib/Drupal/Core/Asset/AssetResolver.php
index 2c483c0372be..6186d2a6a9d4 100644
--- a/core/lib/Drupal/Core/Asset/AssetResolver.php
+++ b/core/lib/Drupal/Core/Asset/AssetResolver.php
@@ -127,7 +127,6 @@ public function getCssAssets(AttachedAssetsInterface $assets, $optimize) {
       'type' => 'file',
       'group' => CSS_AGGREGATE_DEFAULT,
       'weight' => 0,
-      'every_page' => FALSE,
       'media' => 'all',
       'preprocess' => TRUE,
       'browsers' => [],
@@ -231,7 +230,6 @@ public function getJsAssets(AttachedAssetsInterface $assets, $optimize) {
       $default_options = [
         'type' => 'file',
         'group' => JS_DEFAULT,
-        'every_page' => FALSE,
         'weight' => 0,
         'cache' => TRUE,
         'preprocess' => TRUE,
@@ -338,7 +336,6 @@ public function getJsAssets(AttachedAssetsInterface $assets, $optimize) {
       $settings_as_inline_javascript = [
         'type' => 'setting',
         'group' => JS_SETTING,
-        'every_page' => TRUE,
         'weight' => 0,
         'browsers' => [],
         'data' => $settings,
@@ -384,16 +381,6 @@ public static function sort($a, $b) {
     elseif ($a['group'] > $b['group']) {
       return 1;
     }
-    // Within a group, order all infrequently needed, page-specific files after
-    // common files needed throughout the website. Separating this way allows
-    // for the aggregate file generated for all of the common files to be reused
-    // across a site visit without being cut by a page using a less common file.
-    elseif ($a['every_page'] && !$b['every_page']) {
-      return -1;
-    }
-    elseif (!$a['every_page'] && $b['every_page']) {
-      return 1;
-    }
     // Finally, order by weight.
     elseif ($a['weight'] < $b['weight']) {
       return -1;
diff --git a/core/lib/Drupal/Core/Asset/CssCollectionGrouper.php b/core/lib/Drupal/Core/Asset/CssCollectionGrouper.php
index 075246d5325f..0a751e13ccd0 100644
--- a/core/lib/Drupal/Core/Asset/CssCollectionGrouper.php
+++ b/core/lib/Drupal/Core/Asset/CssCollectionGrouper.php
@@ -58,9 +58,8 @@ public function group(array $css_assets) {
         case 'file':
           // Group file items if their 'preprocess' flag is TRUE.
           // Help ensure maximum reuse of aggregate files by only grouping
-          // together items that share the same 'group' value and 'every_page'
-          // flag.
-          $group_keys = $item['preprocess'] ? array($item['type'], $item['group'], $item['every_page'], $item['media'], $item['browsers']) : FALSE;
+          // together items that share the same 'group' value.
+          $group_keys = $item['preprocess'] ? array($item['type'], $item['group'], $item['media'], $item['browsers']) : FALSE;
           break;
 
         case 'inline':
diff --git a/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php b/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php
index 6ef6be3d9646..99d8f11a82bd 100644
--- a/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php
+++ b/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php
@@ -103,7 +103,7 @@ public function render(array $css_assets) {
     // For filthy IE hack.
     $current_ie_group_keys = NULL;
     $get_ie_group_key = function ($css_asset) {
-      return array($css_asset['type'], $css_asset['preprocess'], $css_asset['group'], $css_asset['every_page'], $css_asset['media'], $css_asset['browsers']);
+      return array($css_asset['type'], $css_asset['preprocess'], $css_asset['group'], $css_asset['media'], $css_asset['browsers']);
     };
 
     // Loop through all CSS assets, by key, to allow for the special IE
@@ -123,9 +123,9 @@ public function render(array $css_assets) {
         //      LINK tag.
         //    - file CSS assets that can be aggregated (and possibly have been):
         //      in this case, figure out which subsequent file CSS assets share
-        //      the same key properties ('group', 'every_page', 'media' and
-        //      'browsers') and output this group into as few STYLE tags as
-        //      possible (a STYLE tag may contain only 31 @import statements).
+        //      the same key properties ('group', 'media' and 'browsers') and
+        //      output this group into as few STYLE tags as possible (a STYLE
+        //      tag may contain only 31 @import statements).
         case 'file':
           // The dummy query string needs to be added to the URL to control
           // browser-caching.
@@ -159,7 +159,7 @@ public function render(array $css_assets) {
               $import = array();
               // Start with the current CSS asset, iterate over subsequent CSS
               // assets and find which ones have the same 'type', 'group',
-              // 'every_page', 'preprocess', 'media' and 'browsers' properties.
+              // 'preprocess', 'media' and 'browsers' properties.
               $j = $i;
               $next_css_asset = $css_asset;
               $current_ie_group_key = $get_ie_group_key($css_asset);
diff --git a/core/lib/Drupal/Core/Asset/JsCollectionGrouper.php b/core/lib/Drupal/Core/Asset/JsCollectionGrouper.php
index 41e0dac40940..f23cf7759c19 100644
--- a/core/lib/Drupal/Core/Asset/JsCollectionGrouper.php
+++ b/core/lib/Drupal/Core/Asset/JsCollectionGrouper.php
@@ -45,9 +45,8 @@ public function group(array $js_assets) {
         case 'file':
           // Group file items if their 'preprocess' flag is TRUE.
           // Help ensure maximum reuse of aggregate files by only grouping
-          // together items that share the same 'group' value and 'every_page'
-          // flag.
-          $group_keys = $item['preprocess'] ? array($item['type'], $item['group'], $item['every_page'], $item['browsers']) : FALSE;
+          // together items that share the same 'group' value.
+          $group_keys = $item['preprocess'] ? array($item['type'], $item['group'], $item['browsers']) : FALSE;
           break;
 
         case 'external':
diff --git a/core/modules/system/system.libraries.yml b/core/modules/system/system.libraries.yml
index 0efb156af626..7c5e178d8cc0 100644
--- a/core/modules/system/system.libraries.yml
+++ b/core/modules/system/system.libraries.yml
@@ -3,49 +3,49 @@ base:
   css:
     # Adjust the weights to load these early.
     component:
-      css/components/ajax-progress.module.css: { every_page: true, weight: -10 }
-      css/components/align.module.css: { every_page: true, weight: -10 }
-      css/components/autocomplete-loading.module.css: { every_page: true, weight: -10 }
-      css/components/fieldgroup.module.css: { every_page: true, weight: -10 }
-      css/components/container-inline.module.css: { every_page: true, weight: -10 }
-      css/components/clearfix.module.css: { every_page: true, weight: -10 }
-      css/components/details.module.css: { every_page: true, weight: -10 }
-      css/components/hidden.module.css: { every_page: true, weight: -10 }
-      css/components/js.module.css: { every_page: true, weight: -10 }
-      css/components/nowrap.module.css: { every_page: true, weight: -10 }
-      css/components/position-container.module.css: { every_page: true, weight: -10 }
-      css/components/progress.module.css: { every_page: true, weight: -10 }
-      css/components/reset-appearance.module.css: { every_page: true, weight: -10 }
-      css/components/resize.module.css: { every_page: true, weight: -10 }
-      css/components/sticky-header.module.css: { every_page: true, weight: -10 }
-      css/components/tabledrag.module.css: { every_page: true, weight: -10 }
+      css/components/ajax-progress.module.css: { weight: -10 }
+      css/components/align.module.css: { weight: -10 }
+      css/components/autocomplete-loading.module.css: { weight: -10 }
+      css/components/fieldgroup.module.css: { weight: -10 }
+      css/components/container-inline.module.css: { weight: -10 }
+      css/components/clearfix.module.css: { weight: -10 }
+      css/components/details.module.css: { weight: -10 }
+      css/components/hidden.module.css: { weight: -10 }
+      css/components/js.module.css: { weight: -10 }
+      css/components/nowrap.module.css: { weight: -10 }
+      css/components/position-container.module.css: { weight: -10 }
+      css/components/progress.module.css: { weight: -10 }
+      css/components/reset-appearance.module.css: { weight: -10 }
+      css/components/resize.module.css: { weight: -10 }
+      css/components/sticky-header.module.css: { weight: -10 }
+      css/components/tabledrag.module.css: { weight: -10 }
     theme:
-      css/components/action-links.theme.css: { every_page: true, weight: -10 }
-      css/components/breadcrumb.theme.css: { every_page: true, weight: -10 }
-      css/components/button.theme.css: { every_page: true, weight: -10 }
-      css/components/collapse-processed.theme.css: { every_page: true, weight: -10 }
-      css/components/container-inline.theme.css: { every_page: true, weight: -10 }
-      css/components/details.theme.css: { every_page: true, weight: -10 }
-      css/components/exposed-filters.theme.css: { every_page: true, weight: -10 }
-      css/components/field.theme.css: { every_page: true, weight: -10 }
-      css/components/form.theme.css: { every_page: true, weight: -10 }
-      css/components/icons.theme.css: { every_page: true, weight: -10 }
-      css/components/inline-form.theme.css: { every_page: true, weight: -10 }
-      css/components/item-list.theme.css: { every_page: true, weight: -10 }
-      css/components/link.theme.css: { every_page: true, weight: -10 }
-      css/components/links.theme.css: { every_page: true, weight: -10 }
-      css/components/menu.theme.css: { every_page: true, weight: -10 }
-      css/components/messages.theme.css: { every_page: true, weight: -10 }
-      css/components/more-link.theme.css: { every_page: true, weight: -10 }
-      css/components/node.theme.css: { every_page: true, weight: -10 }
-      css/components/pager.theme.css: { every_page: true, weight: -10 }
-      css/components/progress.theme.css: { every_page: true, weight: -10 }
-      css/components/tableselect.theme.css: { every_page: true, weight: -10 }
-      css/components/tabledrag.theme.css: { every_page: true, weight: -10 }
-      css/components/tablesort.theme.css: { every_page: true, weight: -10 }
-      css/components/tabs.theme.css: { every_page: true, weight: -10 }
-      css/components/textarea.theme.css: { every_page: true, weight: -10 }
-      css/components/tree-child.module.css: { every_page: true, weight: -10 }
+      css/components/action-links.theme.css: { weight: -10 }
+      css/components/breadcrumb.theme.css: { weight: -10 }
+      css/components/button.theme.css: { weight: -10 }
+      css/components/collapse-processed.theme.css: { weight: -10 }
+      css/components/container-inline.theme.css: { weight: -10 }
+      css/components/details.theme.css: { weight: -10 }
+      css/components/exposed-filters.theme.css: { weight: -10 }
+      css/components/field.theme.css: { weight: -10 }
+      css/components/form.theme.css: { weight: -10 }
+      css/components/icons.theme.css: { weight: -10 }
+      css/components/inline-form.theme.css: { weight: -10 }
+      css/components/item-list.theme.css: { weight: -10 }
+      css/components/link.theme.css: { weight: -10 }
+      css/components/links.theme.css: { weight: -10 }
+      css/components/menu.theme.css: { weight: -10 }
+      css/components/messages.theme.css: { weight: -10 }
+      css/components/more-link.theme.css: { weight: -10 }
+      css/components/node.theme.css: { weight: -10 }
+      css/components/pager.theme.css: { weight: -10 }
+      css/components/progress.theme.css: { weight: -10 }
+      css/components/tableselect.theme.css: { weight: -10 }
+      css/components/tabledrag.theme.css: { weight: -10 }
+      css/components/tablesort.theme.css: { weight: -10 }
+      css/components/tabs.theme.css: { weight: -10 }
+      css/components/textarea.theme.css: { weight: -10 }
+      css/components/tree-child.module.css: { weight: -10 }
 
 admin:
   version: VERSION
diff --git a/core/tests/Drupal/Tests/Core/Asset/CssCollectionGrouperUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssCollectionGrouperUnitTest.php
index 30ecfe5415cc..209aa64fd61c 100644
--- a/core/tests/Drupal/Tests/Core/Asset/CssCollectionGrouperUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/CssCollectionGrouperUnitTest.php
@@ -38,7 +38,6 @@ function testGrouper() {
     $css_assets = array(
       'system.base.css' => array(
         'group' => -100,
-        'every_page' => TRUE,
         'type' => 'file',
         'weight' => 0.012,
         'media' => 'all',
@@ -49,7 +48,6 @@ function testGrouper() {
       ),
       'system.theme.css' => array(
         'group' => -100,
-        'every_page' => TRUE,
         'type' => 'file',
         'weight' => 0.013,
         'media' => 'all',
@@ -62,7 +60,6 @@ function testGrouper() {
         'group' => -100,
         'type' => 'file',
         'weight' => 0.004,
-        'every_page' => FALSE,
         'media' => 'all',
         'preprocess' => TRUE,
         'data' => 'core/misc/ui/themes/base/jquery.ui.core.css',
@@ -70,7 +67,6 @@ function testGrouper() {
         'basename' => 'jquery.ui.core.css',
       ),
       'field.css' => array(
-        'every_page' => TRUE,
         'group' => 0,
         'type' => 'file',
         'weight' => 0.011,
@@ -81,7 +77,6 @@ function testGrouper() {
         'basename' => 'field.css',
       ),
       'external.css' => array(
-        'every_page' => FALSE,
         'group' => 0,
         'type' => 'external',
         'weight' => 0.009,
@@ -93,7 +88,6 @@ function testGrouper() {
       ),
       'elements.css' => array(
         'group' => 100,
-        'every_page' => TRUE,
         'media' => 'all',
         'type' => 'file',
         'weight' => 0.001,
@@ -104,7 +98,6 @@ function testGrouper() {
       ),
       'print.css' => array(
         'group' => 100,
-        'every_page' => TRUE,
         'media' => 'print',
         'type' => 'file',
         'weight' => 0.003,
@@ -117,62 +110,53 @@ function testGrouper() {
 
     $groups = $this->grouper->group($css_assets);
 
-    $this->assertSame(count($groups), 6, "6 groups created.");
+    $this->assertSame(count($groups), 5, "5 groups created.");
 
     // Check group 1.
-    $this->assertSame($groups[0]['group'], -100);
-    $this->assertSame($groups[0]['every_page'], TRUE);
-    $this->assertSame($groups[0]['type'], 'file');
-    $this->assertSame($groups[0]['media'], 'all');
-    $this->assertSame($groups[0]['preprocess'], TRUE);
-    $this->assertSame(count($groups[0]['items']), 2);
-    $this->assertContains($css_assets['system.base.css'], $groups[0]['items']);
-    $this->assertContains($css_assets['system.theme.css'], $groups[0]['items']);
+    $group = $groups[0];
+    $this->assertSame($group['group'], -100);
+    $this->assertSame($group['type'], 'file');
+    $this->assertSame($group['media'], 'all');
+    $this->assertSame($group['preprocess'], TRUE);
+    $this->assertSame(count($group['items']), 3);
+    $this->assertContains($css_assets['system.base.css'], $group['items']);
+    $this->assertContains($css_assets['system.theme.css'], $group['items']);
 
     // Check group 2.
-    $this->assertSame($groups[1]['group'], -100);
-    $this->assertSame($groups[1]['every_page'], FALSE);
-    $this->assertSame($groups[1]['type'], 'file');
-    $this->assertSame($groups[1]['media'], 'all');
-    $this->assertSame($groups[1]['preprocess'], TRUE);
-    $this->assertSame(count($groups[1]['items']), 1);
-    $this->assertContains($css_assets['jquery.ui.core.css'], $groups[1]['items']);
+    $group = $groups[1];
+    $this->assertSame($group['group'], 0);
+    $this->assertSame($group['type'], 'file');
+    $this->assertSame($group['media'], 'all');
+    $this->assertSame($group['preprocess'], TRUE);
+    $this->assertSame(count($group['items']), 1);
+    $this->assertContains($css_assets['field.css'], $group['items']);
 
     // Check group 3.
-    $this->assertSame($groups[2]['group'], 0);
-    $this->assertSame($groups[2]['every_page'], TRUE);
-    $this->assertSame($groups[2]['type'], 'file');
-    $this->assertSame($groups[2]['media'], 'all');
-    $this->assertSame($groups[2]['preprocess'], TRUE);
-    $this->assertSame(count($groups[2]['items']), 1);
-    $this->assertContains($css_assets['field.css'], $groups[2]['items']);
+    $group = $groups[2];
+    $this->assertSame($group['group'], 0);
+    $this->assertSame($group['type'], 'external');
+    $this->assertSame($group['media'], 'all');
+    $this->assertSame($group['preprocess'], TRUE);
+    $this->assertSame(count($group['items']), 1);
+    $this->assertContains($css_assets['external.css'], $group['items']);
 
     // Check group 4.
-    $this->assertSame($groups[3]['group'], 0);
-    $this->assertSame($groups[3]['every_page'], FALSE);
-    $this->assertSame($groups[3]['type'], 'external');
-    $this->assertSame($groups[3]['media'], 'all');
-    $this->assertSame($groups[3]['preprocess'], TRUE);
-    $this->assertSame(count($groups[3]['items']), 1);
-    $this->assertContains($css_assets['external.css'], $groups[3]['items']);
+    $group = $groups[3];
+    $this->assertSame($group['group'], 100);
+    $this->assertSame($group['type'], 'file');
+    $this->assertSame($group['media'], 'all');
+    $this->assertSame($group['preprocess'], TRUE);
+    $this->assertSame(count($group['items']), 1);
+    $this->assertContains($css_assets['elements.css'], $group['items']);
 
     // Check group 5.
-    $this->assertSame($groups[4]['group'], 100);
-    $this->assertSame($groups[4]['every_page'], TRUE);
-    $this->assertSame($groups[4]['type'], 'file');
-    $this->assertSame($groups[4]['media'], 'all');
-    $this->assertSame($groups[4]['preprocess'], TRUE);
-    $this->assertSame(count($groups[4]['items']), 1);
-    $this->assertContains($css_assets['elements.css'], $groups[4]['items']);
-
-    // Check group 6.
-    $this->assertSame($groups[5]['group'], 100);
-    $this->assertSame($groups[5]['every_page'], TRUE);
-    $this->assertSame($groups[5]['type'], 'file');
-    $this->assertSame($groups[5]['media'], 'print');
-    $this->assertSame($groups[5]['preprocess'], TRUE);
-    $this->assertSame(count($groups[5]['items']), 1);
-    $this->assertContains($css_assets['print.css'], $groups[5]['items']);
+    $group = $groups[4];
+    $this->assertSame($group['group'], 100);
+    $this->assertSame($group['type'], 'file');
+    $this->assertSame($group['media'], 'print');
+    $this->assertSame($group['preprocess'], TRUE);
+    $this->assertSame(count($group['items']), 1);
+    $this->assertContains($css_assets['print.css'], $group['items']);
   }
 
 }
diff --git a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
index 8800e76cb27b..eab4fe4cd8b9 100644
--- a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
@@ -71,7 +71,6 @@ protected function setUp() {
     $this->renderer = new CssCollectionRenderer($this->state);
     $this->fileCssGroup = array(
       'group' => -100,
-      'every_page' => TRUE,
       'type' => 'file',
       'media' => 'all',
       'preprocess' => TRUE,
@@ -79,7 +78,6 @@ protected function setUp() {
       'items' => array(
         0 => array(
           'group' => -100,
-          'every_page' => TRUE,
           'type' => 'file',
           'weight' => 0.012,
           'media' => 'all',
@@ -90,7 +88,6 @@ protected function setUp() {
         ),
         1 => array(
           'group' => -100,
-          'every_page' => TRUE,
           'type' => 'file',
           'weight' => 0.013,
           'media' => 'all',
@@ -135,7 +132,7 @@ function providerTestRender() {
     };
 
     $create_file_css_asset = function($data, $media = 'all', $preprocess = TRUE) {
-      return array('group' => 0, 'every_page' => FALSE, 'type' => 'file', 'media' => $media, 'preprocess' => $preprocess, 'data' => $data, 'browsers' => array());
+      return array('group' => 0, 'type' => 'file', 'media' => $media, 'preprocess' => $preprocess, 'data' => $data, 'browsers' => array());
     };
 
     return array(
@@ -143,7 +140,7 @@ function providerTestRender() {
       0 => array(
         // CSS assets.
         array(
-          0 => array('group' => 0, 'every_page' => TRUE, 'type' => 'external', 'media' => 'all', 'preprocess' => TRUE, 'data' => 'http://example.com/popular.js', 'browsers' => array()),
+          0 => array('group' => 0, 'type' => 'external', 'media' => 'all', 'preprocess' => TRUE, 'data' => 'http://example.com/popular.js', 'browsers' => array()),
         ),
         // Render elements.
         array(
@@ -153,10 +150,10 @@ function providerTestRender() {
       // Single file CSS asset.
       2 => array(
         array(
-          0 => array('group' => 0, 'every_page' => TRUE, 'type' => 'file', 'media' => 'all', 'preprocess' => TRUE, 'data' => 'public://css/file-every_page-all', 'browsers' => array()),
+          0 => array('group' => 0, 'type' => 'file', 'media' => 'all', 'preprocess' => TRUE, 'data' => 'public://css/file-all', 'browsers' => array()),
         ),
         array(
-          0 => $create_link_element(file_create_url('public://css/file-every_page-all') . '?0', 'all'),
+          0 => $create_link_element(file_create_url('public://css/file-all') . '?0', 'all'),
         ),
       ),
       // 31 file CSS assets: expect 31 link elements.
@@ -490,7 +487,6 @@ function testRenderInvalidType() {
 
     $css_group = array(
       'group' => 0,
-      'every_page' => TRUE,
       'type' => 'internal',
       'media' => 'all',
       'preprocess' => TRUE,
diff --git a/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php
index d5513c53bbf8..03bb980f32cc 100644
--- a/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php
@@ -74,7 +74,6 @@ function providerTestOptimize() {
       array(
         array(
           'group' => -100,
-          'every_page' => TRUE,
           'type' => 'file',
           'weight' => 0.012,
           'media' => 'all',
@@ -95,7 +94,6 @@ function providerTestOptimize() {
       array(
         array(
           'group' => -100,
-          'every_page' => TRUE,
           'type' => 'file',
           'weight' => 0.013,
           'media' => 'all',
@@ -111,7 +109,6 @@ function providerTestOptimize() {
       array(
         array(
           'group' => -100,
-          'every_page' => TRUE,
           'type' => 'file',
           'weight' => 0.013,
           'media' => 'all',
@@ -129,7 +126,6 @@ function providerTestOptimize() {
       array(
         array(
           'group' => -100,
-          'every_page' => TRUE,
           'type' => 'file',
           'weight' => 0.013,
           'media' => 'all',
@@ -146,7 +142,6 @@ function providerTestOptimize() {
       array(
         array(
           'group' => -100,
-          'every_page' => TRUE,
           'type' => 'file',
           'weight' => 0.013,
           'media' => 'all',
@@ -160,7 +155,6 @@ function providerTestOptimize() {
       array(
         array(
           'group' => -100,
-          'every_page' => TRUE,
           'type' => 'file',
           'weight' => 0.013,
           'media' => 'all',
@@ -174,7 +168,6 @@ function providerTestOptimize() {
       array(
         array(
           'group' => -100,
-          'every_page' => TRUE,
           'type' => 'file',
           'weight' => 0.013,
           'media' => 'all',
@@ -188,7 +181,6 @@ function providerTestOptimize() {
       array(
         array(
           'group' => -100,
-          'every_page' => TRUE,
           'type' => 'file',
           'weight' => 0.013,
           'media' => 'all',
@@ -202,7 +194,6 @@ function providerTestOptimize() {
       array(
         array(
           'group' => -100,
-          'every_page' => TRUE,
           'type' => 'file',
           'weight' => 0.013,
           'media' => 'all',
@@ -216,7 +207,6 @@ function providerTestOptimize() {
       array(
         array(
           'group' => -100,
-          'every_page' => TRUE,
           'type' => 'file',
           'weight' => 0.013,
           'media' => 'all',
@@ -247,7 +237,6 @@ function testTypeFilePreprocessingDisabled() {
 
     $css_asset = array(
       'group' => -100,
-      'every_page' => TRUE,
       'type' => 'file',
       'weight' => 0.012,
       'media' => 'all',
@@ -268,7 +257,6 @@ function testTypeExternal() {
 
     $css_asset = array(
       'group' => -100,
-      'every_page' => TRUE,
       // Type external.
       'type' => 'external',
       'weight' => 0.012,
-- 
GitLab