From 91a743c1411287fdf854c49d6d575ff458fcd8b7 Mon Sep 17 00:00:00 2001
From: Dave Long <dave@longwaveconsulting.com>
Date: Sat, 17 Feb 2024 15:42:42 +0000
Subject: [PATCH] Issue #3403198 by simohell, mgifford, itmaybejj: Details do
 not benefit from aria-pressed

---
 core/includes/form.inc                                           | 1 -
 core/misc/details-aria.js                                        | 1 -
 .../Core/Form/FormGroupingElementsTest.php                       | 1 -
 3 files changed, 3 deletions(-)

diff --git a/core/includes/form.inc b/core/includes/form.inc
index 17ca32c03f63..80a04c2cbcec 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -255,7 +255,6 @@ function template_preprocess_details(&$variables) {
       $variables['summary_attributes']['aria-controls'] = $element['#attributes']['id'];
     }
     $variables['summary_attributes']['aria-expanded'] = !empty($element['#attributes']['open']) ? 'true' : 'false';
-    $variables['summary_attributes']['aria-pressed'] = $variables['summary_attributes']['aria-expanded'];
   }
   $variables['title'] = (!empty($element['#title'])) ? $element['#title'] : '';
   // If the element title is a string, wrap it a render array so that markup
diff --git a/core/misc/details-aria.js b/core/misc/details-aria.js
index 1d0ef555586c..c629719a3fc6 100644
--- a/core/misc/details-aria.js
+++ b/core/misc/details-aria.js
@@ -23,7 +23,6 @@
 
           $summary.attr({
             'aria-expanded': open,
-            'aria-pressed': open,
           });
         },
       );
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php
index e289fc48baa2..10b597f66b4a 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Form/FormGroupingElementsTest.php
@@ -134,7 +134,6 @@ public function testDetailsChildVisibility() {
 
     // Assert that both aria-expanded and aria-pressed are true.
     $this->assertEquals('true', $summary->getAttribute('aria-expanded'));
-    $this->assertEquals('true', $summary->getAttribute('aria-pressed'));
   }
 
   /**
-- 
GitLab