summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcatch2011-12-15 08:05:44 (GMT)
committercatch2011-12-15 08:05:44 (GMT)
commitf2431f3d3b1ac58fd3b95adf42188ce7f8d8ed62 (patch)
tree0a4bf183f8e165f6f219fecf40067d3f2fe24d2b
parent010e99986bf6afdb7bdf2c72285eedb3da23927c (diff)
Revert "- Patch #1174938 by ericduran, aspilicious, voxpelli: natively support the HTML5 #required FAPI property. Woot!"
This reverts commit 8945bee7fdc47a77c3a19404d20fe1dd7ca279f7.
-rw-r--r--core/includes/form.inc9
-rw-r--r--core/modules/simpletest/tests/form.test23
-rw-r--r--core/modules/simpletest/tests/form_test.module22
3 files changed, 0 insertions, 54 deletions
diff --git a/core/includes/form.inc b/core/includes/form.inc
index a9fe61a..bf64d81 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -1944,15 +1944,6 @@ function _form_builder_handle_input_element($form_id, &$element, &$form_state) {
}
}
- // The 'required' attribute should only be printed when #required is true.
- // The presence of a boolean attribute on an element represents the true
- // value, and the absence of the attribute represents the false value.
- // http://www.w3.org/TR/html5/common-microsyntaxes.html#boolean-attribute.
- if (!empty($element['#required'])) {
- $element['#attributes']['required'] = 'required';
- $element['#attributes']['aria-required'] = 'true';
- }
-
// With JavaScript or other easy hacking, input can be submitted even for
// elements with #access=FALSE or #disabled=TRUE. For security, these must
// not be processed. Forms that set #disabled=TRUE on an element do not
diff --git a/core/modules/simpletest/tests/form.test b/core/modules/simpletest/tests/form.test
index c2185e8..94dfa87 100644
--- a/core/modules/simpletest/tests/form.test
+++ b/core/modules/simpletest/tests/form.test
@@ -366,29 +366,6 @@ class FormsTestCase extends DrupalWebTestCase {
$this->drupalPost(NULL, array('checkboxes[one]' => TRUE, 'checkboxes[two]' => TRUE), t('Submit'));
$this->assertText('An illegal choice has been detected.', t('Input forgery was detected.'));
}
-
- /**
- * Tests required attribute.
- */
- function testRequiredAttribute() {
- $this->drupalGet('form-test/required-attribute');
- $expected = 'required';
- // Test to make sure the elements have the proper required attribute.
- foreach (array('textfield', 'password') as $type) {
- $element = $this->xpath('//input[@id=:id and @required=:expected]', array(
- ':id' => 'edit-' . $type,
- ':expected' => $expected,
- ));
- $this->assertTrue(!empty($element), t('The @type has the proper required attribute.', array('@type' => $type)));
- }
-
- // Test to make sure textarea has the proper required attribute.
- $element = $this->xpath('//textarea[@id=:id and @required=:expected]', array(
- ':id' => 'edit-textarea',
- ':expected' => $expected,
- ));
- $this->assertTrue(!empty($element), t('Placeholder text placed in textarea.'));
- }
}
/**
diff --git a/core/modules/simpletest/tests/form_test.module b/core/modules/simpletest/tests/form_test.module
index ed52b8f..5e3fb17 100644
--- a/core/modules/simpletest/tests/form_test.module
+++ b/core/modules/simpletest/tests/form_test.module
@@ -210,13 +210,6 @@ function form_test_menu() {
'type' => MENU_CALLBACK,
);
- $items['form-test/required-attribute'] = array(
- 'title' => 'Required',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('form_test_required_attribute'),
- 'access callback' => TRUE,
- );
-
return $items;
}
@@ -1690,18 +1683,3 @@ function form_test_checkboxes_zero($form, &$form_state, $json = TRUE) {
function _form_test_checkboxes_zero_no_redirect($form, &$form_state) {
$form_state['redirect'] = FALSE;
}
-
-/**
- * Builds a form to test the placeholder attribute.
- */
-function form_test_required_attribute($form, &$form_state) {
- foreach (array('textfield', 'textarea', 'password') as $type) {
- $form[$type] = array(
- '#type' => $type,
- '#required' => TRUE,
- '#title' => $type,
- );
- }
-
- return $form;
-}