diff --git a/core/core.libraries.yml b/core/core.libraries.yml index 770bcf7c9ec9376d2960d1c83bdda58c804d31c9..60261676fa0ec6b14c116c2ca3126a136aeafd9b 100644 --- a/core/core.libraries.yml +++ b/core/core.libraries.yml @@ -647,6 +647,21 @@ drupal.progress: - core/jquery - core/drupalSettings +drupal.textarea-resize: + version: VERSION + css: + component: + misc/components/resize.module.css: { weight: -10 } + moved_files: + system/base: + deprecation_version: 11.2.0 + removed_version: 12.0.0 + deprecation_link: https://www.drupal.org/node/3432346 + css: + component: + css/components/resize.module.css: + component: misc/components/resize.module.css + drupal.states: version: VERSION js: diff --git a/core/lib/Drupal/Core/Render/Element/Textarea.php b/core/lib/Drupal/Core/Render/Element/Textarea.php index e071c76c97c79ab7c20781ffb52606a7b811ab90..c3fc6021924436105a89b1f3b80c66901a2eeedb 100644 --- a/core/lib/Drupal/Core/Render/Element/Textarea.php +++ b/core/lib/Drupal/Core/Render/Element/Textarea.php @@ -44,12 +44,21 @@ public function getInfo() { ], '#pre_render' => [ [static::class, 'preRenderGroup'], + [static::class, 'preRenderAttachments'], ], '#theme' => 'textarea', '#theme_wrappers' => ['form_element'], ]; } + /** + * Adds the textarea resize library. + */ + public static function preRenderAttachments($element): array { + $element['#attached']['library'][] = 'core/drupal.textarea-resize'; + return $element; + } + /** * {@inheritdoc} */ diff --git a/core/modules/system/css/components/resize.module.css b/core/misc/components/resize.module.css similarity index 100% rename from core/modules/system/css/components/resize.module.css rename to core/misc/components/resize.module.css diff --git a/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php b/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php index 7b50dbd0da7944ee5888b6ae602f85be71a1dd9c..f447a9aa3aae9974e1fcc63079b8169738ca2961 100644 --- a/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php +++ b/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php @@ -93,7 +93,7 @@ public function testLogin(): void { 'ScriptCount' => 3, 'ScriptBytes' => 215500, 'StylesheetCount' => 1, - 'StylesheetBytes' => 46300, + 'StylesheetBytes' => 46000, ]; $this->assertMetrics($expected, $performance_data); diff --git a/core/modules/system/system.libraries.yml b/core/modules/system/system.libraries.yml index 12017369189e40dbf4e5692d5913f59e2f7fe855..19e3935aa388919a864844c73277aabef558c1c0 100644 --- a/core/modules/system/system.libraries.yml +++ b/core/modules/system/system.libraries.yml @@ -13,7 +13,6 @@ base: css/components/nowrap.module.css: { weight: -10 } css/components/position-container.module.css: { weight: -10 } css/components/reset-appearance.module.css: { weight: -10 } - css/components/resize.module.css: { weight: -10 } css/components/tablesort.module.css: { weight: -10 } admin: diff --git a/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php b/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php index 0eeb6a82fb55ca0b37b3c472edfa9e7ca92ace35..270848ef150080db65810a74a8d444b839af891f 100644 --- a/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php +++ b/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php @@ -30,7 +30,7 @@ public function testFrontAndRecipesPages(): void { 'ScriptCount' => 1, 'ScriptBytes' => 11700, 'StylesheetCount' => 6, - 'StylesheetBytes' => 121000, + 'StylesheetBytes' => 120500, ]; $this->assertMetrics($expected, $performance_data); } diff --git a/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php b/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php index 5a797ad874b31449040fc1d9331240f4f4ea570f..aa8d6dca9bb039d7fde13f6874e0ed5d0b365e2c 100644 --- a/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php +++ b/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php @@ -191,7 +191,7 @@ protected function testAnonymous(): void { ['config:user.role.anonymous'], ], 'StylesheetCount' => 1, - 'StylesheetBytes' => 2250, + 'StylesheetBytes' => 2100, ]; $this->assertMetrics($expected, $performance_data); $expected_default_cache_cids = [ @@ -275,7 +275,7 @@ protected function testAnonymous(): void { ['config:user.role.anonymous'], ], 'StylesheetCount' => 1, - 'StylesheetBytes' => 2250, + 'StylesheetBytes' => 2100, ]; $this->assertMetrics($expected, $performance_data); @@ -312,7 +312,7 @@ protected function testAnonymous(): void { 'CacheTagInvalidationCount' => 0, 'CacheTagLookupQueryCount' => 13, 'StylesheetCount' => 1, - 'StylesheetBytes' => 1950, + 'StylesheetBytes' => 1800, ]; $this->assertMetrics($expected, $performance_data); } diff --git a/core/themes/stable9/css/system/components/resize.module.css b/core/themes/stable9/css/core/components/resize.module.css similarity index 100% rename from core/themes/stable9/css/system/components/resize.module.css rename to core/themes/stable9/css/core/components/resize.module.css diff --git a/core/themes/stable9/stable9.info.yml b/core/themes/stable9/stable9.info.yml index a8fb889436a9562293c4edf04e6a2b9426a24984..70ac743dbd5b4f661a12ab8fc9e77a94ba0050c5 100644 --- a/core/themes/stable9/stable9.info.yml +++ b/core/themes/stable9/stable9.info.yml @@ -78,6 +78,11 @@ libraries-override: component: misc/components/progress.module.css: css/core/components/progress.module.css + core/drupal.textarea-resize: + css: + component: + misc/components/resize.module.css: css/core/components/resize.module.css + core/drupal.tabledrag: css: component: @@ -234,7 +239,6 @@ libraries-override: css/components/nowrap.module.css: css/system/components/nowrap.module.css css/components/position-container.module.css: css/system/components/position-container.module.css css/components/reset-appearance.module.css: css/system/components/reset-appearance.module.css - css/components/resize.module.css: css/system/components/resize.module.css css/components/tablesort.module.css: css/system/components/tablesort.module.css system/admin: css: