commit 92f67b7e163357e5f70b0276505237fe2553e841 Author: Joel Pittet Date: Fri Jan 3 18:42:05 2014 -0800 cleanup and whitespace diff --git a/core/includes/form.inc b/core/includes/form.inc index 1dcf77c..44ed906 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -994,7 +994,7 @@ function theme_fieldset($variables) { function template_preprocess_details(&$variables) { $element = $variables['element']; $variables['attributes'] = $element['#attributes']; - $variables['summary_attributes'] = new Attribute(array()); + $variables['summary_attributes'] = new Attribute(); if (!empty($element['#title'])) { $variables['summary_attributes']['role'] = 'button'; if (!empty($element['#attributes']['id'])) { @@ -1961,9 +1961,6 @@ function form_process_group(&$element, &$form_state) { */ function form_pre_render_details($element) { element_set_attributes($element, array('id')); - if (!isset($element['#attributes']['class'])) { - $element['#attributes']['class'] = array(); - } // The .form-wrapper class is required for #states to treat details like // containers. diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php index 12d02b0..a9c0138 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php @@ -598,9 +598,7 @@ function testDrupalRenderChildrenPostRenderCache() { $element = array('#cache' => $element['#cache']); $cached_element = cache()->get(drupal_render_cid_create($element))->data; $expected_element = array( - '#markup' => '
Parent
Child
Subchild
-
-', + '#markup' => '
Parent
Child
Subchild
', '#attached' => array( 'js' => array( array('type' => 'setting', 'data' => array('foo' => 'bar')) @@ -660,9 +658,7 @@ function testDrupalRenderChildrenPostRenderCache() { $cached_parent_element = cache()->get(drupal_render_cid_create($element))->data; $cached_child_element = cache()->get(drupal_render_cid_create($element['child']))->data; $expected_parent_element = array( - '#markup' => '
Parent
Child
Subchild
-
-', + '#markup' => '
Parent
Child
Subchild
', '#attached' => array( 'js' => array( array('type' => 'setting', 'data' => array('foo' => 'bar')) @@ -682,8 +678,7 @@ function testDrupalRenderChildrenPostRenderCache() { ); $this->assertIdentical($cached_parent_element, $expected_parent_element, 'The correct data is cached for the parent: the stored #markup and #attached properties are not affected by #post_render_cache callbacks.'); $expected_child_element = array( - '#markup' => '
Child
Subchild
-', + '#markup' => '
Child
Subchild
', '#attached' => array( 'library' => array( array('system', 'drupal.collapse'), diff --git a/core/modules/system/templates/details.html.twig b/core/modules/system/templates/details.html.twig index aef051e..9a6e463 100644 --- a/core/modules/system/templates/details.html.twig +++ b/core/modules/system/templates/details.html.twig @@ -15,19 +15,21 @@ * @ingroup themeable */ #} - - {% if title %} - {{ title }} - {% endif %} -
- {% if description %} -
{{ description }}
- {% endif %} - {% if children %} - {{ children }} - {% endif %} - {% if value %} - {{ value }} - {% endif %} -
- +{% spaceless %} + + {%- if title -%} + {{ title }} + {%- endif -%} +
+ {%- if description -%} +
{{ description }}
+ {%- endif -%} + {%- if children -%} + {{ children }} + {%- endif -%} + {%- if value -%} + {{ value }} + {%- endif -%} +
+ +{% endspaceless %}