From dba02ffdf1bf2afb257d14c6ec12e31dd61adef6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boh=C3=A9mier?= <jfb@angelicode.com>
Date: Sun, 19 Jun 2016 18:45:38 +0000
Subject: [PATCH] 2193271-Remove default #size from form elements

---
 core/lib/Drupal/Core/Datetime/Element/Datetime.php  | 2 --
 core/lib/Drupal/Core/Render/Element/Email.php       | 1 -
 core/lib/Drupal/Core/Render/Element/File.php        | 1 -
 core/lib/Drupal/Core/Render/Element/MachineName.php | 1 -
 core/lib/Drupal/Core/Render/Element/Password.php    | 1 -
 core/lib/Drupal/Core/Render/Element/Search.php      | 1 -
 core/lib/Drupal/Core/Render/Element/Tel.php         | 1 -
 core/lib/Drupal/Core/Render/Element/Textfield.php   | 1 -
 core/lib/Drupal/Core/Render/Element/Url.php         | 1 -
 core/lib/Drupal/Core/Render/Element/Weight.php      | 2 --
 10 files changed, 12 deletions(-)

diff --git a/core/lib/Drupal/Core/Datetime/Element/Datetime.php b/core/lib/Drupal/Core/Datetime/Element/Datetime.php
index 44a3949..eb150ee 100644
--- a/core/lib/Drupal/Core/Datetime/Element/Datetime.php
+++ b/core/lib/Drupal/Core/Datetime/Element/Datetime.php
@@ -261,7 +261,6 @@ public static function processDatetime(&$element, FormStateInterface $form_state
         '#value' => $date_value,
         '#attributes' => $element['#attributes'] + $extra_attributes,
         '#required' => $element['#required'],
-        '#size' => max(12, strlen($element['#value']['date'])),
         '#error_no_message' => TRUE,
         '#date_date_format' => $element['#date_date_format'],
       );
@@ -294,7 +293,6 @@ public static function processDatetime(&$element, FormStateInterface $form_state
         '#value' => $time_value,
         '#attributes' => $element['#attributes'] + $extra_attributes,
         '#required' => $element['#required'],
-        '#size' => 12,
         '#error_no_message' => TRUE,
       );
 
diff --git a/core/lib/Drupal/Core/Render/Element/Email.php b/core/lib/Drupal/Core/Render/Element/Email.php
index 4b4da7b..de612ef 100644
--- a/core/lib/Drupal/Core/Render/Element/Email.php
+++ b/core/lib/Drupal/Core/Render/Element/Email.php
@@ -44,7 +44,6 @@ public function getInfo() {
     $class = get_class($this);
     return array(
       '#input' => TRUE,
-      '#size' => 60,
       '#maxlength' => self::EMAIL_MAX_LENGTH,
       '#autocomplete_route_name' => FALSE,
       '#process' => array(
diff --git a/core/lib/Drupal/Core/Render/Element/File.php b/core/lib/Drupal/Core/Render/Element/File.php
index d37d5c7..9a173d2 100644
--- a/core/lib/Drupal/Core/Render/Element/File.php
+++ b/core/lib/Drupal/Core/Render/Element/File.php
@@ -30,7 +30,6 @@ public function getInfo() {
       '#process' => array(
         array($class, 'processFile'),
       ),
-      '#size' => 60,
       '#pre_render' => array(
         array($class, 'preRenderFile'),
       ),
diff --git a/core/lib/Drupal/Core/Render/Element/MachineName.php b/core/lib/Drupal/Core/Render/Element/MachineName.php
index c92d0e0..0827c04 100644
--- a/core/lib/Drupal/Core/Render/Element/MachineName.php
+++ b/core/lib/Drupal/Core/Render/Element/MachineName.php
@@ -80,7 +80,6 @@ public function getInfo() {
       '#default_value' => NULL,
       '#required' => TRUE,
       '#maxlength' => 64,
-      '#size' => 60,
       '#autocomplete_route_name' => FALSE,
       '#process' => array(
         array($class, 'processMachineName'),
diff --git a/core/lib/Drupal/Core/Render/Element/Password.php b/core/lib/Drupal/Core/Render/Element/Password.php
index e16e8bb..431fd0b 100644
--- a/core/lib/Drupal/Core/Render/Element/Password.php
+++ b/core/lib/Drupal/Core/Render/Element/Password.php
@@ -31,7 +31,6 @@ public function getInfo() {
     $class = get_class($this);
     return array(
       '#input' => TRUE,
-      '#size' => 60,
       '#maxlength' => 128,
       '#process' => array(
         array($class, 'processAjaxForm'),
diff --git a/core/lib/Drupal/Core/Render/Element/Search.php b/core/lib/Drupal/Core/Render/Element/Search.php
index 45333c5..69802adb 100644
--- a/core/lib/Drupal/Core/Render/Element/Search.php
+++ b/core/lib/Drupal/Core/Render/Element/Search.php
@@ -28,7 +28,6 @@ public function getInfo() {
     $class = get_class($this);
     return array(
       '#input' => TRUE,
-      '#size' => 60,
       '#maxlength' => 128,
       '#autocomplete_route_name' => FALSE,
       '#process' => array(
diff --git a/core/lib/Drupal/Core/Render/Element/Tel.php b/core/lib/Drupal/Core/Render/Element/Tel.php
index 02b071d..c678d2b 100644
--- a/core/lib/Drupal/Core/Render/Element/Tel.php
+++ b/core/lib/Drupal/Core/Render/Element/Tel.php
@@ -31,7 +31,6 @@ public function getInfo() {
     $class = get_class($this);
     return array(
       '#input' => TRUE,
-      '#size' => 30,
       '#maxlength' => 128,
       '#autocomplete_route_name' => FALSE,
       '#process' => array(
diff --git a/core/lib/Drupal/Core/Render/Element/Textfield.php b/core/lib/Drupal/Core/Render/Element/Textfield.php
index 1cb35e8..ee87b1f 100644
--- a/core/lib/Drupal/Core/Render/Element/Textfield.php
+++ b/core/lib/Drupal/Core/Render/Element/Textfield.php
@@ -49,7 +49,6 @@ public function getInfo() {
     $class = get_class($this);
     return array(
       '#input' => TRUE,
-      '#size' => 60,
       '#maxlength' => 128,
       '#autocomplete_route_name' => FALSE,
       '#process' => array(
diff --git a/core/lib/Drupal/Core/Render/Element/Url.php b/core/lib/Drupal/Core/Render/Element/Url.php
index 33d91ed..83c438f 100644
--- a/core/lib/Drupal/Core/Render/Element/Url.php
+++ b/core/lib/Drupal/Core/Render/Element/Url.php
@@ -35,7 +35,6 @@ public function getInfo() {
     $class = get_class($this);
     return array(
       '#input' => TRUE,
-      '#size' => 60,
       '#maxlength' => 255,
       '#autocomplete_route_name' => FALSE,
       '#process' => array(
diff --git a/core/lib/Drupal/Core/Render/Element/Weight.php b/core/lib/Drupal/Core/Render/Element/Weight.php
index a6ecbee..bd22e07 100644
--- a/core/lib/Drupal/Core/Render/Element/Weight.php
+++ b/core/lib/Drupal/Core/Render/Element/Weight.php
@@ -65,8 +65,6 @@ public static function processWeight(&$element, FormStateInterface $form_state,
     // Otherwise, use a text field.
     else {
       $element['#type'] = 'number';
-      // Use a field big enough to fit most weights.
-      $element['#size'] = 10;
       $element += $element_info_manager->getInfo('number');
     }
 
-- 
1.9.1

