diff --git a/core/misc/dialog/dialog.ajax.js b/core/misc/dialog/dialog.ajax.js index 4d9d6c4..ff4908f 100644 --- a/core/misc/dialog/dialog.ajax.js +++ b/core/misc/dialog/dialog.ajax.js @@ -46,7 +46,7 @@ */ prepareDialogButtons: function ($dialog) { var buttons = []; - var $buttons = $dialog.find('.form-actions input[type=submit]'); + var $buttons = $dialog.find('.form-actions button[type="submit"]'); $buttons.each(function () { // Hidden form buttons need special attention. For browser consistency, // the button needs to be "visible" in order to have the enter key fire diff --git a/core/modules/file/src/Tests/FileFieldWidgetTest.php b/core/modules/file/src/Tests/FileFieldWidgetTest.php index f3ae0c4..a5ab688 100644 --- a/core/modules/file/src/Tests/FileFieldWidgetTest.php +++ b/core/modules/file/src/Tests/FileFieldWidgetTest.php @@ -67,8 +67,8 @@ function testSingleValuedWidget() { // Ensure the edit page has a remove button instead of an upload button. $this->drupalGet("node/$nid/edit"); - $this->assertNoFieldByXPath('//input[@type="submit"]', t('Upload'), 'Node with file does not display the "Upload" button.'); - $this->assertFieldByXpath('//input[@type="submit"]', t('Remove'), 'Node with file displays the "Remove" button.'); + $this->assertNoFieldByXPath('//button[@type="submit"]', t('Upload'), 'Node with file does not display the "Upload" button.'); + $this->assertFieldByXpath('//button[@type="submit"]', t('Remove'), 'Node with file displays the "Remove" button.'); // "Click" the remove button (emulating either a nojs or js submission). switch ($type) { @@ -76,14 +76,14 @@ function testSingleValuedWidget() { $this->drupalPostForm(NULL, array(), t('Remove')); break; case 'js': - $button = $this->xpath('//input[@type="submit" and @value="' . t('Remove') . '"]'); + $button = $this->xpath('//button[@type="submit" and @value="' . t('Remove') . '"]'); $this->drupalPostAjaxForm(NULL, array(), array((string) $button[0]['name'] => (string) $button[0]['value'])); break; } // Ensure the page now has an upload button instead of a remove button. - $this->assertNoFieldByXPath('//input[@type="submit"]', t('Remove'), 'After clicking the "Remove" button, it is no longer displayed.'); - $this->assertFieldByXpath('//input[@type="submit"]', t('Upload'), 'After clicking the "Remove" button, the "Upload" button is displayed.'); + $this->assertNoFieldByXPath('//button[@type="submit"]', t('Remove'), 'After clicking the "Remove" button, it is no longer displayed.'); + $this->assertFieldByXpath('//button[@type="submit"]', t('Upload'), 'After clicking the "Remove" button, the "Upload" button is displayed.'); // Test label has correct 'for' attribute. $label = $this->xpath("//label[@for='edit-" . Html::cleanCssIdentifier($field_name) . "-0-upload']"); $this->assertTrue(isset($label[0]), 'Label for upload found.'); @@ -133,7 +133,7 @@ function testMultiValuedWidget() { $this->drupalPostForm(NULL, $edit, t('Upload')); } } - $this->assertNoFieldByXpath('//input[@type="submit"]', t('Upload'), 'After uploading 3 files for each field, the "Upload" button is no longer displayed.'); + $this->assertNoFieldByXpath('//button[@type="submit"]', t('Upload'), 'After uploading 3 files for each field, the "Upload" button is no longer displayed.'); $num_expected_remove_buttons = 6; @@ -149,7 +149,7 @@ function testMultiValuedWidget() { foreach (array(1,1,0) as $delta) { // Ensure we have the expected number of Remove buttons, and that they // are numbered sequentially. - $buttons = $this->xpath('//input[@type="submit" and @value="Remove"]'); + $buttons = $this->xpath('//button[@type="submit" and @value="Remove"]'); $this->assertTrue(is_array($buttons) && count($buttons) === $num_expected_remove_buttons, format_string('There are %n "Remove" buttons displayed (JSMode=%type).', array('%n' => $num_expected_remove_buttons, '%type' => $type))); foreach ($buttons as $i => $button) { $key = $i >= $remaining ? $i - $remaining : $i; @@ -191,18 +191,18 @@ function testMultiValuedWidget() { // Ensure an "Upload" button for the current field is displayed with the // correct name. $upload_button_name = $current_field_name . '_' . $remaining . '_upload_button'; - $buttons = $this->xpath('//input[@type="submit" and @value="Upload" and @name=:name]', array(':name' => $upload_button_name)); + $buttons = $this->xpath('//button[@type="submit" and @value="Upload" and @name=:name]', array(':name' => $upload_button_name)); $this->assertTrue(is_array($buttons) && count($buttons) == 1, format_string('The upload button is displayed with the correct name (JSMode=%type).', array('%type' => $type))); // Ensure only at most one button per field is displayed. - $buttons = $this->xpath('//input[@type="submit" and @value="Upload"]'); + $buttons = $this->xpath('//button[@type="submit" and @value="Upload"]'); $expected = $current_field_name == $field_name ? 1 : 2; $this->assertTrue(is_array($buttons) && count($buttons) == $expected, format_string('After removing a file, only one "Upload" button for each possible field is displayed (JSMode=%type).', array('%type' => $type))); } } // Ensure the page now has no Remove buttons. - $this->assertNoFieldByXPath('//input[@type="submit"]', t('Remove'), format_string('After removing all files, there is no "Remove" button displayed (JSMode=%type).', array('%type' => $type))); + $this->assertNoFieldByXPath('//button[@type="submit"]', t('Remove'), format_string('After removing all files, there is no "Remove" button displayed (JSMode=%type).', array('%type' => $type))); // Save the node and ensure it does not have any files. $this->drupalPostForm(NULL, array('title[0][value]' => $this->randomMachineName()), t('Save and publish')); @@ -351,7 +351,7 @@ function testWidgetValidation() { $this->drupalPostForm(NULL, $edit, t('Upload')); break; case 'js': - $button = $this->xpath('//input[@type="submit" and @value="' . t('Upload') . '"]'); + $button = $this->xpath('//button[@type="submit" and @value="' . t('Upload') . '"]'); $this->drupalPostAjaxForm(NULL, $edit, array((string) $button[0]['name'] => (string) $button[0]['value'])); break; } @@ -365,7 +365,7 @@ function testWidgetValidation() { $this->drupalPostForm(NULL, $edit, t('Upload')); break; case 'js': - $button = $this->xpath('//input[@type="submit" and @value="' . t('Upload') . '"]'); + $button = $this->xpath('//button[@type="submit" and @value="' . t('Upload') . '"]'); $this->drupalPostAjaxForm(NULL, $edit, array((string) $button[0]['name'] => (string) $button[0]['value'])); break; } diff --git a/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php b/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php index d26a070..57d5117 100644 --- a/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php +++ b/core/modules/locale/src/Tests/LocaleUpdateInterfaceTest.php @@ -113,7 +113,7 @@ public function testInterface() { $this->drupalGet('admin/reports/translations'); $this->assertText(t('Updates for: !project', array('!project' => t('Drupal core'))), 'Translations found'); $this->assertText(String::format('@module (@date)', array('@module' => t('Drupal core'), '@date' => format_date(REQUEST_TIME, 'html_date'))), 'Core translation update'); - $update_button = $this->xpath('//input[@type="submit"][@value="' . t('Update translations') . '"]'); + $update_button = $this->xpath('//button[@type="submit"][@value="' . t('Update translations') . '"]'); $this->assertTrue($update_button, 'Update translations button'); } diff --git a/core/modules/node/src/Tests/NodeFormButtonsTest.php b/core/modules/node/src/Tests/NodeFormButtonsTest.php index b5c2df5..c4cd10c 100644 --- a/core/modules/node/src/Tests/NodeFormButtonsTest.php +++ b/core/modules/node/src/Tests/NodeFormButtonsTest.php @@ -146,7 +146,7 @@ function testNodeFormButtons() { public function assertButtons($buttons, $dropbutton = TRUE) { // Try to find a Save button. - $save_button = $this->xpath('//input[@type="submit"][@value="Save"]'); + $save_button = $this->xpath('//button[@type="submit"][@value="Save"]'); // Verify that the number of buttons passed as parameters is // available in the dropbutton widget. @@ -158,7 +158,7 @@ public function assertButtons($buttons, $dropbutton = TRUE) { $this->assertTrue(empty($save_button)); // Dropbutton elements. - $elements = $this->xpath('//div[@class="dropbutton-wrapper"]//input[@type="submit"]'); + $elements = $this->xpath('//div[@class="dropbutton-wrapper"]//button[@type="submit"]'); $this->assertEqual($count, count($elements)); foreach ($elements as $element) { $value = isset($element['value']) ? (string) $element['value'] : ''; diff --git a/core/modules/simpletest/src/AssertContentTrait.php b/core/modules/simpletest/src/AssertContentTrait.php index e114ebf..f9df179 100644 --- a/core/modules/simpletest/src/AssertContentTrait.php +++ b/core/modules/simpletest/src/AssertContentTrait.php @@ -1301,7 +1301,7 @@ protected function assertNoDuplicateIds($message = '', $group = 'Other', $ids_to * XPath for specified values. */ protected function constructFieldXpath($attribute, $value) { - $xpath = '//textarea[@' . $attribute . '=:value]|//input[@' . $attribute . '=:value]|//select[@' . $attribute . '=:value]'; + $xpath = '//textarea[@' . $attribute . '=:value]|//input[@' . $attribute . '=:value]|//button[@' . $attribute . '=:value]|//select[@' . $attribute . '=:value]'; return $this->buildXPathQuery($xpath, array(':value' => $value)); } diff --git a/core/modules/system/src/Tests/Ajax/MultiFormTest.php b/core/modules/system/src/Tests/Ajax/MultiFormTest.php index 37251c6..4baa4db 100644 --- a/core/modules/system/src/Tests/Ajax/MultiFormTest.php +++ b/core/modules/system/src/Tests/Ajax/MultiFormTest.php @@ -65,7 +65,7 @@ function testMultiForm() { ); $button_name = $field_name . '_add_more'; $button_value = t('Add another item'); - $button_xpath_suffix = '//input[@name="' . $button_name . '"]'; + $button_xpath_suffix = '//button[@name="' . $button_name . '"]'; $field_items_xpath_suffix = '//input[@type="text"]'; // Ensure the initial page contains both node forms and the correct number diff --git a/core/modules/system/src/Tests/Common/RenderWebTest.php b/core/modules/system/src/Tests/Common/RenderWebTest.php index c2cb88f..401dd7e 100644 --- a/core/modules/system/src/Tests/Common/RenderWebTest.php +++ b/core/modules/system/src/Tests/Common/RenderWebTest.php @@ -35,7 +35,7 @@ function testDrupalRenderFormElements() { '#type' => 'button', '#value' => $this->randomMachineName(), ); - $this->assertRenderedElement($element, '//input[@type=:type]', array(':type' => 'submit')); + $this->assertRenderedElement($element, '//button[@type=:type]', array(':type' => 'submit')); $element = array( '#type' => 'textfield', diff --git a/core/modules/system/src/Tests/Form/ConfirmFormTest.php b/core/modules/system/src/Tests/Form/ConfirmFormTest.php index ffcc44a..3916add 100644 --- a/core/modules/system/src/Tests/Form/ConfirmFormTest.php +++ b/core/modules/system/src/Tests/Form/ConfirmFormTest.php @@ -29,7 +29,7 @@ function testConfirmForm() { $site_name = $this->config('system.site')->get('name'); $this->assertTitle(t('ConfirmFormTestForm::getQuestion(). | @site-name', array('@site-name' => $site_name)), 'The question was found as the page title.'); $this->assertText(t('ConfirmFormTestForm::getDescription().'), 'The description was used.'); - $this->assertFieldByXPath('//input[@id="edit-submit"]', t('ConfirmFormTestForm::getConfirmText().'), 'The confirm text was used.'); + $this->assertFieldByXPath('//button[@id="edit-submit"]', t('ConfirmFormTestForm::getConfirmText().'), 'The confirm text was used.'); // Test canelling the form. $this->clickLink(t('ConfirmFormTestForm::getCancelText().')); diff --git a/core/modules/system/src/Tests/Form/FormTest.php b/core/modules/system/src/Tests/Form/FormTest.php index 22b3b84..978ea9d 100644 --- a/core/modules/system/src/Tests/Form/FormTest.php +++ b/core/modules/system/src/Tests/Form/FormTest.php @@ -586,6 +586,8 @@ function testDisabledMarkup() { 'select' => 'select', 'weight' => 'select', 'datetime' => 'datetime', + 'button' => 'button', + 'submit' => 'button', ); foreach ($form as $name => $item) { diff --git a/core/modules/system/src/Tests/Installer/InstallerLanguageDirectionTest.php b/core/modules/system/src/Tests/Installer/InstallerLanguageDirectionTest.php index 0c183d8..306ebe9 100644 --- a/core/modules/system/src/Tests/Installer/InstallerLanguageDirectionTest.php +++ b/core/modules/system/src/Tests/Installer/InstallerLanguageDirectionTest.php @@ -34,7 +34,7 @@ protected function setUpLanguage() { parent::setUpLanguage(); // After selecting a different language than English, all following screens // should be translated already. - $elements = $this->xpath('//input[@type="submit"]/@value'); + $elements = $this->xpath('//button[@type="submit"]/@value'); $this->assertEqual((string) current($elements), 'Save and continue Arabic'); $this->translations['Save and continue'] = 'Save and continue Arabic'; diff --git a/core/modules/system/src/Tests/Installer/InstallerTranslationTest.php b/core/modules/system/src/Tests/Installer/InstallerTranslationTest.php index 8d9305c..c409800 100644 --- a/core/modules/system/src/Tests/Installer/InstallerTranslationTest.php +++ b/core/modules/system/src/Tests/Installer/InstallerTranslationTest.php @@ -36,7 +36,7 @@ protected function setUpLanguage() { parent::setUpLanguage(); // After selecting a different language than English, all following screens // should be translated already. - $elements = $this->xpath('//input[@type="submit"]/@value'); + $elements = $this->xpath('//button[@type="submit"]/@value'); $this->assertEqual((string) current($elements), 'Save and continue German'); $this->translations['Save and continue'] = 'Save and continue German'; diff --git a/core/modules/views_ui/css/views_ui.admin.theme.css b/core/modules/views_ui/css/views_ui.admin.theme.css index b5f2a03..ea2b06a 100644 --- a/core/modules/views_ui/css/views_ui.admin.theme.css +++ b/core/modules/views_ui/css/views_ui.admin.theme.css @@ -589,13 +589,15 @@ td.group-title { border-width: 0 1px 1px; } -.views-displays .tabs.secondary .action-list input.form-submit { +.views-displays .tabs.secondary .action-list .form-submit { background: none repeat scroll 0 0 transparent; border: medium none; margin: 0; padding: 0; + white-space: nowrap; + border-radius: 0; } -.views-displays .tabs.secondary .action-list input.form-submit:hover { +.views-displays .tabs.secondary .action-list .form-submit:hover { box-shadow: none; } @@ -1214,7 +1216,7 @@ div.messages { } .views-ui-display-tab-actions .dropbutton-wrapper li a, -.views-ui-display-tab-actions .dropbutton-wrapper input { +.views-ui-display-tab-actions .dropbutton-wrapper button { background: none; border: medium; font-family: inherit; @@ -1223,12 +1225,12 @@ div.messages { margin-bottom: 0; } [dir="rtl"] .views-ui-display-tab-actions .dropbutton-wrapper li a, -[dir="rtl"] .views-ui-display-tab-actions .dropbutton-wrapper input { +[dir="rtl"] .views-ui-display-tab-actions .dropbutton-wrapper button { padding-left: 0.5em; padding-right: 12px; } -.views-ui-display-tab-actions .dropbutton-wrapper input:hover { +.views-ui-display-tab-actions .dropbutton-wrapper button:hover { background: none; border: none; } diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index 5310062..6173a70 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -239,7 +239,7 @@ } var $addDisplayDropdown = $('