diff --git a/includes/form.inc b/includes/form.inc
index 9c2a9c1..ab2a817 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -3645,14 +3645,14 @@ function theme_hidden($variables) {
  *   An associative array containing:
  *   - element: An associative array containing the properties of the element.
  *     Properties used: #title, #value, #description, #size, #maxlength,
- *     #required, #attributes, #autocomplete_path.
+ *     #placeholder, #required, #attributes, #autocomplete_path.
  *
  * @ingroup themeable
  */
 function theme_textfield($variables) {
   $element = $variables['element'];
   $element['#attributes']['type'] = 'text';
-  element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength'));
+  element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength', 'placeholder'));
   _form_set_class($element, array('form-text'));
 
   $extra = '';
@@ -3703,14 +3703,14 @@ function theme_form($variables) {
  * @param $variables
  *   An associative array containing:
  *   - element: An associative array containing the properties of the element.
- *     Properties used: #title, #value, #description, #rows, #cols, #required,
- *     #attributes
+ *     Properties used: #title, #value, #description, #rows, #cols,
+ *     #placeholder, #required, #attributes
  *
  * @ingroup themeable
  */
 function theme_textarea($variables) {
   $element = $variables['element'];
-  element_set_attributes($element, array('id', 'name', 'cols', 'rows'));
+  element_set_attributes($element, array('id', 'name', 'rows', 'cols', 'placeholder'));
   _form_set_class($element, array('form-textarea'));
 
   $wrapper_attributes = array(
@@ -3736,14 +3736,14 @@ function theme_textarea($variables) {
  *   An associative array containing:
  *   - element: An associative array containing the properties of the element.
  *     Properties used: #title, #value, #description, #size, #maxlength,
- *     #required, #attributes.
+ *     #placeholder, #required, #attributes.
  *
  * @ingroup themeable
  */
 function theme_password($variables) {
   $element = $variables['element'];
   $element['#attributes']['type'] = 'password';
-  element_set_attributes($element, array('id', 'name', 'size', 'maxlength'));
+  element_set_attributes($element, array('id', 'name', 'size', 'maxlength', 'placeholder'));
   _form_set_class($element, array('form-text'));
 
   return '<input' . drupal_attributes($element['#attributes']) . ' />';
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test
index e7ae9de..5c116bd 100644
--- a/modules/simpletest/tests/form.test
+++ b/modules/simpletest/tests/form.test
@@ -387,6 +387,28 @@ class FormElementTestCase extends DrupalWebTestCase {
   }
 
   /**
+   * Tests placeholder text for textfields.
+   */
+  function testPlaceHolderText() {
+    $this->drupalGet('form-test/placeholder-text');
+    $expected = 'placeholder-text';
+    foreach (array('textfield','password') as $type) {
+      $element = $this->xpath('//input[@id=:id and @placeholder=:expected]', array(
+        ':id' => 'edit-' . $type,
+        ':expected' => $expected,
+      ));
+      $this->assertTrue(!empty($element), t('Placeholder text placed in @type.', array('@type' => $type)));
+    }
+
+    // Now lets test the textarea.
+    $element = $this->xpath('//textarea[@id=:id and @placeholder=:expected]', array(
+      ':id' => 'edit-textarea',
+      ':expected' => $expected,
+    ));
+    $this->assertTrue(!empty($element), t('Placeholder text placed in textarea.'));
+  }
+
+  /**
    * Tests expansion of #options for #type checkboxes and radios.
    */
   function testOptions() {
diff --git a/modules/simpletest/tests/form_test.module b/modules/simpletest/tests/form_test.module
index 00be7d2..7540e24 100644
--- a/modules/simpletest/tests/form_test.module
+++ b/modules/simpletest/tests/form_test.module
@@ -105,6 +105,12 @@ function form_test_menu() {
     'page arguments' => array('form_test_select'),
     'access callback' => TRUE,
   );
+  $items['form-test/placeholder-text'] = array(
+    'title' => t('Placeholder'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('form_test_placeholder_test'),
+    'access callback' => TRUE,
+  );
   $items['form-test/checkboxes-radios'] = array(
     'title' => t('Checkboxes, Radios'),
     'page callback' => 'drupal_get_form',
@@ -981,6 +987,22 @@ function form_test_select_submit($form, &$form_state) {
 }
 
 /**
+ * Builds a form to test the place-holder attribute.
+ */
+function form_test_placeholder_test($form, &$form_state) {
+
+  foreach (array('textfield', 'textarea', 'password') as $type) {
+    $form[$type] = array(
+      '#type' => $type,
+      '#title' => $type,
+      '#placeholder' => 'placeholder-text',
+    );
+  }
+
+  return $form;
+}
+
+/**
  * Form constructor to test expansion of #type checkboxes and radios.
  */
 function form_test_checkboxes_radios($form, &$form_state, $customize = FALSE) {
