Issue #3333418 by nicxvan, smustgrave, quietone: Fix pager h4 for accessibility on Stable9
parent
b0bb1b476a
commit
ecac251678
|
@ -165,8 +165,7 @@ class MiniPagerTest extends ViewTestBase {
|
||||||
$view->display_handler->setOption('pager', $pager);
|
$view->display_handler->setOption('pager', $pager);
|
||||||
$view->save();
|
$view->save();
|
||||||
|
|
||||||
// Stark is handled below.
|
// Stark and Stable9 are handled below.
|
||||||
// Stable9 will be addressed in https://www.drupal.org/project/drupal/issues/3333418
|
|
||||||
$themes = ['olivero', 'claro', 'starterkit_theme'];
|
$themes = ['olivero', 'claro', 'starterkit_theme'];
|
||||||
$this->container->get('theme_installer')->install($themes);
|
$this->container->get('theme_installer')->install($themes);
|
||||||
|
|
||||||
|
@ -176,11 +175,14 @@ class MiniPagerTest extends ViewTestBase {
|
||||||
$this->assertEquals('h3', $this->assertSession()->elementExists('css', ".pager .visually-hidden")->getTagName());
|
$this->assertEquals('h3', $this->assertSession()->elementExists('css', ".pager .visually-hidden")->getTagName());
|
||||||
}
|
}
|
||||||
|
|
||||||
// The core views template uses a different class structure than core themes.
|
// The core views template and Stable9 use a different class structure than other core themes.
|
||||||
$this->container->get('theme_installer')->install(['stark']);
|
$themes = ['stark', 'stable9'];
|
||||||
$this->config('system.theme')->set('default', 'stark')->save();
|
$this->container->get('theme_installer')->install($themes);
|
||||||
|
foreach ($themes as $theme) {
|
||||||
|
$this->config('system.theme')->set('default', $theme)->save();
|
||||||
$this->drupalGet('test_mini_pager');
|
$this->drupalGet('test_mini_pager');
|
||||||
$this->assertEquals('h3', $this->assertSession()->elementExists('css', "#pagination-heading")->getTagName());
|
$this->assertEquals('h3', $this->assertSession()->elementExists('css', "#pagination-heading")->getTagName());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -400,8 +400,7 @@ class PagerTest extends ViewTestBase {
|
||||||
$view->display_handler->setOption('pager', $pager);
|
$view->display_handler->setOption('pager', $pager);
|
||||||
$view->save();
|
$view->save();
|
||||||
|
|
||||||
// Stable9 will be addressed in https://www.drupal.org/project/drupal/issues/3333418
|
$themes = ['stark', 'olivero', 'claro', 'starterkit_theme', 'stable9'];
|
||||||
$themes = ['stark', 'olivero', 'claro', 'starterkit_theme'];
|
|
||||||
$this->container->get('theme_installer')->install($themes);
|
$this->container->get('theme_installer')->install($themes);
|
||||||
|
|
||||||
foreach ($themes as $theme) {
|
foreach ($themes as $theme) {
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
*
|
*
|
||||||
* Available variables:
|
* Available variables:
|
||||||
* - heading_id: Pagination heading ID.
|
* - heading_id: Pagination heading ID.
|
||||||
|
* - pagination_heading_level: The heading level to use for the pager.
|
||||||
* - items: List of pager items.
|
* - items: List of pager items.
|
||||||
* The list is keyed by the following elements:
|
* The list is keyed by the following elements:
|
||||||
* - first: Item for the first page; not present on the first page of results.
|
* - first: Item for the first page; not present on the first page of results.
|
||||||
|
@ -32,7 +33,7 @@
|
||||||
#}
|
#}
|
||||||
{% if items %}
|
{% if items %}
|
||||||
<nav class="pager" role="navigation" aria-labelledby="{{ heading_id }}">
|
<nav class="pager" role="navigation" aria-labelledby="{{ heading_id }}">
|
||||||
<h4 id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</h4>
|
<{{ pagination_heading_level }} id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</{{ pagination_heading_level }}>
|
||||||
<ul class="pager__items js-pager__items">
|
<ul class="pager__items js-pager__items">
|
||||||
{# Print first item if we are not on the first page. #}
|
{# Print first item if we are not on the first page. #}
|
||||||
{% if items.first %}
|
{% if items.first %}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
*
|
*
|
||||||
* Available variables:
|
* Available variables:
|
||||||
* - heading_id: Pagination heading ID.
|
* - heading_id: Pagination heading ID.
|
||||||
|
* - pagination_heading_level: The heading level to use for the pager.
|
||||||
* - items: List of pager items.
|
* - items: List of pager items.
|
||||||
*
|
*
|
||||||
* @see template_preprocess_views_mini_pager()
|
* @see template_preprocess_views_mini_pager()
|
||||||
|
@ -12,7 +13,7 @@
|
||||||
#}
|
#}
|
||||||
{% if items.previous or items.next %}
|
{% if items.previous or items.next %}
|
||||||
<nav role="navigation" aria-labelledby="{{ heading_id }}">
|
<nav role="navigation" aria-labelledby="{{ heading_id }}">
|
||||||
<h4 id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</h4>
|
<{{ pagination_heading_level }} id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</{{ pagination_heading_level }}>
|
||||||
<ul class="js-pager__items">
|
<ul class="js-pager__items">
|
||||||
{% if items.previous %}
|
{% if items.previous %}
|
||||||
<li>
|
<li>
|
||||||
|
|
Loading…
Reference in New Issue