diff --git a/core/modules/editor/editor.api.php b/core/modules/editor/editor.api.php
new file mode 100644
index 0000000..70b6b53
--- /dev/null
+++ b/core/modules/editor/editor.api.php
@@ -0,0 +1,177 @@
+<?php
+
+/**
+ * @file
+ * Documentation for editor API.
+ */
+
+/**
+ * @addtogroup hooks
+ * @{
+ */
+
+/**
+ * Define text editors, such as WYSIWYGs or toolbars to assist with text input.
+ *
+ * Text editors are bound to an individual text format. When a format is
+ * activated in a 'text_format' element, the text editor associated with the
+ * format should be activated on the text area.
+ *
+ * @return
+ *   An associative array of editors, whose keys are internal editor names,
+ *   which should be unique and therefore prefixed with the name of the module.
+ *   Each value is an associative array describing the editor, with the
+ *   following elements (all are optional except as noted):
+ *   - title: (required) A human readable name for the editor.
+ *   - settings callback: The name of a function that returns configuration
+ *     form elements for the editor. See hook_editor_EDITOR_settings() for
+ *     details.
+ *   - default settings: An associative array containing default settings for
+ *     the editor, to be applied when the editor has not been configured yet.
+ *   - js settings callback: The name of a function that returns configuration
+ *     options that should be added to the page via JavaScript for use on the
+ *     client side. See hook_editor_EDITOR_js_settings() for details.
+ *
+ * @see filter_example.module
+ * @see hook_filter_info_alter()
+ */
+function hook_editor_info() {
+  $editors['myeditor'] = array(
+    'title' => t('My Editor'),
+    'settings callback' => '_myeditor_settings',
+    'default settings' => array(
+      'enable_toolbar' => TRUE,
+      'toolbar_buttons' => array('bold', 'italic', 'underline', 'link', 'image'),
+      'resizeable' => TRUE,
+    ),
+    'js settings callback' => '_myeditor_js_settings',
+  );
+  return $editors;
+}
+
+/**
+ * Perform alterations on editor definitions.
+ *
+ * @param $editors
+ *   Array of information on editors exposed by hook_editor_info()
+ *   implementations.
+ */
+function hook_editor_info_alter(&$editors) {
+  $editors['some_other_editor']['title'] = t('A different name');
+}
+
+/**
+ * Perform alterations on the JavaScript settings that are added for filters.
+ *
+ * Note that changing settings here only affects the client side behavior of the
+ * filter. To affect the filter globally both on the client side and server
+ * side, use hook_filter_info_alter().
+ *
+ * @param array $settings
+ *   All the settings that will be added to the page via drupal_add_js() for
+ *   the text formats to which a user has access.
+ * @param array $formats
+ *   The list of format objects for which settings are being added.
+ */
+function hook_editor_js_settings_alter(&$settings, $formats) {
+  if (isset($formats['filtered_html'])) {
+    $settings['filtered_html']['allowedTags'][] = 'strong';
+    $settings['filtered_html']['allowedTags'][] = 'em';
+    $settings['filtered_html']['allowedTags'][] = 'img';
+  }
+}
+
+/**
+ * @} End of "addtogroup hooks".
+ */
+
+/**
+ * Settings callback for hook_editor_info().
+ *
+ * Note: This is not really a hook. The function name is manually specified via
+ * 'settings callback' in hook_editor_info(), with this recommended callback
+ * name pattern. It is called from filter_admin_format_form().
+ *
+ * This callback function is used to provide a settings form for editor
+ * settings. This function should return the form elements for the settings; the
+ * Filter module will take care of saving the settings in the database.
+ *
+ * If the editor's behavior depends on an extensive list and/or external data,
+ * then the editor module can choose to provide a separate, global configuration
+ * page rather than per-text-format settings. In that case, the settings
+ * callback function should provide a link to the separate settings page.
+ *
+ * @param $form
+ *   The prepopulated form array of the filter administration form.
+ * @param $form_state
+ *   The state of the (entire) configuration form.
+ * @param $editor
+ *   The editor object being configured.
+ * @param $format
+ *   The format object being configured.
+ *
+ * @return
+ *   An array of form elements defining settings for the filter. Array keys
+ *   should match the array keys in $filter->settings and $defaults.
+ */
+function hook_editor_EDITOR_settings($form, &$form_state, $editor, $format) {
+  $elements = array();
+  $elements['enable_toolbar'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Enable toolbar'),
+    '#default_value' => $format->settings['enable_toolbar'],
+  );
+  $elements['buttons'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Enabled buttons'),
+    '#options' => array(
+      'bold' => t('Bold'),
+      'italic' => t('Italic'),
+      'underline' => t('Underline'),
+      'link' => t('Link'),
+      'image' => t('Image'),
+    ),
+    '#default_value' => $format->settings['buttons'],
+  );
+  $elements['resizeable'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Resizeable'),
+    '#default_value' => $format->settings['resizeable'],
+  );
+  return $elements;
+}
+
+/**
+ * JavaScript settings callback for hook_editor_info().
+ *
+ * Note: This is not really a hook. The function name is manually specified via
+ * 'js settings callback' in hook_editor_info(), with this recommended callback
+ * name pattern. It is called from filter_get_js_settings().
+ *
+ * Most editors use JavaScript to provide a WYSIWYG or toolbar on the client
+ * side interface. This callback can be used to convert internal settings of the
+ * editor into JavaScript variables that will be accessible when the editor
+ * is loaded.
+ *
+ * @param $editor
+ *   The editor object containing settings for the editor.
+ * @param $format
+ *   The format object on which this editor will be used.
+ * @param $filters
+ *   The complete list of filter objects that are enabled for the given format.
+ * @param $existing_settings
+ *   The existing settings that have so far been added to the page, including
+ *   all settings by individual filters. The existing settings added by filters
+ *   can be used to adjust the editor-specific settings.
+ *
+ * @return
+ *   An array of settings that will be added to the page for use by this
+ *   editor's JavaScript integration.
+ */
+function hook_editor_EDITOR_js_settings($editor, $format, $filters, $existing_settings) {
+  return array(
+    'toolbar' => $editor->settings['enable_toolbar'],
+    'buttons' => $editor->settings['buttons'],
+    'resizeable' => $editor->settings['resizeable'],
+  );
+}
diff --git a/core/modules/editor/editor.info b/core/modules/editor/editor.info
new file mode 100644
index 0000000..783557a
--- /dev/null
+++ b/core/modules/editor/editor.info
@@ -0,0 +1,6 @@
+name = Editor
+description = "Provides a framework for integrating client side editor libraries such as WYSIWYGs or toolbars."
+package = Core
+version = VERSION
+core = 8.x
+configure = admin/config/content/formats
diff --git a/core/modules/editor/editor.js b/core/modules/editor/editor.js
new file mode 100644
index 0000000..9af3130
--- /dev/null
+++ b/core/modules/editor/editor.js
@@ -0,0 +1,80 @@
+/**
+ * @file
+ * Attaches behavior for the Editor module.
+ */
+
+(function ($) {
+
+"use strict";
+
+/**
+ * Initialize an empty object where editors where place their attachment code.
+ */
+Drupal.editors = {};
+
+/**
+ * Enables editors on text_format elements.
+ */
+Drupal.behaviors.editors = {
+  attach: function (context, settings) {
+    // If there are no editor settings, there are no editors to enable.
+    if (!settings.editor) {
+      return;
+    }
+
+    var $context = $(context);
+    $context.find('.filter-list:input').once('editors', function () {
+      var $this = $(this);
+      var activeEditor = $this.val();
+      var field = $this.closest('.text-format-wrapper').find('textarea').get(-1);
+
+      // Directly attach this editor, if the input format is enabled or there is
+      // only one input format at all.
+      if ($this.is(':input')) {
+        if (Drupal.settings.editor.formats[activeEditor]) {
+          Drupal.editorAttach(field, Drupal.settings.editor.formats[activeEditor]);
+        }
+      }
+      // Attach onChange handlers to input format selector elements.
+      if ($this.is('select')) {
+        $this.on('change.editorAttach', function() {
+          // Prevent double-binding if the change event is triggered manually.
+          if ($this.val() === activeEditor) {
+            return;
+          }
+
+          // Detach the current editor (if any) and attach a new editor.
+          if (Drupal.settings.editor.formats[activeEditor]) {
+            Drupal.editorDetach(field, Drupal.settings.editor.formats[activeEditor]);
+          }
+          activeEditor = $this.val();
+          if (Drupal.settings.editor.formats[activeEditor]) {
+            Drupal.editorAttach(field, Drupal.settings.editor.formats[activeEditor]);
+          }
+        });
+      }
+      // Detach any editor when the containing form is submitted.
+      $this.parents('form').submit(function (event) {
+        // Do not detach if the event was canceled.
+        if (event.isDefaultPrevented()) {
+          return;
+        }
+        Drupal.editorDetach(field, Drupal.settings.editor.formats[activeEditor]);
+      });
+    });
+  }
+};
+
+Drupal.editorAttach = function(field, format) {
+  if (format.editor) {
+    Drupal.editors[format.editor].attach(field, format);
+  }
+};
+
+Drupal.editorDetach = function(field, format) {
+  if (format.editor) {
+    Drupal.editors[format.editor].detach(field, format);
+  }
+};
+
+})(jQuery);
diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module
new file mode 100644
index 0000000..81a4f1d
--- /dev/null
+++ b/core/modules/editor/editor.module
@@ -0,0 +1,299 @@
+<?php
+
+/**
+ * @file
+ * Provides bindings between Filter module text formats and client side editors.
+ */
+
+use Drupal\Component\Uuid\Uuid;
+use Drupal\file\Plugin\Core\Entity\File;
+use Drupal\editor\Plugin\Core\Entity\Editor;
+
+/**
+ * Implements hook_menu_alter().
+ *
+ * Rewrites the menu entries for filter module that relate to the configuration
+ * of editors.
+ */
+function editor_menu_alter(&$items) {
+  $items['admin/config/content/formats']['title'] = 'Text formats and editors';
+  $items['admin/config/content/formats']['description'] = 'Configure the processing of text, including toolbars or WYSIWYG editors used on input, and allowed HTML tags and automatic formatting used on output.';
+}
+
+/**
+ * Returns a list of text editors that may be used with 'text_format' elements.
+ *
+ * @return array
+ *   A list of possible editors keyed by the editor name.
+ *
+ * @see hook_editor_info()
+ * @see hook_editor_info_alter()
+ */
+function editor_info() {
+  $editors = &drupal_static(__FUNCTION__, NULL);
+
+  if (!isset($editors)) {
+    $editors = module_invoke_all('editor_info');
+    drupal_alter('editor_info', $editors);
+  }
+
+  return $editors;
+}
+
+/**
+ * Implements hook_element_info().
+ *
+ * Extends the functionality of text_format elements (provided by Filter
+ * module), so that selecting a text format notifies a client side editor when
+ * it should be enabled or disabled.
+ *
+ * @see filter_element_info()
+ */
+function editor_element_info() {
+  $type['text_format'] = array(
+    '#process' => array('editor_process_format'),
+  );
+  return $type;
+}
+
+
+/**
+ * Implements hook_library_info().
+ */
+function editor_library_info() {
+  $libraries['drupal.editor'] = array(
+    'title' => 'Editor',
+    'version' => VERSION,
+    'js' => array(
+      drupal_get_path('module', 'editor') . '/editor.js' => array('group' => JS_LIBRARY),
+    ),
+    'dependencies' => array(
+      array('system', 'jquery'),
+      array('system', 'drupal'),
+      array('system', 'jquery.once'),
+    ),
+  );
+
+  return $libraries;
+}
+
+/**
+ * Implements hook_preprocess_HOOK() for theme_filter_admin_overview().
+ */
+function editor_preprocess_filter_admin_overview(&$variables) {
+  $editor_info = editor_info();
+
+  // Splice in the column for "Associated editor" into the header.
+  $position = array_search('name', $variables['header']) + 1;
+  $start = array_splice($variables['header'], 0, $position, array('editor' => t('Associated editor')));
+  $variables['header'] = array_merge($start, $variables['header']);
+
+  // Then splice in the name of each editor for each text format.
+  foreach ($variables['rows'] as $format_id => $row) {
+    $editor = editor_load($format_id);
+    $editor_name = $editor && isset($editor_info[$editor->editor]) ? $editor_info[$editor->editor]['label'] : drupal_placeholder(t('None'));
+    $start = array_splice($variables['rows'][$format_id]['data'], 0, $position, array('editor' => $editor_name));
+    $variables['rows'][$format_id]['data'] = array_merge($start, $variables['rows'][$format_id]['data']);
+  }
+}
+
+/**
+ * Implements hook_form_FORM_ID_alter().
+ */
+function editor_form_filter_admin_format_form_alter(&$form, &$form_state) {
+  $format = $form['#format'];
+  $editor = editor_load($format->format);
+
+  // Check if we're switching to a different editor and load that form.
+  if (isset($form_state['values']['editor'])) {
+    if ($form_state['values']['editor'] === '') {
+      $editor = FALSE;
+    }
+    elseif (empty($editor) || $form_state['values']['editor'] !== $editor->editor) {
+      $editor = entity_create('editor', array(
+        'name' => $format->name,
+        'format' => $format->format,
+        'editor' => $form_state['values']['editor'],
+      ));
+    }
+  }
+
+  // Associate an editor with this format.
+  $editor_list = editor_info();
+  $editor_options = array('' => t('None'));
+  foreach ($editor_list as $editor_name => $editor_info) {
+    $editor_options[$editor_name] = $editor_info['label'];
+  }
+  $form['editor'] = array(
+    '#type' => 'select',
+    '#title' => t('Editor'),
+    '#options' => $editor_options,
+    '#default_value' => $editor ? $editor->editor : '',
+    '#weight' => -9,
+    '#ajax' => array(
+      'callback' => 'editor_form_filter_admin_form_ajax',
+      'wrapper' => 'editor-settings-wrapper',
+    ),
+  );
+
+  // If there aren't any options (other than "None") disable the select list.
+  if (count($editor_options) === 1) {
+    $form['editor']['#disabled'] = TRUE;
+    $form['editor']['#description'] = t('This option is disabled because no modules that provide an editor are currently enabled.');
+  }
+
+  $form['editor_settings'] = array(
+    '#tree' => TRUE,
+    '#weight' => -8,
+    '#type' => 'group',
+    '#prefix' => '<div id="editor-settings-wrapper">',
+    '#suffix' => '</div>',
+  );
+  if ($editor && isset($editor_list[$editor->editor]['settings callback'])) {
+    $function = $editor_list[$editor->editor]['settings callback'];
+    $form['editor_settings'] = array_merge($form['editor_settings'], $function($form, $form_state, $editor, $format));
+  }
+
+  $form['#submit'][] = 'editor_form_filter_admin_format_submit';
+}
+
+/**
+ * AJAX submit handler for filter_admin_format_form().
+ */
+function editor_form_filter_admin_form_ajax($form, &$form_state) {
+  return $form['editor_settings'];
+}
+
+/**
+ * Additional submit handler for filter_admin_format_form().
+ */
+function editor_form_filter_admin_format_submit($form, &$form_state) {
+  $format = $form['#format'];
+  $editor = editor_load($format->format);
+
+  // Create or update the editor.
+  if ($form_state['values']['editor']) {
+    if (!$editor) {
+      $editor = entity_create('editor', array());
+    }
+    $editor->format = $format->format;
+    $editor->name = $format->name;
+    $editor->editor = $form_state['values']['editor'];
+    if (isset($form_state['values']['editor_settings'])) {
+      $editor->settings = $form_state['values']['editor_settings'];
+    }
+    $editor->save();
+  }
+  // Delete the editor if one exists.
+  elseif ($editor) {
+    $editor->delete();
+  }
+}
+
+/**
+ * Loads an individual editor configuration based on format ID.
+ */
+function editor_load($format_id) {
+  $editors = entity_load_multiple('editor');
+  return isset($editors[$format_id]) ? $editors[$format_id] : FALSE;
+}
+
+/**
+ * Additional #process callback on 'text_format' elements.
+ */
+function editor_process_format($element) {
+  global $user;
+
+  $formats = filter_formats($user);
+  editor_add_js($formats);
+
+  return $element;
+}
+
+/**
+ * Adds filter configuration information to the page for access by JavaScript.
+ *
+ * @param array $formats
+ *   An array of formats as returned by filter_formats(), whose settings should
+ *   be added to the page.
+ * @return NULL
+ *   This function has no return value, the settings are added to the page
+ *   through drupal_add_js().
+ */
+function editor_add_js($formats) {
+  $added = &drupal_static(__FUNCTION__, array());
+  $editor_info = editor_info();
+
+  foreach ($formats as $format_id => $format_info) {
+    if (isset($added[$format_id])) {
+      unset($formats[$format_id]);
+    }
+    else {
+      // Add the library associated with a format's editor if needed.
+      $editor = editor_load($format_id);
+      if ($editor && isset($editor_info[$editor->editor])) {
+        drupal_add_library($editor_info[$editor->editor]['library'][0], $editor_info[$editor->editor]['library'][1]);
+      }
+      $added[$format_id] = TRUE;
+    }
+  }
+
+  if (!empty($formats)) {
+    $settings = editor_get_js_settings($formats);
+    drupal_add_js(array('editor' => array('formats' => $settings)), 'setting');
+  }
+}
+
+/**
+ * Retrieve JavaScript settings that should be added by each filter.
+ *
+ * @param array $formats
+ *   An array of formats as returned by filter_formats().
+ * @return array
+ *   An array of JavaScript settings representing the configuration of the
+ *   filters.
+ */
+function editor_get_js_settings($formats) {
+  $settings = array();
+  $editor_info = editor_info();
+
+  foreach ($formats as $format_id => $format) {
+    // Don't add settings for formats that don't have associated editors.
+    $editor = editor_load($format_id);
+    if (!$editor) {
+      continue;
+    }
+
+    $settings[$format_id] = array(
+      'editor' => $editor->editor,
+      'editorSettings' => array(),
+    );
+
+    if ($editor->editor && isset($editor_info[$editor->editor]['js settings callback'])) {
+      $function = $editor_info[$editor->editor]['js settings callback'];
+      $settings[$format_id]['editorSettings'] = $function($editor, $format, $format_filters, $settings);
+    }
+  }
+
+  drupal_alter('editor_js_settings', $settings, $formats);
+
+  return $settings;
+}
+
+/**
+ * Implements hook_filter_info_alter().
+ *
+ * Provides editor module callbacks on behalf of Filter module.
+ */
+function editor_filter_info_alter(&$filters) {
+  $filters['filter_url']['editor js settings callback'] = '_editor_filter_url_js_settings';
+}
+
+/**
+ * Filter URL JS settings callback: return settings for JavaScript.
+ */
+function _editor_filter_url_js_settings($filter, $format, $defaults) {
+  return array(
+    'filterUrlLength' => $filter->settings['filter_url_length'],
+  );
+}
diff --git a/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php b/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php
new file mode 100644
index 0000000..366451b
--- /dev/null
+++ b/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php
@@ -0,0 +1,81 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\editor\Plugin\Core\Entity\Editor.
+ */
+
+namespace Drupal\editor\Plugin\Core\Entity;
+
+use Drupal\Core\Config\Entity\ConfigEntityBase;
+use Drupal\Core\Annotation\Plugin;
+use Drupal\Core\Annotation\Translation;
+
+/**
+ * Defines an image style configuration entity.
+ *
+ * @Plugin(
+ *   id = "editor",
+ *   label = @Translation("Editor"),
+ *   module = "editor",
+ *   controller_class = "Drupal\Core\Config\Entity\ConfigStorageController",
+ *   config_prefix = "editor.editor",
+ *   entity_keys = {
+ *     "id" = "format",
+ *     "label" = "name",
+ *     "editor" = "editor",
+ *     "uuid" = "uuid"
+ *   }
+ * )
+ */
+class Editor extends ConfigEntityBase {
+
+  /**
+   * The format to which this editor is bound.
+   *
+   * @var string
+   */
+  public $format;
+
+  /**
+   * The editor format label.
+   *
+   * @var string
+   */
+  public $name;
+
+  /**
+   * The name of the editor library.
+   *
+   * @var string
+   */
+  public $editor;
+
+  /**
+   * The array of settings for this editor.
+   *
+   * @var array
+   */
+  public $settings = array();
+
+  /**
+   * Overrides Drupal\Core\Entity\Entity::id().
+   */
+  public function id() {
+    return $this->format;
+  }
+
+  /**
+   * Overrides Drupal\Core\Entity\Entity::__construct()
+   */
+  public function __construct(array $values, $entity_type) {
+    parent::__construct($values, $entity_type);
+
+    // Initialize settings to the defaults, merging any passed in settings.
+    $editor_info = editor_info();
+    if (isset($editor_info[$this->editor]['default settings'])) {
+      $this->settings = array_merge($editor_info[$this->editor]['default settings'], $this->settings);
+    }
+  }
+
+}
diff --git a/core/modules/filter/filter.admin.inc b/core/modules/filter/filter.admin.inc
index 4f56856..478c46b 100644
--- a/core/modules/filter/filter.admin.inc
+++ b/core/modules/filter/filter.admin.inc
@@ -75,33 +75,50 @@ function filter_admin_overview_submit($form, &$form_state) {
 }
 
 /**
+ * Theme preprocess function for theme_filter_admin_overview().
+ *
+ * @see theme_filter_admin_overview()
+ */
+function template_preprocess_filter_admin_overview(&$variables) {
+  $form = &$variables['form'];
+  $variables['rows'] = array();
+  foreach (element_children($form['formats']) as $id) {
+    $form['formats'][$id]['weight']['#attributes']['class'] = array('text-format-order-weight');
+    $row = array(
+      'data' => array(
+        'name' => drupal_render($form['formats'][$id]['name']),
+        'roles' => drupal_render($form['formats'][$id]['roles']),
+        'weight' => drupal_render($form['formats'][$id]['weight']),
+        'operations' => drupal_render($form['formats'][$id]['operations']),
+      ),
+      'class' => array('draggable'),
+    );
+    $variables['rows'][$id] = $row;
+  }
+  $variables['header'] = array(
+    'name' => t('Name'),
+    'roles' => t('Roles'),
+    'weight' => t('Weight'),
+    'operations' => t('Operations'),
+  );
+}
+
+/**
  * Returns HTML for the text format administration overview form.
  *
  * @param $variables
  *   An associative array containing:
  *   - form: A render element representing the form.
+ *   - header: An array of labels to be used in a table header.
+ *   - rows: An array of rows to be used in a table.
  *
+ * @see template_preprocess_filter_admin_overview()
  * @ingroup themeable
  */
 function theme_filter_admin_overview($variables) {
   $form = $variables['form'];
 
-  $rows = array();
-  foreach (element_children($form['formats']) as $id) {
-    $form['formats'][$id]['weight']['#attributes']['class'] = array('text-format-order-weight');
-    $row = array(
-      'data' => array(
-        drupal_render($form['formats'][$id]['name']),
-        drupal_render($form['formats'][$id]['roles']),
-        drupal_render($form['formats'][$id]['weight']),
-        drupal_render($form['formats'][$id]['operations']),
-      ),
-      'class' => array('draggable'),
-    );
-    $rows[] = $row;
-  }
-  $header = array(t('Name'), t('Roles'), t('Weight'), t('Operations'));
-  $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'text-format-order')));
+  $output = theme('table', array('header' => $variables['header'], 'rows' => $variables['rows'], 'attributes' => array('id' => 'text-format-order')));
   $output .= drupal_render_children($form);
 
   drupal_add_tabledrag('text-format-order', 'order', 'sibling', 'text-format-order-weight');
@@ -173,6 +190,7 @@ function filter_admin_format_form($form, &$form_state, $format) {
     '#title' => t('Name'),
     '#default_value' => $format->name,
     '#required' => TRUE,
+    '#weight' => -20,
   );
   $form['format'] = array(
     '#type' => 'machine_name',
@@ -184,6 +202,7 @@ function filter_admin_format_form($form, &$form_state, $format) {
       'source' => array('name'),
     ),
     '#disabled' => !empty($format->format),
+    '#weight' => -19,
   );
 
   // Add user role access selection.
@@ -192,6 +211,7 @@ function filter_admin_format_form($form, &$form_state, $format) {
     '#title' => t('Roles'),
     '#options' => array_map('check_plain', user_roles()),
     '#disabled' => $is_fallback,
+    '#weight' => -10,
   );
   if ($is_fallback) {
     $form['roles']['#description'] = t('All roles for this text format must be enabled and cannot be changed.');
