Commit 71e34155 authored by alexpott's avatar alexpott

Issue #1183042 followup by mgifford, larowlan: Regression: Add WAI-ARIA roles to Core blocks.

parent 80fdd085
......@@ -2616,10 +2616,10 @@ function system_preprocess_block(&$variables) {
list($plugin_id) = explode(':', $variables['plugin_id'] . ':');
switch ($plugin_id) {
case 'system_powered_by_block':
$variables['attributes_array']['role'] = 'complementary';
$variables['attributes']['role'] = 'complementary';
break;
case 'system_help_block':
$variables['attributes_array']['role'] = 'complementary';
$variables['attributes']['role'] = 'complementary';
break;
case 'system_menu_block':
$variables['attributes']['role'] = 'navigation';
......
......@@ -45,9 +45,28 @@ function testStandard() {
// Verify admin user can see the block.
$this->drupalGet('');
$this->assertText('Main navigation');
// Verify we have role = aria on system_powered_by and system_help_block
// blocks.
$this->drupalGet('admin/structure/block');
$elements = $this->xpath('//div[@role=:role and @id=:id]', array(
':role' => 'complementary',
':id' => 'block-help',
));
$this->assertEqual(count($elements), 1, 'Found complementary role on help block.');
$this->drupalGet('');
$elements = $this->xpath('//div[@role=:role and @id=:id]', array(
':role' => 'complementary',
':id' => 'block-powered',
));
$this->assertEqual(count($elements), 1, 'Found complementary role on powered by block.');
// Verify anonymous user can see the block.
$this->drupalLogout();
$this->assertText('Main navigation');
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment