Loading core/lib/Drupal/Core/Asset/AssetResolver.php +0 −7 Original line number Diff line number Diff line Loading @@ -126,7 +126,6 @@ public function getCssAssets(AttachedAssetsInterface $assets, $optimize) { 'weight' => 0, 'media' => 'all', 'preprocess' => TRUE, 'browsers' => [], ]; foreach ($libraries_to_load as $library) { Loading @@ -135,10 +134,6 @@ public function getCssAssets(AttachedAssetsInterface $assets, $optimize) { if (isset($definition['css'])) { foreach ($definition['css'] as $options) { $options += $default_options; $options['browsers'] += [ 'IE' => TRUE, '!IE' => TRUE, ]; // Files with a query string cannot be preprocessed. if ($options['type'] === 'file' && $options['preprocess'] && strpos($options['data'], '?') !== FALSE) { Loading Loading @@ -220,7 +215,6 @@ public function getJsAssets(AttachedAssetsInterface $assets, $optimize) { 'preprocess' => TRUE, 'attributes' => [], 'version' => NULL, 'browsers' => [], ]; // Collect all libraries that contain JS assets and are in the header. Loading Loading @@ -324,7 +318,6 @@ public function getJsAssets(AttachedAssetsInterface $assets, $optimize) { 'type' => 'setting', 'group' => JS_SETTING, 'weight' => 0, 'browsers' => [], 'data' => $settings, ]; $settings_js_asset = ['drupalSettings' => $settings_as_inline_javascript]; Loading core/lib/Drupal/Core/Asset/CssCollectionGrouper.php +5 −10 Original line number Diff line number Diff line Loading @@ -11,13 +11,13 @@ class CssCollectionGrouper implements AssetCollectionGrouperInterface { * {@inheritdoc} * * Puts multiple items into the same group if they are groupable and if they * are for the same 'media' and 'browsers'. Items of the 'file' type are * groupable if their 'preprocess' flag is TRUE, and items of the 'external' * type are never groupable. * are for the same 'media'. Items of the 'file' type are groupable if their * 'preprocess' flag is TRUE, and items of the 'external' type are never * groupable. * * Also ensures that the process of grouping items does not change their * relative order. This requirement may result in multiple groups for the same * type, media, and browsers, if needed to accommodate other items in between. * type and media, if needed to accommodate other items in between. */ public function group(array $css_assets) { $groups = []; Loading @@ -30,11 +30,6 @@ public function group(array $css_assets) { // -1, the first group will have index 0. $i = -1; foreach ($css_assets as $item) { // The browsers for which the CSS item needs to be loaded is part of the // information that determines when a new group is needed, but the order // of keys in the array doesn't matter, and we don't want a new group if // all that's different is that order. ksort($item['browsers']); // If the item can be grouped with other items, set $group_keys to an // array of information that must be the same for all items in its group. Loading @@ -52,7 +47,7 @@ public function group(array $css_assets) { // 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. $group_keys = $item['preprocess'] ? [$item['type'], $item['group'], $item['media'], $item['browsers']] : FALSE; $group_keys = $item['preprocess'] ? [$item['type'], $item['group'], $item['media']] : FALSE; break; case 'external': Loading core/lib/Drupal/Core/Asset/CssCollectionRenderer.php +0 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,6 @@ public function render(array $css_assets) { foreach ($css_assets as $css_asset) { $element = $link_element_defaults; $element['#attributes']['media'] = $css_asset['media']; $element['#browsers'] = $css_asset['browsers']; switch ($css_asset['type']) { // For file items, output a LINK tag for file CSS assets. Loading core/lib/Drupal/Core/Asset/JsCollectionGrouper.php +5 −11 Original line number Diff line number Diff line Loading @@ -10,13 +10,13 @@ class JsCollectionGrouper implements AssetCollectionGrouperInterface { /** * {@inheritdoc} * * Puts multiple items into the same group if they are groupable and if they * are for the same browsers. Items of the 'file' type are groupable if their * 'preprocess' flag is TRUE. Items of the 'external' type are not groupable. * Puts multiple items into the same group if they are groupable. Items of * the 'file' type are groupable if their 'preprocess' flag is TRUE. Items of * the 'external' type are not groupable. * * Also ensures that the process of grouping items does not change their * relative order. This requirement may result in multiple groups for the same * type and browsers, if needed to accommodate other items in between. * type, if needed to accommodate other items in between. */ public function group(array $js_assets) { $groups = []; Loading @@ -27,18 +27,12 @@ public function group(array $js_assets) { $current_group_keys = NULL; $index = -1; foreach ($js_assets as $item) { // The browsers for which the JavaScript item needs to be loaded is part // of the information that determines when a new group is needed, but the // order of keys in the array doesn't matter, and we don't want a new // group if all that's different is that order. ksort($item['browsers']); switch ($item['type']) { 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. $group_keys = $item['preprocess'] ? [$item['type'], $item['group'], $item['browsers']] : FALSE; $group_keys = $item['preprocess'] ? [$item['type'], $item['group']] : FALSE; break; case 'external': Loading core/lib/Drupal/Core/Asset/JsCollectionRenderer.php +0 −2 Original line number Diff line number Diff line Loading @@ -66,9 +66,7 @@ public function render(array $js_assets) { // Loop through all JS assets. foreach ($js_assets as $js_asset) { // Element properties that do not depend on JS asset type. $element = $element_defaults; $element['#browsers'] = $js_asset['browsers']; // Element properties that depend on item type. switch ($js_asset['type']) { Loading Loading
core/lib/Drupal/Core/Asset/AssetResolver.php +0 −7 Original line number Diff line number Diff line Loading @@ -126,7 +126,6 @@ public function getCssAssets(AttachedAssetsInterface $assets, $optimize) { 'weight' => 0, 'media' => 'all', 'preprocess' => TRUE, 'browsers' => [], ]; foreach ($libraries_to_load as $library) { Loading @@ -135,10 +134,6 @@ public function getCssAssets(AttachedAssetsInterface $assets, $optimize) { if (isset($definition['css'])) { foreach ($definition['css'] as $options) { $options += $default_options; $options['browsers'] += [ 'IE' => TRUE, '!IE' => TRUE, ]; // Files with a query string cannot be preprocessed. if ($options['type'] === 'file' && $options['preprocess'] && strpos($options['data'], '?') !== FALSE) { Loading Loading @@ -220,7 +215,6 @@ public function getJsAssets(AttachedAssetsInterface $assets, $optimize) { 'preprocess' => TRUE, 'attributes' => [], 'version' => NULL, 'browsers' => [], ]; // Collect all libraries that contain JS assets and are in the header. Loading Loading @@ -324,7 +318,6 @@ public function getJsAssets(AttachedAssetsInterface $assets, $optimize) { 'type' => 'setting', 'group' => JS_SETTING, 'weight' => 0, 'browsers' => [], 'data' => $settings, ]; $settings_js_asset = ['drupalSettings' => $settings_as_inline_javascript]; Loading
core/lib/Drupal/Core/Asset/CssCollectionGrouper.php +5 −10 Original line number Diff line number Diff line Loading @@ -11,13 +11,13 @@ class CssCollectionGrouper implements AssetCollectionGrouperInterface { * {@inheritdoc} * * Puts multiple items into the same group if they are groupable and if they * are for the same 'media' and 'browsers'. Items of the 'file' type are * groupable if their 'preprocess' flag is TRUE, and items of the 'external' * type are never groupable. * are for the same 'media'. Items of the 'file' type are groupable if their * 'preprocess' flag is TRUE, and items of the 'external' type are never * groupable. * * Also ensures that the process of grouping items does not change their * relative order. This requirement may result in multiple groups for the same * type, media, and browsers, if needed to accommodate other items in between. * type and media, if needed to accommodate other items in between. */ public function group(array $css_assets) { $groups = []; Loading @@ -30,11 +30,6 @@ public function group(array $css_assets) { // -1, the first group will have index 0. $i = -1; foreach ($css_assets as $item) { // The browsers for which the CSS item needs to be loaded is part of the // information that determines when a new group is needed, but the order // of keys in the array doesn't matter, and we don't want a new group if // all that's different is that order. ksort($item['browsers']); // If the item can be grouped with other items, set $group_keys to an // array of information that must be the same for all items in its group. Loading @@ -52,7 +47,7 @@ public function group(array $css_assets) { // 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. $group_keys = $item['preprocess'] ? [$item['type'], $item['group'], $item['media'], $item['browsers']] : FALSE; $group_keys = $item['preprocess'] ? [$item['type'], $item['group'], $item['media']] : FALSE; break; case 'external': Loading
core/lib/Drupal/Core/Asset/CssCollectionRenderer.php +0 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,6 @@ public function render(array $css_assets) { foreach ($css_assets as $css_asset) { $element = $link_element_defaults; $element['#attributes']['media'] = $css_asset['media']; $element['#browsers'] = $css_asset['browsers']; switch ($css_asset['type']) { // For file items, output a LINK tag for file CSS assets. Loading
core/lib/Drupal/Core/Asset/JsCollectionGrouper.php +5 −11 Original line number Diff line number Diff line Loading @@ -10,13 +10,13 @@ class JsCollectionGrouper implements AssetCollectionGrouperInterface { /** * {@inheritdoc} * * Puts multiple items into the same group if they are groupable and if they * are for the same browsers. Items of the 'file' type are groupable if their * 'preprocess' flag is TRUE. Items of the 'external' type are not groupable. * Puts multiple items into the same group if they are groupable. Items of * the 'file' type are groupable if their 'preprocess' flag is TRUE. Items of * the 'external' type are not groupable. * * Also ensures that the process of grouping items does not change their * relative order. This requirement may result in multiple groups for the same * type and browsers, if needed to accommodate other items in between. * type, if needed to accommodate other items in between. */ public function group(array $js_assets) { $groups = []; Loading @@ -27,18 +27,12 @@ public function group(array $js_assets) { $current_group_keys = NULL; $index = -1; foreach ($js_assets as $item) { // The browsers for which the JavaScript item needs to be loaded is part // of the information that determines when a new group is needed, but the // order of keys in the array doesn't matter, and we don't want a new // group if all that's different is that order. ksort($item['browsers']); switch ($item['type']) { 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. $group_keys = $item['preprocess'] ? [$item['type'], $item['group'], $item['browsers']] : FALSE; $group_keys = $item['preprocess'] ? [$item['type'], $item['group']] : FALSE; break; case 'external': Loading
core/lib/Drupal/Core/Asset/JsCollectionRenderer.php +0 −2 Original line number Diff line number Diff line Loading @@ -66,9 +66,7 @@ public function render(array $js_assets) { // Loop through all JS assets. foreach ($js_assets as $js_asset) { // Element properties that do not depend on JS asset type. $element = $element_defaults; $element['#browsers'] = $js_asset['browsers']; // Element properties that depend on item type. switch ($js_asset['type']) { Loading