diff --git a/core/includes/common.inc b/core/includes/common.inc
index 5572e54..4f3e4d9 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -3181,7 +3181,7 @@ function drupal_render_page($page) {
  *   - The child elements of this element are sorted by weight using uasort() in
  *     \Drupal\Core\Render\Element::children(). Since this is expensive, when
  *     passing already sorted elements to drupal_render(), for example from a
- *     database query, set $elements['#sorted'] = TRUE to avoid sorting them a
+ *     database query, set $elements['#_sorted'] = TRUE to avoid sorting them a
  *     second time.
  *   - The main render phase to produce #children for this element takes place:
  *     - If this element has #theme defined and #theme is an implemented theme
diff --git a/core/includes/form.inc b/core/includes/form.inc
index 42206a4..1fbfcc6 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -671,7 +671,7 @@ function form_type_radios_value(&$element, $input = FALSE) {
     // unless it's empty. (An empty #default_value, such as NULL or FALSE, can
     // be used to indicate that no radio button is selected by default.)
     if (!isset($input) && !empty($element['#default_value'])) {
-      $element['#needs_validation'] = TRUE;
+      $element['#_needs_validation'] = TRUE;
     }
     return $input;
   }
@@ -2171,7 +2171,7 @@ function form_pre_render_group($element) {
     }
     // Re-sort the element's children if we injected group member elements.
     if (isset($sort)) {
-      $element['#sorted'] = FALSE;
+      $element['#_sorted'] = FALSE;
     }
   }
 
@@ -2783,7 +2783,7 @@ function form_pre_render_password($element) {
  * Expands a weight element into a select element.
  */
 function form_process_weight($element) {
-  $element['#is_weight'] = TRUE;
+  $element['#_is_weight'] = TRUE;
 
   // If the number of options is small enough, use a select field.
   $max_elements = \Drupal::config('system.site')->get('weight_select_max');
@@ -3036,7 +3036,7 @@ function _form_set_attributes(&$element, $class = array()) {
     $element['#attributes']['required'] = 'required';
     $element['#attributes']['aria-required'] = 'true';
   }
-  if (isset($element['#parents']) && isset($element['#errors']) && !empty($element['#validated'])) {
+  if (isset($element['#parents']) && isset($element['#errors']) && !empty($element['#_validated'])) {
     $element['#attributes']['class'][] = 'error';
     $element['#attributes']['aria-invalid'] = 'true';
   }
diff --git a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
index 2942038..1a36aa6 100644
--- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
+++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
@@ -113,7 +113,7 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la
     }
 
     $build_list = array(
-      '#sorted' => TRUE,
+      '#_sorted' => TRUE,
       '#pre_render' => array(array($this, 'buildMultiple')),
       '#langcode' => $langcode,
     );
diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php
index d3bedc1..da99913 100644
--- a/core/lib/Drupal/Core/Form/FormBuilder.php
+++ b/core/lib/Drupal/Core/Form/FormBuilder.php
@@ -302,17 +302,17 @@ public function rebuildForm($form_id, &$form_state, $old_form = NULL) {
     $form = $this->retrieveForm($form_id, $form_state);
 
     // If only parts of the form will be returned to the browser (e.g., Ajax or
-    // RIA clients), re-use the old #build_id to not require client-side code to
+    // RIA clients), re-use the old #_build_id to not require client-side code to
     // manually update the hidden 'build_id' input element.
-    // Otherwise, a new #build_id is generated, to not clobber the previous
+    // Otherwise, a new #_build_id is generated, to not clobber the previous
     // build's data in the form cache; also allowing the user to go back to an
     // earlier build, make changes, and re-submit.
     // @see self::prepareForm()
-    if (isset($old_form['#build_id']) && !empty($form_state['rebuild_info']['copy']['#build_id'])) {
-      $form['#build_id'] = $old_form['#build_id'];
+    if (isset($old_form['#_build_id']) && !empty($form_state['rebuild_info']['copy']['#_build_id'])) {
+      $form['#_build_id'] = $old_form['#_build_id'];
     }
     else {
-      $form['#build_id'] = 'form-' . Crypt::randomBytesBase64();
+      $form['#_build_id'] = 'form-' . Crypt::randomBytesBase64();
     }
 
     // #action defaults to request_uri(), but in case of Ajax and other partial
@@ -329,7 +329,7 @@ public function rebuildForm($form_id, &$form_state, $old_form = NULL) {
     // self::doBuildForm(), so we need to do it here.
     // @todo For Drupal 8, find a way to avoid this code duplication.
     if (empty($form_state['no_cache'])) {
-      $this->setCache($form['#build_id'], $form, $form_state);
+      $this->setCache($form['#_build_id'], $form, $form_state);
     }
 
     // Clear out all group associations as these might be different when
@@ -513,13 +513,13 @@ public function processForm($form_id, &$form, &$form_state) {
     // With GET, these forms are always submitted if requested.
     if ($form_state['method'] == 'get' && !empty($form_state['always_process'])) {
       if (!isset($form_state['input']['form_build_id'])) {
-        $form_state['input']['form_build_id'] = $form['#build_id'];
+        $form_state['input']['form_build_id'] = $form['#_build_id'];
       }
       if (!isset($form_state['input']['form_id'])) {
         $form_state['input']['form_id'] = $form_id;
       }
-      if (!isset($form_state['input']['form_token']) && isset($form['#token'])) {
-        $form_state['input']['form_token'] = $this->csrfToken->get($form['#token']);
+      if (!isset($form_state['input']['form_token']) && isset($form['#_token'])) {
+        $form_state['input']['form_token'] = $this->csrfToken->get($form['#_token']);
       }
     }
 
@@ -532,10 +532,10 @@ public function processForm($form_id, &$form, &$form_state) {
 
     // Only process the input if we have a correct form submission.
     if ($form_state['process_input']) {
-      // Form constructors may explicitly set #token to FALSE when cross site
+      // Form constructors may explicitly set #_token to FALSE when cross site
       // request forgery is irrelevant to the form, such as search forms.
-      if (isset($form['#token']) && $form['#token'] === FALSE) {
-        unset($form['#token']);
+      if (isset($form['#_token']) && $form['#_token'] === FALSE) {
+        unset($form['#_token']);
       }
       // Form values for programmed form submissions typically do not include a
       // value for the submit button. But without a triggering element, a
@@ -583,7 +583,7 @@ public function processForm($form_id, &$form, &$form_state) {
       // @todo Simplify this logic; considering Ajax and non-HTML front-ends,
       //   along with element-level #submit properties, it makes no sense to
       //   have divergent form execution based on whether the triggering element
-      //   has #executes_submit_callback set to TRUE.
+      //   has #_executes_submit_callback set to TRUE.
       if (($form_state['rebuild'] || !$form_state['executed']) && !$this->getAnyErrors()) {
         // Form building functions (e.g., self::handleInputElement()) may use
         // $form_state['rebuild'] to determine if they are running in the
@@ -601,7 +601,7 @@ public function processForm($form_id, &$form, &$form_state) {
     // request to accommodate new user input. Rebuilt forms are not cached here,
     // because self::rebuildForm() already takes care of that.
     if (!$form_state['rebuild'] && $form_state['cache'] && empty($form_state['no_cache'])) {
-      $this->setCache($form['#build_id'], $unprocessed_form, $form_state);
+      $this->setCache($form['#_build_id'], $unprocessed_form, $form_state);
     }
   }
 
@@ -619,19 +619,19 @@ public function prepareForm($form_id, &$form, &$form_state) {
       $form['#method'] = 'get';
     }
 
-    // Generate a new #build_id for this form, if none has been set already.
+    // Generate a new #_1111079-17.patchbuild_id for this form, if none has been set already.
     // The form_build_id is used as key to cache a particular build of the form.
     // For multi-step forms, this allows the user to go back to an earlier
     // build, make changes, and re-submit.
     // @see self::buildForm()
     // @see self::rebuildForm()
-    if (!isset($form['#build_id'])) {
-      $form['#build_id'] = 'form-' . Crypt::randomBytesBase64();
+    if (!isset($form['#_build_id'])) {
+      $form['#_build_id'] = 'form-' . Crypt::randomBytesBase64();
     }
     $form['form_build_id'] = array(
       '#type' => 'hidden',
-      '#value' => $form['#build_id'],
-      '#id' => $form['#build_id'],
+      '#value' => $form['#_build_id'],
+      '#id' => $form['#_build_id'],
       '#name' => 'form_build_id',
       // Form processing and validation requires this value, so ensure the
       // submitted form value appears literally, regardless of custom #tree
@@ -639,7 +639,7 @@ public function prepareForm($form_id, &$form, &$form_state) {
       '#parents' => array('form_build_id'),
     );
 
-    // Add a token, based on either #token or form_id, to any form displayed to
+    // Add a token, based on either #_token or form_id, to any form displayed to
     // authenticated users. This ensures that any submitted form was actually
     // requested previously by the user and protects against cross site request
     // forgeries.
@@ -648,18 +648,18 @@ public function prepareForm($form_id, &$form, &$form_state) {
     // very likely cached, we cannot assign a token for them.
     // During installation, there is no $user yet.
     if ($user && $user->isAuthenticated() && !$form_state['programmed']) {
-      // Form constructors may explicitly set #token to FALSE when cross site
+      // Form constructors may explicitly set #_token to FALSE when cross site
       // request forgery is irrelevant to the form, such as search forms.
-      if (isset($form['#token']) && $form['#token'] === FALSE) {
-        unset($form['#token']);
+      if (isset($form['#_token']) && $form['#_token'] === FALSE) {
+        unset($form['#_token']);
       }
       // Otherwise, generate a public token based on the form id.
       else {
-        $form['#token'] = $form_id;
+        $form['#_token'] = $form_id;
         $form['form_token'] = array(
           '#id' => $this->drupalHtmlId('edit-' . $form_id . '-form-token'),
           '#type' => 'token',
-          '#default_value' => $this->csrfToken->get($form['#token']),
+          '#default_value' => $this->csrfToken->get($form['#_token']),
           // Form processing and validation requires this value, so ensure the
           // submitted form value appears literally, regardless of custom #tree
           // and #parents being set elsewhere.
@@ -823,7 +823,7 @@ public function setError(&$element, array &$form_state, $message = '') {
    */
   public function doBuildForm($form_id, &$element, &$form_state) {
     // Initialize as unprocessed.
-    $element['#processed'] = FALSE;
+    $element['#_processed'] = FALSE;
 
     // Use element defaults.
     if (isset($element['#type']) && empty($element['#defaults_loaded']) && ($info = $this->getElementInfo($element['#type']))) {
@@ -883,15 +883,15 @@ public function doBuildForm($form_id, &$element, &$form_state) {
     }
     // Allow for elements to expand to multiple elements, e.g., radios,
     // checkboxes and files.
-    if (isset($element['#process']) && !$element['#processed']) {
+    if (isset($element['#process']) && !$element['#_processed']) {
       foreach ($element['#process'] as $process) {
         $element = call_user_func_array($process, array(&$element, &$form_state, &$form_state['complete_form']));
       }
-      $element['#processed'] = TRUE;
+      $element['#_processed'] = TRUE;
     }
 
     // We start off assuming all form elements are in the correct order.
-    $element['#sorted'] = TRUE;
+    $element['#_sorted'] = TRUE;
 
     // Recurse through all child elements.
     $count = 0;
@@ -939,7 +939,7 @@ public function doBuildForm($form_id, &$element, &$form_state) {
       else {
         // If one of the child elements has a weight then we will need to sort
         // later.
-        unset($element['#sorted']);
+        unset($element['#_sorted']);
       }
       $element[$key] = $this->doBuildForm($form_id, $element[$key], $form_state);
       $count++;
@@ -947,11 +947,11 @@ public function doBuildForm($form_id, &$element, &$form_state) {
 
     // The #after_build flag allows any piece of a form to be altered
     // after normal input parsing has been completed.
-    if (isset($element['#after_build']) && !isset($element['#after_build_done'])) {
+    if (isset($element['#after_build']) && !isset($element['#_after_build_done'])) {
       foreach ($element['#after_build'] as $callable) {
         $element = call_user_func_array($callable, array($element, &$form_state));
       }
-      $element['#after_build_done'] = TRUE;
+      $element['#_after_build_done'] = TRUE;
     }
 
     // If there is a file element, we need to flip a flag so later the
@@ -989,7 +989,7 @@ public function doBuildForm($form_id, &$element, &$form_state) {
 
       // If the triggering element executes submit handlers, then set the form
       // state key that's needed for those handlers to run.
-      if (!empty($form_state['triggering_element']['#executes_submit_callback'])) {
+      if (!empty($form_state['triggering_element']['#_executes_submit_callback'])) {
         $form_state['submitted'] = TRUE;
       }
 
@@ -1101,7 +1101,7 @@ protected function handleInputElement($form_id, &$element, &$form_state) {
         }
         // Mark all posted values for validation.
         if (isset($element['#value']) || (!empty($element['#required']))) {
-          $element['#needs_validation'] = TRUE;
+          $element['#_needs_validation'] = TRUE;
         }
       }
       // Load defaults.
diff --git a/core/lib/Drupal/Core/Form/FormBuilderInterface.php b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
index bf00f50..99b9d95 100644
--- a/core/lib/Drupal/Core/Form/FormBuilderInterface.php
+++ b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
@@ -251,7 +251,7 @@ public function getFormStateDefaults();
    * @param array $form_state
    *   A keyed array containing the current state of the form.
    * @param array|null $old_form
-   *   (optional) A previously built $form. Used to retain the #build_id and
+   *   (optional) A previously built $form. Used to retain the #_1111079-17.patchbuild_id and
    *   #action properties in Ajax callbacks and similar partial form rebuilds.
    *   The only properties copied from $old_form are the ones which both exist
    *   in $old_form and for which $form_state['rebuild_info']['copy'][PROPERTY]
diff --git a/core/lib/Drupal/Core/Form/FormValidator.php b/core/lib/Drupal/Core/Form/FormValidator.php
index eda8238..2d69549 100644
--- a/core/lib/Drupal/Core/Form/FormValidator.php
+++ b/core/lib/Drupal/Core/Form/FormValidator.php
@@ -90,8 +90,8 @@ public function validateForm($form_id, &$form, &$form_state) {
 
     // If the session token was set by self::prepareForm(), ensure that it
     // matches the current user's session.
-    if (isset($form['#token'])) {
-      if (!$this->csrfToken->validate($form_state['values']['form_token'], $form['#token'])) {
+    if (isset($form['#_token'])) {
+      if (!$this->csrfToken->validate($form_state['values']['form_token'], $form['#_token'])) {
         $url = $this->requestStack->getCurrentRequest()->getRequestUri();
 
         // Setting this error will cause the form to fail validation.
@@ -215,9 +215,9 @@ protected function doValidateForm(&$elements, &$form_state, $form_id = NULL) {
     }
 
     // Validate the current input.
-    if (!isset($elements['#validated']) || !$elements['#validated']) {
+    if (!isset($elements['#_validated']) || !$elements['#_validated']) {
       // The following errors are always shown.
-      if (isset($elements['#needs_validation'])) {
+      if (isset($elements['#_needs_validation'])) {
         $this->performRequiredValidation($elements, $form_state);
       }
 
@@ -225,7 +225,7 @@ protected function doValidateForm(&$elements, &$form_state, $form_id = NULL) {
       $form_state['limit_validation_errors'] = $this->determineLimitValidationErrors($form_state);
 
       // Make sure a value is passed when the field is required.
-      if (isset($elements['#needs_validation']) && $elements['#required']) {
+      if (isset($elements['#_needs_validation']) && $elements['#required']) {
         // A simple call to empty() will not cut it here as some fields, like
         // checkboxes, can return a valid value of '0'. Instead, check the
         // length if it's a string, and the item count if it's an array.
@@ -275,7 +275,7 @@ protected function doValidateForm(&$elements, &$form_state, $form_id = NULL) {
         }
       }
 
-      $elements['#validated'] = TRUE;
+      $elements['#_validated'] = TRUE;
     }
 
     // Done validating this element, so turn off error suppression.
@@ -366,7 +366,7 @@ protected function determineLimitValidationErrors(&$form_state) {
       return $form_state['triggering_element']['#limit_validation_errors'];
     }
     // If submit handlers won't run (due to the submission having been
-    // triggered by an element whose #executes_submit_callback property isn't
+    // triggered by an element whose #_executes_submit_callback property isn't
     // TRUE), then it's safe to suppress all validation errors, and we do so
     // by default, which is particularly useful during an Ajax submission
     // triggered by a non-button. An element can override this default by
diff --git a/core/lib/Drupal/Core/Render/Element.php b/core/lib/Drupal/Core/Render/Element.php
index 501f2de..374e189 100644
--- a/core/lib/Drupal/Core/Render/Element.php
+++ b/core/lib/Drupal/Core/Render/Element.php
@@ -70,7 +70,8 @@ public static function child($key) {
    */
   public static function children(array &$elements, $sort = FALSE) {
     // Do not attempt to sort elements which have already been sorted.
-    $sort = isset($elements['#sorted']) ? !$elements['#sorted'] : $sort;
+    $sort = isset($elements['#_sorted']) ? !$elements['#_sorted'] : $sort;
+    $sort = isset($elements['#_sorted']) ? !$elements['#_sorted'] : $sort;
 
     // Filter out properties from the element, leaving only children.
     $children = array();
@@ -100,7 +101,7 @@ public static function children(array &$elements, $sort = FALSE) {
         unset($elements[$key]);
         $elements[$key] = $child;
       }
-      $elements['#sorted'] = TRUE;
+      $elements['#_sorted'] = TRUE;
     }
 
     return array_keys($children);
diff --git a/core/modules/aggregator/src/Controller/AggregatorController.php b/core/modules/aggregator/src/Controller/AggregatorController.php
index d590b08..d6e71ce 100644
--- a/core/modules/aggregator/src/Controller/AggregatorController.php
+++ b/core/modules/aggregator/src/Controller/AggregatorController.php
@@ -185,7 +185,7 @@ public function sources() {
     $build = array(
       '#type' => 'container',
       '#attributes' => array('class' => array('aggregator-wrapper')),
-      '#sorted' => TRUE,
+      '#_sorted' => TRUE,
     );
 
     foreach ($feeds as $feed) {
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index 37b93bd..f893c44 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -161,7 +161,7 @@ function block_get_blocks_by_region($region) {
     // else in the render array, because that would cause the region to show up.
     if (!empty($build)) {
       // block_list() already returned the blocks in sorted order.
-      $build['#sorted'] = TRUE;
+      $build['#_sorted'] = TRUE;
     }
   }
   return $build;
diff --git a/core/modules/book/src/BookManager.php b/core/modules/book/src/BookManager.php
index c491cf4..6f710f9 100644
--- a/core/modules/book/src/BookManager.php
+++ b/core/modules/book/src/BookManager.php
@@ -559,7 +559,7 @@ public function bookTreeOutput(array $tree) {
     }
     if ($build) {
       // Make sure drupal_render() does not re-order the links.
-      $build['#sorted'] = TRUE;
+      $build['#_sorted'] = TRUE;
       // Add the theme wrapper for outer markup.
       // Allow book-specific theme overrides.
       $build['#theme_wrappers'][] = 'book_tree__book_toc_' . $data['link']['bid'];
diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index 335e0ad..849a31c 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -301,7 +301,7 @@ function color_palette_color_value($element, $input = FALSE, $form_state = array
     // Start with the provided value for this textfield, and validate that if
     // necessary, falling back on the default value.
     $value = form_type_textfield_value($element, $input, $form_state);
-    if (!$value || !isset($form_state['complete form']['#token']) || color_valid_hexadecimal_string($value) || drupal_valid_token($form_state['values']['form_token'], $form_state['complete form']['#token'])) {
+    if (!$value || !isset($form_state['complete form']['#_token']) || color_valid_hexadecimal_string($value) || drupal_valid_token($form_state['values']['form_token'], $form_state['complete form']['#_token'])) {
       return $value;
     }
     else {
diff --git a/core/modules/field/src/Plugin/views/field/Field.php b/core/modules/field/src/Plugin/views/field/Field.php
index ec794fd..50ece02 100644
--- a/core/modules/field/src/Plugin/views/field/Field.php
+++ b/core/modules/field/src/Plugin/views/field/Field.php
@@ -468,7 +468,7 @@ public function buildOptionsForm(&$form, &$form_state) {
         'path' => views_ui_build_form_path($form_state),
       ),
       '#submit' => array(array($this, 'submitTemporaryForm')),
-      '#executes_submit_callback' => TRUE,
+      '#_executes_submit_callback' => TRUE,
     );
 
     $form['field_api_classes'] = array(
diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module
index f25fe79..1c07bce 100644
--- a/core/modules/filter/filter.module
+++ b/core/modules/filter/filter.module
@@ -467,7 +467,7 @@ function filter_process_format($element) {
     '#prefix',
     '#suffix',
     '#attached',
-    '#processed',
+    '#_processed',
     '#theme_wrappers',
   );
   // Move this element into sub-element 'value'.
diff --git a/core/modules/menu_link/src/MenuTree.php b/core/modules/menu_link/src/MenuTree.php
index adbf85d..722421d 100644
--- a/core/modules/menu_link/src/MenuTree.php
+++ b/core/modules/menu_link/src/MenuTree.php
@@ -409,7 +409,7 @@ public function renderTree($tree) {
     }
     if ($build) {
       // Make sure drupal_render() does not re-order the links.
-      $build['#sorted'] = TRUE;
+      $build['#_sorted'] = TRUE;
       // Add the theme wrapper for outer markup.
       // Allow menu-specific theme overrides.
       $build['#theme_wrappers'][] = 'menu_tree__' . strtr($menu_name, '-', '_');
diff --git a/core/modules/search/src/Form/SearchBlockForm.php b/core/modules/search/src/Form/SearchBlockForm.php
index dafe312..6486886 100644
--- a/core/modules/search/src/Form/SearchBlockForm.php
+++ b/core/modules/search/src/Form/SearchBlockForm.php
@@ -64,7 +64,7 @@ public function buildForm(array $form, array &$form_state) {
 
     $route = 'search.view_' . $entity_id;
     $form['#action'] = $this->url($route);
-    $form['#token'] = FALSE;
+    $form['#_token'] = FALSE;
     $form['#method'] = 'get';
 
     $form['keys'] = array(
diff --git a/core/modules/system/src/Controller/FormAjaxController.php b/core/modules/system/src/Controller/FormAjaxController.php
index f1645a7..03035f3 100644
--- a/core/modules/system/src/Controller/FormAjaxController.php
+++ b/core/modules/system/src/Controller/FormAjaxController.php
@@ -88,10 +88,10 @@ protected function getForm(Request $request) {
     // Since some of the submit handlers are run, redirects need to be disabled.
     $form_state['no_redirect'] = TRUE;
 
-    // When a form is rebuilt after Ajax processing, its #build_id and #action
+    // When a form is rebuilt after Ajax processing, its #_1111079-17.patchbuild_id and #action
     // should not change.
     // @see drupal_rebuild_form()
-    $form_state['rebuild_info']['copy']['#build_id'] = TRUE;
+    $form_state['rebuild_info']['copy']['#_build_id'] = TRUE;
     $form_state['rebuild_info']['copy']['#action'] = TRUE;
 
     // The form needs to be processed; prepare for that by setting a few internal
diff --git a/core/modules/system/src/Tests/Common/RenderTest.php b/core/modules/system/src/Tests/Common/RenderTest.php
index 8edbb07..c4173a0 100644
--- a/core/modules/system/src/Tests/Common/RenderTest.php
+++ b/core/modules/system/src/Tests/Common/RenderTest.php
@@ -303,8 +303,8 @@ function testDrupalRenderSorting() {
     // The lowest weight element should appear last in $output.
     $this->assertTrue(strpos($output, $second) > strpos($output, $first), 'Elements were sorted correctly by weight.');
 
-    // Confirm that the $elements array has '#sorted' set to TRUE.
-    $this->assertTrue($elements['#sorted'], "'#sorted' => TRUE was added to the array");
+    // Confirm that the $elements array has '#_sorted' set to TRUE.
+    $this->assertTrue($elements['#_sorted'], "'#_sorted' => TRUE was added to the array");
 
     // Pass $elements through \Drupal\Core\Render\Element::children() and
     // ensure it remains sorted in the correct order. drupal_render() will
@@ -314,7 +314,7 @@ function testDrupalRenderSorting() {
     $this->assertTrue(array_shift($children) == 'second', 'Child found in the correct order.');
 
 
-    // The same array structure again, but with #sorted set to TRUE.
+    // The same array structure again, but with #_sorted set to TRUE.
     $elements = array(
       'second' => array(
         '#weight' => 10,
@@ -324,7 +324,7 @@ function testDrupalRenderSorting() {
         '#weight' => 0,
         '#markup' => $first,
       ),
-      '#sorted' => TRUE,
+      '#_sorted' => TRUE,
     );
     $output = drupal_render($elements);
 
diff --git a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
index 9ce3fb2..b71d654 100644
--- a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
+++ b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
@@ -218,7 +218,7 @@ private function formSubmitHelper($form, $edit) {
     $form['op'] = array('#type' => 'submit', '#value' => t('Submit'));
     // The form token CSRF protection should not interfere with this test, so we
     // bypass it by setting the token to FALSE.
-    $form['#token'] = FALSE;
+    $form['#_token'] = FALSE;
 
     $form_state['input'] = $edit;
     $form_state['input']['form_id'] = $form_id;
diff --git a/core/modules/system/src/Tests/Form/FormTest.php b/core/modules/system/src/Tests/Form/FormTest.php
index e45defc..ad840d5 100644
--- a/core/modules/system/src/Tests/Form/FormTest.php
+++ b/core/modules/system/src/Tests/Form/FormTest.php
@@ -117,7 +117,7 @@ function testRequiredFields() {
           $form_state['method'] = 'post';
           // The form token CSRF protection should not interfere with this test,
           // so we bypass it by setting the token to FALSE.
-          $form['#token'] = FALSE;
+          $form['#_token'] = FALSE;
           drupal_prepare_form($form_id, $form, $form_state);
           drupal_process_form($form_id, $form, $form_state);
           $errors = form_get_errors($form_state);
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 6bd8dd4..2237073 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -328,7 +328,7 @@ function system_element_info() {
     '#input' => TRUE,
     '#name' => 'op',
     '#is_button' => TRUE,
-    '#executes_submit_callback' => TRUE,
+    '#_executes_submit_callback' => TRUE,
     '#limit_validation_errors' => FALSE,
     '#process' => array('form_process_button', 'ajax_process_form'),
     '#pre_render' => array('form_pre_render_button'),
@@ -338,7 +338,7 @@ function system_element_info() {
     '#input' => TRUE,
     '#name' => 'op',
     '#is_button' => TRUE,
-    '#executes_submit_callback' => FALSE,
+    '#_executes_submit_callback' => FALSE,
     '#limit_validation_errors' => FALSE,
     '#process' => array('form_process_button', 'ajax_process_form'),
     '#pre_render' => array('form_pre_render_button'),
@@ -347,7 +347,7 @@ function system_element_info() {
   $types['image_button'] = array(
     '#input' => TRUE,
     '#is_button' => TRUE,
-    '#executes_submit_callback' => TRUE,
+    '#_executes_submit_callback' => TRUE,
     '#limit_validation_errors' => FALSE,
     '#process' => array('form_process_button', 'ajax_process_form'),
     '#return_value' => TRUE,
diff --git a/core/modules/tracker/tracker.pages.inc b/core/modules/tracker/tracker.pages.inc
index 30c7915..5c740e6 100644
--- a/core/modules/tracker/tracker.pages.inc
+++ b/core/modules/tracker/tracker.pages.inc
@@ -107,7 +107,7 @@ function tracker_page($account = NULL) {
     '#theme' => 'pager',
     '#weight' => 10,
   );
-  $page['#sorted'] = TRUE;
+  $page['#_sorted'] = TRUE;
 
   return $page;
 }
diff --git a/core/modules/user/src/Tests/UserAccountFormFieldsTest.php b/core/modules/user/src/Tests/UserAccountFormFieldsTest.php
index 7785ccb..e02ba65 100644
--- a/core/modules/user/src/Tests/UserAccountFormFieldsTest.php
+++ b/core/modules/user/src/Tests/UserAccountFormFieldsTest.php
@@ -109,12 +109,12 @@ protected function assertFieldOrder(array $elements) {
       if ($key === 'name') {
         $name_index = $index;
         $name_weight = $element['#weight'];
-        $this->assertTrue($element['#sorted'], "'name' field is #sorted.");
+        $this->assertTrue($element['#_sorted'], "'name' field is #_sorted.");
       }
       elseif ($key === 'pass') {
         $pass_index = $index;
         $pass_weight = $element['#weight'];
-        $this->assertTrue($element['#sorted'], "'pass' field is #sorted.");
+        $this->assertTrue($element['#_sorted'], "'pass' field is #_sorted.");
       }
       $index++;
     }
diff --git a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
index 03ba5eb..71032a6 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
@@ -308,19 +308,19 @@ public function testRebuildForm() {
     // Do an initial build of the form and track the build ID.
     $form_state = array();
     $form = $this->formBuilder->buildForm($form_arg, $form_state);
-    $original_build_id = $form['#build_id'];
+    $original_build_id = $form['#_build_id'];
 
     // Rebuild the form, and assert that the build ID has not changed.
     $form_state['rebuild'] = TRUE;
     $form_state['input']['form_id'] = $form_id;
-    $form_state['rebuild_info']['copy']['#build_id'] = TRUE;
+    $form_state['rebuild_info']['copy']['#_build_id'] = TRUE;
     $this->formBuilder->processForm($form_id, $form, $form_state);
-    $this->assertSame($original_build_id, $form['#build_id']);
+    $this->assertSame($original_build_id, $form['#_build_id']);
 
     // Rebuild the form again, and assert that there is a new build ID.
     $form_state['rebuild_info'] = array();
     $form = $this->formBuilder->buildForm($form_arg, $form_state);
-    $this->assertNotSame($original_build_id, $form['#build_id']);
+    $this->assertNotSame($original_build_id, $form['#_build_id']);
   }
 
   /**
@@ -329,7 +329,7 @@ public function testRebuildForm() {
   public function testGetCache() {
     $form_id = 'test_form_id';
     $expected_form = $form_id();
-    $expected_form['#token'] = FALSE;
+    $expected_form['#_token'] = FALSE;
 
     // FormBuilder::buildForm() will be called twice, but the form object will
     // only be called once due to caching.
@@ -373,7 +373,7 @@ public function testGetCache() {
     // The final form build will not trigger any actual form building, but will
     // use the form cache.
     $form_state['input']['form_id'] = $form_id;
-    $form_state['input']['form_build_id'] = $form['#build_id'];
+    $form_state['input']['form_build_id'] = $form['#_build_id'];
     $this->formBuilder->buildForm($form_id, $form_state);
     $this->assertEmpty($form_state['errors']);
   }
diff --git a/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php b/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
index efb06c4..3a945f0 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
@@ -134,7 +134,7 @@ public function testValidateInvalidFormToken() {
     $form_validator->expects($this->never())
       ->method('doValidateForm');
 
-    $form['#token'] = 'test_form_id';
+    $form['#_token'] = 'test_form_id';
     $form_state = $this->getFormStateDefaults();
     $form_state['values']['form_token'] = 'some_random_token';
     $form_validator->validateForm('test_form_id', $form, $form_state);
@@ -162,7 +162,7 @@ public function testValidateValidFormToken() {
     $form_validator->expects($this->once())
       ->method('doValidateForm');
 
-    $form['#token'] = 'test_form_id';
+    $form['#_token'] = 'test_form_id';
     $form_state = $this->getFormStateDefaults();
     $form_state['values']['form_token'] = 'some_random_token';
     $form_validator->validateForm('test_form_id', $form, $form_state);
@@ -442,7 +442,7 @@ public function testRequiredErrorMessage($element, $expected_message) {
     $form['test'] = $element + array(
       '#type' => 'textfield',
       '#value' => '',
-      '#needs_validation' => TRUE,
+      '#_needs_validation' => TRUE,
       '#required' => TRUE,
       '#parents' => array('test'),
     );
@@ -522,7 +522,7 @@ public function testPerformRequiredValidation($element, $expected_message, $call
     $form = array();
     $form['test'] = $element + array(
       '#title' => 'Test',
-      '#needs_validation' => TRUE,
+      '#_needs_validation' => TRUE,
       '#required' => FALSE,
       '#parents' => array('test'),
     );
diff --git a/core/tests/Drupal/Tests/Core/Render/ElementTest.php b/core/tests/Drupal/Tests/Core/Render/ElementTest.php
index 9503f2d..2cd1e40 100644
--- a/core/tests/Drupal/Tests/Core/Render/ElementTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/ElementTest.php
@@ -81,18 +81,18 @@ public function testChildren() {
     $element_copy = $element;
     $this->assertSame($expected, Element::children($element_copy));
 
-    // If #sorted is already set, no sorting should happen.
+    // If #_sorted is already set, no sorting should happen.
     $element_copy = $element;
-    $element_copy['#sorted'] = TRUE;
+    $element_copy['#_sorted'] = TRUE;
     $expected = array('child2', 'child1', 'child3');
     $this->assertSame($expected, Element::children($element_copy, TRUE));
 
-    // Test with weight sorting, #sorted property should be added.
+    // Test with weight sorting, #_sorted property should be added.
     $expected = array('child1', 'child2', 'child3');
     $element_copy = $element;
     $this->assertSame($expected, Element::children($element_copy, TRUE));
-    $this->assertArrayHasKey('#sorted', $element_copy);
-    $this->assertTrue($element_copy['#sorted']);
+    $this->assertArrayHasKey('#_sorted', $element_copy);
+    $this->assertTrue($element_copy['#_sorted']);
 
     // The order should stay the same if no weights present.
     $element_no_weight = array(
