From 32fc5ac8359b1db9533708e212f29369ff18543c Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 7 Feb 2010 05:36:57 +0000 Subject: [PATCH] #567192 by mgifford: Fixed Expanding simpletest groups not accessible via keyboard. --- modules/simpletest/simpletest.css | 19 +++++++++++++++++++ modules/simpletest/simpletest.pages.inc | 4 ++-- modules/simpletest/tests/form.test | 3 +++ modules/simpletest/tests/form_test.module | 5 +++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/modules/simpletest/simpletest.css b/modules/simpletest/simpletest.css index 5cfedc68ccb..dab817178d6 100644 --- a/modules/simpletest/simpletest.css +++ b/modules/simpletest/simpletest.css @@ -71,3 +71,22 @@ div.simpletest-image { display: inline; cursor: pointer; } + +a.simpletest-collapse { + height: 0; + width: 0; + top: -99em; + position: absolute; + +} + +a.simpletest-collapse:focus, +a.simpletest-collapse:hover { + font-size: 80%; + top: 0px; + height: auto; + width: auto; + overflow: visible; + position: relative; + z-index: 1000; +} \ No newline at end of file diff --git a/modules/simpletest/simpletest.pages.inc b/modules/simpletest/simpletest.pages.inc index 990760497cd..c9292613104 100644 --- a/modules/simpletest/simpletest.pages.inc +++ b/modules/simpletest/simpletest.pages.inc @@ -83,8 +83,8 @@ function theme_simpletest_test_table($variables) { // Define the images used to expand/collapse the test groups. $js = array( 'images' => array( - theme('image', array('path' => 'misc/menu-collapsed.png', 'alt' => 'Expand', 'title' => 'Expand')), - theme('image', array('path' => 'misc/menu-expanded.png', 'alt' => 'Collapsed', 'title' => 'Collapsed')), + theme('image', array('path' => 'misc/menu-collapsed.png', 'alt' => t('Expand'), 'title' => t('Expand'))) . ' (' . t('Expand') . ')', + theme('image', array('path' => 'misc/menu-expanded.png', 'alt' => t('Collapse'), 'title' => t('Collapse'))) . ' (' . t('Collapse') . ')', ), ); diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test index b7dec7b6a95..9dd5c999724 100644 --- a/modules/simpletest/tests/form.test +++ b/modules/simpletest/tests/form.test @@ -305,6 +305,9 @@ class FormsElementsLabelsTestCase extends DrupalWebTestCase { $elements = $this->xpath('//input[@id="edit-form-textfield-test-title-after"]/following-sibling::label[@for="edit-form-textfield-test-title-after" and @class="option"]'); $this->assertTrue(isset($elements[0]), t("Label after field and label option class correct for text field.")); + $elements = $this->xpath('//input[@id="edit-form-textfield-test-title-invisible"]/following-sibling::label[@for="edit-form-textfield-test-title-invisible" and @class="element-invisible"]'); + $this->assertTrue(isset($elements[0]), t("Label after field and label class is element-invisible.")); + $elements = $this->xpath('//label[@for="edit-form-textfield-test-title-no-show"]'); $this->assertFalse(isset($elements[0]), t("No label tag when title set not to display.")); } diff --git a/modules/simpletest/tests/form_test.module b/modules/simpletest/tests/form_test.module index 54b6299f8d4..34d87c9c59a 100644 --- a/modules/simpletest/tests/form_test.module +++ b/modules/simpletest/tests/form_test.module @@ -537,6 +537,11 @@ function form_label_test_form(&$form_state) { '#title' => t('Textfield test for title after element'), '#title_display' => 'after', ); + $form['form_textfield_test_title_invisible'] = array( + '#type' => 'textfield', + '#title' => t('Textfield test for invisible title'), + '#title_display' => 'invisible', + ); // Textfield test for title set not to display $form['form_textfield_test_title_no_show'] = array( '#type' => 'textfield',