diff --git a/core/includes/authorize.inc b/core/includes/authorize.inc
index f98820f..251ce11 100644
--- a/core/includes/authorize.inc
+++ b/core/includes/authorize.inc
@@ -158,7 +158,7 @@ function _authorize_filetransfer_connection_settings($backend) {
*
* The default settings for the file transfer connection forms are saved in
* the database. The settings are stored as a nested array in the case of a
- * settings form that has fieldsets or otherwise uses a nested structure.
+ * settings form that has details or otherwise uses a nested structure.
* Therefore, to properly add defaults, we need to walk through all the
* children form elements and process those defaults recursively.
*
@@ -170,14 +170,14 @@ function _authorize_filetransfer_connection_settings($backend) {
* The default settings for the file transfer backend we're operating on.
*/
function _authorize_filetransfer_connection_settings_set_defaults(&$element, $key, array $defaults) {
- // If we're operating on a form element which isn't a fieldset, and we have
+ // If we're operating on a form element which isn't a details, and we have
// a default setting saved, stash it in #default_value.
- if (!empty($key) && isset($defaults[$key]) && isset($element['#type']) && $element['#type'] != 'fieldset') {
+ if (!empty($key) && isset($defaults[$key]) && isset($element['#type']) && $element['#type'] != 'details') {
$element['#default_value'] = $defaults[$key];
}
// Now, we walk through all the child elements, and recursively invoke
// ourself on each one. Since the $defaults settings array can be nested
- // (because of #tree, any values inside fieldsets will be nested), if
+ // (because of #tree, any values inside details will be nested), if
// there's a subarray of settings for the form key we're currently
// processing, pass in that subarray to the recursive call. Otherwise, just
// pass on the whole $defaults array.
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 4c86953..96274b2 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -5606,8 +5606,8 @@ function drupal_render_page($page) {
*
* The #theme_wrappers property contains an array of theme functions which will
* be called, in order, after #theme has run. These can be used to add further
- * markup around the rendered children; e.g., fieldsets add the required markup
- * for a fieldset around their rendered child elements. All wrapper theme
+ * markup around the rendered children; e.g., details add the required markup
+ * for a details element around their rendered child elements. All wrapper theme
* functions have to include the element's #children property in their output,
* as it contains the output of the previous theme functions and the rendered
* children.
diff --git a/core/includes/form.inc b/core/includes/form.inc
index 6956f04..d85a189 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -256,8 +256,8 @@ function drupal_get_form($form_id) {
* handler, and is also used in Ajax handlers.
* - has_file_element: Internal. If TRUE, there is a file element and Form API
* will set the appropriate 'enctype' HTML attribute on the form.
- * - groups: Internal. An array containing references to fieldsets to render
- * them within vertical tabs.
+ * - groups: Internal. An array containing references to details elements to
+ * render them within vertical tabs.
* - storage: $form_state['storage'] is not a special key, and no specific
* support is provided for it in the Form API. By tradition it was
* the location where application-specific data was stored for communication
@@ -1706,9 +1706,9 @@ function form_error(&$element, $message = '') {
* type, one of the functions in this array is form_process_date(), which adds
* the individual 'year', 'month', 'day', etc. child elements. These functions
* can also be used to set additional properties or implement special logic
- * other than adding child elements: for example, for the 'fieldset' element
- * type, one of the functions in this array is form_process_fieldset(), which
- * adds the attributes and JavaScript needed to make the fieldset collapsible
+ * other than adding child elements: for example, for the 'details' element
+ * type, one of the functions in this array is form_process_details(), which
+ * adds the attributes and JavaScript needed to make the details collapsible
* if the #collapsible property is set. The #process functions are called in
* preorder traversal, meaning they are called for the parent element first,
* then for the child elements.
@@ -2814,6 +2814,39 @@ function theme_fieldset($variables) {
}
/**
+ * Returns HTML for a details form element and its children.
+ *
+ * @param $variables
+ * An associative array containing:
+ * - element: An associative array containing the properties of the element.
+ * Properties used: #attributes, #children, #collapsed, #collapsible,
+ * #description, #id, #title, #value.
+ *
+ * @ingroup themeable
+ */
+function theme_details($variables) {
+ $element = $variables['element'];
+ element_set_attributes($element, array('id'));
+ _form_set_attributes($element, array('form-wrapper'));
+
+ $output = '';
+ if (!empty($element['#title'])) {
+ $output .= '' . $element['#title'] . '';
+ }
+ $output .= '
';
+ if (!empty($element['#description'])) {
+ $output .= '
';
+ $output .= "\n";
+ return $output;
+}
+
+/**
* Returns HTML for a radio button form element.
*
* Note: The input "name" attribute needs to be sanitized before output, which
@@ -3670,29 +3703,29 @@ function form_validate_machine_name(&$element, &$form_state) {
}
/**
- * Arranges fieldsets into groups.
+ * Arranges details into groups.
*
* @param $element
* An associative array containing the properties and children of the
- * fieldset. Note that $element must be taken by reference here, so processed
+ * details. Note that $element must be taken by reference here, so processed
* child elements are taken over into $form_state.
* @param $form_state
- * The $form_state array for the form this fieldset belongs to.
+ * The $form_state array for the form this details belongs to.
*
* @return
* The processed element.
*/
-function form_process_fieldset(&$element, &$form_state) {
+function form_process_details(&$element, &$form_state) {
$parents = implode('][', $element['#parents']);
- // Each fieldset forms a new group. The #type 'vertical_tabs' basically only
- // injects a new fieldset.
+ // Each details element forms a new group. The #type 'vertical_tabs' basically
+ // only injects a new details element.
$form_state['groups'][$parents]['#group_exists'] = TRUE;
$element['#groups'] = &$form_state['groups'];
- // Process vertical tabs group member fieldsets.
+ // Process vertical tabs group member details elements.
if (isset($element['#group'])) {
- // Add this fieldset to the defined group (by reference).
+ // Add this details element to the defined group (by reference).
$group = $element['#group'];
$form_state['groups'][$group][] = &$element;
}
@@ -3708,28 +3741,28 @@ function form_process_fieldset(&$element, &$form_state) {
*
* @param $element
* An associative array containing the properties and children of the
- * fieldset.
+ * details.
*
* @return
* The modified element with all group members.
*/
-function form_pre_render_fieldset($element) {
- // The .form-wrapper class is required for #states to treat fieldsets like
+function form_pre_render_details($element) {
+ // The .form-wrapper class is required for #states to treat details like
// containers.
if (!isset($element['#attributes']['class'])) {
$element['#attributes']['class'] = array();
}
- // Collapsible fieldsets
+ // Collapsible details.
if (!empty($element['#collapsible'])) {
$element['#attached']['library'][] = array('system', 'drupal.collapse');
$element['#attributes']['class'][] = 'collapsible';
- if (!empty($element['#collapsed'])) {
- $element['#attributes']['class'][] = 'collapsed';
- }
+ }
+ if (empty($element['#collapsed'])) {
+ $element['#attributes']['open'] = 'open';
}
- // Fieldsets may be rendered outside of a Form API context.
+ // Details may be rendered outside of a Form API context.
if (!isset($element['#parents']) || !isset($element['#groups'])) {
return $element;
}
@@ -3741,7 +3774,7 @@ function form_pre_render_fieldset($element) {
// Break references and indicate that the element should be rendered as
// group member.
$child = (array) $element['#groups'][$parents][$key];
- $child['#group_fieldset'] = TRUE;
+ $child['#group_details'] = TRUE;
// Inject the element as new child element.
$element[] = $child;
@@ -3761,7 +3794,7 @@ function form_pre_render_fieldset($element) {
// Intentionally empty to clarify the flow; we simply return $element.
}
// If we injected this element into the group, then we want to render it.
- elseif (!empty($element['#group_fieldset'])) {
+ elseif (!empty($element['#group_details'])) {
// Intentionally empty to clarify the flow; we simply return $element.
}
// Otherwise, this element belongs to a group and the group exists, so we do
@@ -3779,7 +3812,7 @@ function form_pre_render_fieldset($element) {
*
* @param $element
* An associative array containing the properties and children of the
- * fieldset.
+ * details element.
* @param $form_state
* The $form_state array for the form this vertical tab widget belongs to.
*
@@ -3787,10 +3820,10 @@ function form_pre_render_fieldset($element) {
* The processed element.
*/
function form_process_vertical_tabs($element, &$form_state) {
- // Inject a new fieldset as child, so that form_process_fieldset() processes
- // this fieldset like any other fieldset.
+ // Inject a new details as child, so that form_process_details() processes
+ // this details element like any other details.
$element['group'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#theme_wrappers' => array(),
'#parents' => $element['#parents'],
);
@@ -3813,12 +3846,12 @@ function form_process_vertical_tabs($element, &$form_state) {
}
/**
- * Returns HTML for an element's children fieldsets as vertical tabs.
+ * Returns HTML for an element's children details as vertical tabs.
*
* @param $variables
* An associative array containing:
* - element: An associative array containing the properties and children of
- * the fieldset. Properties used: #children.
+ * the details element. Properties used: #children.
*
* @ingroup themeable
*/
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 3968682..5da7bbf 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -1875,7 +1875,7 @@ function install_check_requirements($install_state) {
*/
function _install_configure_form($form, &$form_state, &$install_state) {
$form['site_information'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => st('Site information'),
'#collapsible' => FALSE,
);
@@ -1894,7 +1894,7 @@ function _install_configure_form($form, &$form_state, &$install_state) {
'#weight' => -15,
);
$form['admin_account'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => st('Site maintenance account'),
'#collapsible' => FALSE,
);
@@ -1923,7 +1923,7 @@ function _install_configure_form($form, &$form_state, &$install_state) {
);
$form['server_settings'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => st('Server settings'),
'#collapsible' => FALSE,
);
@@ -1950,7 +1950,7 @@ function _install_configure_form($form, &$form_state, &$install_state) {
);
$form['update_notifications'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => st('Update notifications'),
'#collapsible' => FALSE,
);
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 0c35b90..bff8626 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -3044,6 +3044,9 @@ function drupal_common_theme() {
'fieldset' => array(
'render element' => 'element',
),
+ 'details' => array(
+ 'render element' => 'element',
+ ),
'radio' => array(
'render element' => 'element',
),
diff --git a/core/lib/Drupal/Core/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php
index 5d34a62..d7faaec 100644
--- a/core/lib/Drupal/Core/Database/Install/Tasks.php
+++ b/core/lib/Drupal/Core/Database/Install/Tasks.php
@@ -232,7 +232,7 @@ public function getFormOptions($database) {
);
$form['advanced_options'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => st('Advanced options'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
diff --git a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php
index 337b0b3..72a6751 100644
--- a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php
+++ b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php
@@ -406,7 +406,7 @@ public function getSettingsForm() {
'#description' => t('Your password is not saved in the database and is only used to establish a connection.'),
);
$form['advanced'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Advanced settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
diff --git a/core/misc/collapse.js b/core/misc/collapse.js
index 80f5939..3d99bce 100644
--- a/core/misc/collapse.js
+++ b/core/misc/collapse.js
@@ -3,22 +3,57 @@
"use strict";
/**
- * The collapsible fieldset object represents a single collapsible fieldset.
+ * Details feature detection.
+ *
+ * @todo This is a stop-gap fix only. collapse.js needs to be replaced with a
+ * proper HTML5 details polyfill.
+ *
+ * @author Mathias Bynens
+ * @see http://mathiasbynens.be/notes/html5-details-jquery
*/
-function CollapsibleFieldset(node, settings) {
+var isDetailsSupported = (function (doc) {
+ var el = doc.createElement('details'),
+ fake,
+ root,
+ diff;
+ if (!('open' in el)) {
+ return false;
+ }
+ root = doc.body || (function () {
+ var de = doc.documentElement;
+ fake = true;
+ return de.insertBefore(doc.createElement('body'), de.firstElementChild || de.firstChild);
+ }());
+ el.innerHTML = 'ab';
+ el.style.display = 'block';
+ root.appendChild(el);
+ diff = el.offsetHeight;
+ el.open = true;
+ diff = diff != el.offsetHeight;
+ root.removeChild(el);
+ if (fake) {
+ root.parentNode.removeChild(root);
+ }
+ return diff;
+}(document));
+
+/**
+ * The collapsible details object represents a single collapsible details element.
+ */
+function CollapsibleDetails(node, settings) {
this.$node = $(node);
- this.$node.data('fieldset', this);
+ this.$node.data('details', this);
this.settings = $.extend({
duration:'fast',
easing:'linear'
},
settings
);
- // Expand fieldset if there are errors inside, or if it contains an
+ // Expand details if there are errors inside, or if it contains an
// element that is targeted by the URI fragment identifier.
var anchor = location.hash && location.hash !== '#' ? ', ' + location.hash : '';
if (this.$node.find('.error' + anchor).length) {
- this.$node.removeClass('collapsed');
+ this.$node.attr('open', true);
}
// Initialize and setup the summary,
this.setupSummary();
@@ -27,19 +62,19 @@ function CollapsibleFieldset(node, settings) {
}
/**
- * Extend CollapsibleFieldset function.
+ * Extend CollapsibleDetails function.
*/
-$.extend(CollapsibleFieldset, {
+$.extend(CollapsibleDetails, {
/**
- * Holds references to instantiated CollapsibleFieldset objects.
+ * Holds references to instantiated CollapsibleDetails objects.
*/
- fieldsets: []
+ instances: []
});
/**
- * Extend CollapsibleFieldset prototype.
+ * Extend CollapsibleDetails prototype.
*/
-$.extend(CollapsibleFieldset.prototype, {
+$.extend(CollapsibleDetails.prototype, {
/**
* Flag preventing multiple simultaneous animations.
*/
@@ -57,17 +92,16 @@ $.extend(CollapsibleFieldset.prototype, {
* Initialize and setup legend markup.
*/
setupLegend: function () {
- // Turn the legend into a clickable link, but retain span.fieldset-legend
- // for CSS positioning.
- var $legend = this.$node.find('> legend .fieldset-legend');
+ // Turn the summary into a clickable link.
+ var $legend = this.$node.find('> summary');
- $('')
- .append(this.$node.hasClass('collapsed') ? Drupal.t('Show') : Drupal.t('Hide'))
+ $('')
+ .append(this.$node.attr('open') ? Drupal.t('Hide') : Drupal.t('Show'))
.prependTo($legend)
.after(' ');
// .wrapInner() does not retain bound events.
- var $link = $('')
+ var $link = $('')
.prepend($legend.contents())
.appendTo($legend)
.click($.proxy(this.onLegendClick, this));
@@ -88,19 +122,18 @@ $.extend(CollapsibleFieldset.prototype, {
this.$summary.html(text ? ' (' + text + ')' : '');
},
/**
- * Toggle the visibility of a fieldset using smooth animations.
+ * Toggle the visibility of a details element using smooth animations.
*/
toggle: function () {
// Don't animate multiple times.
if (this.animating) {
return;
}
- if (this.$node.is('.collapsed')) {
- var $content = this.$node.find('> .fieldset-wrapper').hide();
+ if (!this.$node.attr('open')) {
+ var $content = this.$node.find('> .details-wrapper').hide();
this.$node
- .removeClass('collapsed')
.trigger({ type:'collapsed', value:false })
- .find('> legend span.fieldset-legend-prefix').html(Drupal.t('Hide'));
+ .find('> summary span.details-summary-prefix').html(Drupal.t('Hide'));
$content.slideDown(
$.extend(this.settings, {
complete:$.proxy(this.onCompleteSlideDown, this)
@@ -109,7 +142,7 @@ $.extend(CollapsibleFieldset.prototype, {
}
else {
this.$node.trigger({ type:'collapsed', value:true });
- this.$node.find('> .fieldset-wrapper').slideUp(
+ this.$node.find('> .details-wrapper').slideUp(
$.extend(this.settings, {
complete:$.proxy(this.onCompleteSlideUp, this)
})
@@ -117,19 +150,20 @@ $.extend(CollapsibleFieldset.prototype, {
}
},
/**
- * Completed opening fieldset.
+ * Completed opening details element.
*/
onCompleteSlideDown: function () {
+ this.$node.attr('open', true);
this.$node.trigger('completeSlideDown');
this.animating = false;
},
/**
- * Completed closing fieldset.
+ * Completed closing details element.
*/
onCompleteSlideUp: function () {
+ this.$node.attr('open', false);
this.$node
- .addClass('collapsed')
- .find('> legend span.fieldset-legend-prefix').html(Drupal.t('Show'));
+ .find('> summary span.details-summary-prefix').html(Drupal.t('Show'));
this.$node.trigger('completeSlideUp');
this.animating = false;
}
@@ -137,16 +171,19 @@ $.extend(CollapsibleFieldset.prototype, {
Drupal.behaviors.collapse = {
attach: function (context, settings) {
- var $collapsibleFieldsets = $(context).find('fieldset.collapsible').once('collapse');
- if ($collapsibleFieldsets.length) {
- for (var i = 0; i < $collapsibleFieldsets.length; i++) {
- CollapsibleFieldset.fieldsets.push(new CollapsibleFieldset($collapsibleFieldsets[i], settings.collapsibleFieldset));
+ if (isDetailsSupported) {
+ return;
+ }
+ var $collapsibleDetails = $(context).find('details.collapsible').once('collapse');
+ if ($collapsibleDetails.length) {
+ for (var i = 0; i < $collapsibleDetails.length; i++) {
+ CollapsibleDetails.instances.push(new CollapsibleDetails($collapsibleDetails[i], settings.collapsibleDetails));
}
}
}
};
// Expose constructor in the public space.
-Drupal.CollapsibleFieldset = CollapsibleFieldset;
+Drupal.CollapsibleDetails = CollapsibleDetails;
})(jQuery, Drupal);
diff --git a/core/misc/states.js b/core/misc/states.js
index afd922c..75ee01d 100644
--- a/core/misc/states.js
+++ b/core/misc/states.js
@@ -420,7 +420,7 @@ states.Trigger.states = {
collapsed: {
'collapsed': function(e) {
- return (typeof e !== 'undefined' && 'value' in e) ? e.value : this.is('.collapsed');
+ return (typeof e !== 'undefined' && 'value' in e) ? e.value : !this.is('[open]');
}
}
};
@@ -477,6 +477,8 @@ states.State.aliases = {
'unchecked': '!checked',
'irrelevant': '!relevant',
'expanded': '!collapsed',
+ 'open': '!collapsed',
+ 'closed': 'collapsed',
'readwrite': '!readonly'
};
@@ -537,8 +539,8 @@ $(document).bind('state:checked', function(e) {
$(document).bind('state:collapsed', function(e) {
if (e.trigger) {
- if ($(e.target).is('.collapsed') !== e.value) {
- $(e.target).find('> legend a').click();
+ if ($(e.target).is('[open]') === e.value) {
+ $(e.target).find('> summary a').click();
}
}
});
diff --git a/core/misc/vertical-tabs.css b/core/misc/vertical-tabs.css
index c946503..e749668 100644
--- a/core/misc/vertical-tabs.css
+++ b/core/misc/vertical-tabs.css
@@ -11,12 +11,11 @@ div.vertical-tabs {
margin: -1px 0 -1px -15em; /* LTR */
float: left; /* LTR */
}
-.vertical-tabs fieldset.vertical-tabs-pane {
- margin: 0 !important;
- padding: 0 1em;
+.vertical-tabs .vertical-tabs-pane {
+ margin: 0;
border: 0;
}
-fieldset.vertical-tabs-pane > legend {
+.vertical-tabs-pane > summary {
display: none;
}
diff --git a/core/misc/vertical-tabs.js b/core/misc/vertical-tabs.js
index 303840a..f8c20ed 100644
--- a/core/misc/vertical-tabs.js
+++ b/core/misc/vertical-tabs.js
@@ -3,13 +3,13 @@
"use strict";
/**
- * This script transforms a set of fieldsets into a stack of vertical
+ * This script transforms a set of details into a stack of vertical
* tabs. Another tab pane can be selected by clicking on the respective
* tab.
*
* Each tab may have a summary which can be updated by another
- * script. For that to work, each fieldset has an associated
- * 'verticalTabCallback' (with jQuery.data() attached to the fieldset),
+ * script. For that to work, each details element has an associated
+ * 'verticalTabCallback' (with jQuery.data() attached to the details),
* which is called every time the user performs an update to a form
* element inside the tab pane.
*/
@@ -25,9 +25,9 @@ Drupal.behaviors.verticalTabs = {
var focusID = $this.find(':hidden.vertical-tabs-active-tab').val();
var tab_focus;
- // Check if there are some fieldsets that can be converted to vertical-tabs
- var $fieldsets = $this.find('> fieldset');
- if ($fieldsets.length === 0) {
+ // Check if there are some details that can be converted to vertical-tabs
+ var $details = $this.find('> details');
+ if ($details.length === 0) {
return;
}
@@ -35,12 +35,12 @@ Drupal.behaviors.verticalTabs = {
var tab_list = $('
');
$this.wrap('').before(tab_list);
- // Transform each fieldset into a tab.
- $fieldsets.each(function () {
+ // Transform each details into a tab.
+ $details.each(function () {
var $this = $(this);
var vertical_tab = new Drupal.verticalTab({
- title: $this.find('> legend').text(),
- fieldset: $this
+ title: $this.find('> summary').text(),
+ details: $this
});
tab_list.append(vertical_tab.item);
$this
@@ -79,7 +79,7 @@ Drupal.behaviors.verticalTabs = {
* @param settings
* An object with the following keys:
* - title: The name of the tab.
- * - fieldset: The jQuery object of the fieldset that is the tab pane.
+ * - details: The jQuery object of the details element that is the tab pane.
*/
Drupal.verticalTab = function (settings) {
var self = this;
@@ -96,12 +96,12 @@ Drupal.verticalTab = function (settings) {
event.preventDefault();
if (event.keyCode === 13) {
self.focus();
- // Set focus on the first input field of the visible fieldset/tab pane.
- $("fieldset.vertical-tabs-pane :input:visible:enabled:first").focus();
+ // Set focus on the first input field of the visible details/tab pane.
+ $(".vertical-tabs-pane :input:visible:enabled:first").focus();
}
});
- this.fieldset
+ this.details
.bind('summaryUpdated', function () {
self.updateSummary();
})
@@ -113,17 +113,17 @@ Drupal.verticalTab.prototype = {
* Displays the tab's content pane.
*/
focus: function () {
- this.fieldset
- .siblings('fieldset.vertical-tabs-pane')
+ this.details
+ .siblings('.vertical-tabs-pane')
.each(function () {
var tab = $(this).data('verticalTab');
- tab.fieldset.hide();
+ tab.details.hide();
tab.item.removeClass('selected');
})
.end()
.show()
.siblings(':hidden.vertical-tabs-active-tab')
- .val(this.fieldset.attr('id'));
+ .val(this.details.attr('id'));
this.item.addClass('selected');
// Mark the active tab for screen readers.
$('#active-vertical-tab').remove();
@@ -134,7 +134,7 @@ Drupal.verticalTab.prototype = {
* Updates the tab's summary.
*/
updateSummary: function () {
- this.summary.html(this.fieldset.drupalGetSummary());
+ this.summary.html(this.details.drupalGetSummary());
},
/**
@@ -148,8 +148,8 @@ Drupal.verticalTab.prototype = {
// method.
this.item.parent().children('.vertical-tab-button').removeClass('first')
.filter(':visible:first').addClass('first');
- // Display the fieldset.
- this.fieldset.removeClass('vertical-tab-hidden').show();
+ // Display the details element.
+ this.details.removeClass('vertical-tab-hidden').show();
// Focus this tab.
this.focus();
return this;
@@ -166,10 +166,10 @@ Drupal.verticalTab.prototype = {
// method.
this.item.parent().children('.vertical-tab-button').removeClass('first')
.filter(':visible:first').addClass('first');
- // Hide the fieldset.
- this.fieldset.addClass('vertical-tab-hidden').hide();
+ // Hide the details element.
+ this.details.addClass('vertical-tab-hidden').hide();
// Focus the first visible tab (if there is one).
- var $firstTab = this.fieldset.siblings('.vertical-tabs-pane:not(.vertical-tab-hidden):first');
+ var $firstTab = this.details.siblings('.vertical-tabs-pane:not(.vertical-tab-hidden):first');
if ($firstTab.length) {
$firstTab.data('verticalTab').focus();
}
diff --git a/core/modules/action/action.admin.inc b/core/modules/action/action.admin.inc
index f130111..c9db258 100644
--- a/core/modules/action/action.admin.inc
+++ b/core/modules/action/action.admin.inc
@@ -96,7 +96,7 @@ function action_admin_manage() {
*/
function action_admin_manage_form($form, &$form_state, $options = array()) {
$form['parent'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Create an advanced action'),
'#attributes' => array('class' => array('container-inline')),
);
diff --git a/core/modules/aggregator/aggregator.admin.inc b/core/modules/aggregator/aggregator.admin.inc
index a859e85..9b9d2be 100644
--- a/core/modules/aggregator/aggregator.admin.inc
+++ b/core/modules/aggregator/aggregator.admin.inc
@@ -538,7 +538,7 @@ function aggregator_admin_form($form, $form_state) {
}
if (count($basic_conf)) {
$form['basic_conf'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Basic configuration'),
'#description' => t('For most aggregation tasks, the default settings are fine.'),
'#collapsible' => TRUE,
diff --git a/core/modules/aggregator/aggregator.processor.inc b/core/modules/aggregator/aggregator.processor.inc
index b333a96..f00edc5 100644
--- a/core/modules/aggregator/aggregator.processor.inc
+++ b/core/modules/aggregator/aggregator.processor.inc
@@ -79,10 +79,10 @@ function aggregator_form_aggregator_admin_form_alter(&$form, $form_state) {
$period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval');
$period[AGGREGATOR_CLEAR_NEVER] = t('Never');
- // Only wrap into a collapsible fieldset if there is a basic configuration.
+ // Only wrap into a collapsible details if there is a basic configuration.
if (isset($form['basic_conf'])) {
$form['modules']['aggregator'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Default processor settings'),
'#description' => $info['description'],
'#collapsible' => TRUE,
diff --git a/core/modules/block/block.admin.inc b/core/modules/block/block.admin.inc
index 2a17a55..f632232 100644
--- a/core/modules/block/block.admin.inc
+++ b/core/modules/block/block.admin.inc
@@ -303,7 +303,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
// Region settings.
$form['regions'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Region settings'),
'#collapsible' => FALSE,
'#description' => t('Specify in which themes and regions this block is displayed.'),
@@ -355,7 +355,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
// Per-path visibility.
$form['visibility']['path'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Pages'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
@@ -429,7 +429,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
$langcodes_options[$language->langcode] = $language->name;
}
$form['visibility']['language'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Languages'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
@@ -467,7 +467,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
))->fetchCol();
$role_options = array_map('check_plain', user_roles());
$form['visibility']['role'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Roles'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
@@ -484,7 +484,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
// Per-user visibility.
$form['visibility']['user'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Users'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index 2978146..e733525 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -611,10 +611,10 @@ function block_form_user_profile_form_alter(&$form, &$form_state) {
);
}
}
- // Only display the fieldset if there are any personalizable blocks.
+ // Only display the form element if there are any personalizable blocks.
if ($blocks) {
$form['block'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Personalize blocks'),
'#description' => t('Blocks consist of content or information that complements the main content of the page. Enable or disable optional blocks using the checkboxes below.'),
'#weight' => 3,
diff --git a/core/modules/book/book.js b/core/modules/book/book.js
index 301c67f..d1c54c8 100644
--- a/core/modules/book/book.js
+++ b/core/modules/book/book.js
@@ -8,9 +8,9 @@
"use strict";
-Drupal.behaviors.bookFieldsetSummaries = {
+Drupal.behaviors.bookDetailsSummaries = {
attach: function (context) {
- $(context).find('fieldset.book-outline-form').drupalSetSummary(function (context) {
+ $(context).find('.book-outline-form').drupalSetSummary(function (context) {
var $select = $(context).find('.book-title-select');
var val = $select.val();
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index 0187bda..f17ff13 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -417,7 +417,7 @@ function book_get_books() {
/**
* Implements hook_form_BASE_FORM_ID_alter() for node_form().
*
- * Adds the book fieldset to the node form.
+ * Adds the book form element to the node form.
*
* @see book_pick_book_nojs_submit()
*/
@@ -533,7 +533,7 @@ function _book_add_form_elements(&$form, &$form_state, Node $node) {
}
$form['book'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Book outline'),
'#weight' => 10,
'#collapsible' => TRUE,
diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index 56c04cf..53a7f39 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -39,7 +39,7 @@ function color_theme() {
function color_form_system_theme_settings_alter(&$form, &$form_state) {
if (isset($form_state['build_info']['args'][0]) && ($theme = $form_state['build_info']['args'][0]) && color_get_info($theme) && function_exists('gd_info')) {
$form['color'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Color scheme'),
'#weight' => -1,
'#attributes' => array('id' => 'color_scheme_form'),
diff --git a/core/modules/comment/comment-node-form.js b/core/modules/comment/comment-node-form.js
index 0249d96..67800da 100644
--- a/core/modules/comment/comment-node-form.js
+++ b/core/modules/comment/comment-node-form.js
@@ -7,15 +7,15 @@
"use strict";
-Drupal.behaviors.commentFieldsetSummaries = {
+Drupal.behaviors.commentDetailsSummaries = {
attach: function (context) {
var $context = $(context);
- $context.find('fieldset.comment-node-settings-form').drupalSetSummary(function (context) {
+ $context.find('.comment-node-settings-form').drupalSetSummary(function (context) {
return Drupal.checkPlain($(context).find('.form-item-comment input:checked').next('label').text());
});
// Provide the summary for the node type form.
- $context.find('fieldset.comment-node-type-settings-form').drupalSetSummary(function(context) {
+ $context.find('.comment-node-type-settings-form').drupalSetSummary(function(context) {
var $context = $(context);
var vals = [];
diff --git a/core/modules/comment/comment.admin.inc b/core/modules/comment/comment.admin.inc
index 26e9c8b..dc4d94c 100644
--- a/core/modules/comment/comment.admin.inc
+++ b/core/modules/comment/comment.admin.inc
@@ -44,7 +44,7 @@ function comment_admin($type = 'new') {
function comment_admin_overview($form, &$form_state, $arg) {
// Build an 'Update options' form.
$form['options'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Update options'),
'#attributes' => array('class' => array('container-inline')),
);
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index c174293..15ee379 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -1038,7 +1038,7 @@ function comment_view_multiple($comments, $view_mode = 'full', $langcode = NULL)
function comment_form_node_type_form_alter(&$form, $form_state) {
if (isset($form['type'])) {
$form['comment'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Comment settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
@@ -1115,7 +1115,7 @@ function comment_form_node_type_form_alter(&$form, $form_state) {
function comment_form_node_form_alter(&$form, $form_state) {
$node = $form_state['controller']->getEntity($form_state);
$form['comment_settings'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#access' => user_access('administer comments'),
'#title' => t('Comment settings'),
'#collapsible' => TRUE,
diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
index cead0cd..7460f71 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
@@ -49,10 +49,10 @@ public function form(array $form, array &$form_state, EntityInterface $comment)
$form['author'] = array(
'#weight' => 10,
);
- // Display author information in a fieldset for comment moderators.
+ // Display author information in a details element for comment moderators.
if ($is_admin) {
$form['author'] += array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Administration'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module
index 5063464..5ac416e 100644
--- a/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -281,7 +281,7 @@ function contact_mail($key, &$message, $params) {
*/
function contact_form_user_profile_form_alter(&$form, &$form_state) {
$form['contact'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Contact settings'),
'#weight' => 5,
'#collapsible' => TRUE,
@@ -311,7 +311,7 @@ function contact_user_presave($account) {
*/
function contact_form_user_admin_settings_alter(&$form, &$form_state) {
$form['contact'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Contact settings'),
'#weight' => 0,
);
diff --git a/core/modules/dblog/dblog.admin.inc b/core/modules/dblog/dblog.admin.inc
index 3b56f45..910b13b 100644
--- a/core/modules/dblog/dblog.admin.inc
+++ b/core/modules/dblog/dblog.admin.inc
@@ -318,7 +318,7 @@ function dblog_filter_form($form) {
$filters = dblog_filters();
$form['filters'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Filter log messages'),
'#collapsible' => TRUE,
'#collapsed' => empty($_SESSION['dblog_overview_filter']),
@@ -395,7 +395,7 @@ function dblog_filter_form_submit($form, &$form_state) {
*/
function dblog_clear_log_form($form) {
$form['dblog_clear'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Clear log messages'),
'#description' => t('This will permanently remove the log messages from the database.'),
'#collapsible' => TRUE,
diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
index 005eb14..4c56bff 100644
--- a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
+++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
@@ -451,7 +451,7 @@ function multiple_options_form(&$form, &$form_state) {
$field = $this->field_info;
$form['multiple_field_settings'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Multiple field settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
diff --git a/core/modules/field/tests/modules/field_test/field_test.entity.inc b/core/modules/field/tests/modules/field_test/field_test.entity.inc
index b48f5cf..14285a7 100644
--- a/core/modules/field/tests/modules/field_test/field_test.entity.inc
+++ b/core/modules/field/tests/modules/field_test/field_test.entity.inc
@@ -202,7 +202,7 @@ function field_test_entity_nested_form($form, &$form_state, $entity_1, $entity_2
// Second entity.
$form['entity_2'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Second entity'),
'#tree' => TRUE,
'#parents' => array('entity_2'),
diff --git a/core/modules/field_ui/field_ui.admin.inc b/core/modules/field_ui/field_ui.admin.inc
index 7f58240..61a91d6 100644
--- a/core/modules/field_ui/field_ui.admin.inc
+++ b/core/modules/field_ui/field_ui.admin.inc
@@ -562,7 +562,7 @@ function field_ui_field_settings_form($form, &$form_state, $instance) {
// Create a form structure for the field values.
$form['field'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Field settings'),
'#description' => $description,
'#tree' => TRUE,
@@ -656,7 +656,7 @@ function field_ui_widget_type_form($form, &$form_state, FieldInstance $instance)
);
$form['basic'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Change widget'),
);
$form['basic']['widget_type'] = array(
@@ -815,15 +815,15 @@ function field_ui_field_edit_form($form, &$form_state, $instance) {
// Create a form structure for the instance values.
$form['instance'] = array(
'#tree' => TRUE,
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('%type settings', array('%type' => $bundles[$entity_type][$bundle]['label'])),
'#description' => t('These settings apply only to the %field field when used in the %type type.', array(
'%field' => $instance['label'],
'%type' => $bundles[$entity_type][$bundle]['label'],
)),
// Ensure field_ui_field_edit_instance_pre_render() gets called in addition
- // to, not instead of, the #pre_render function(s) needed by all fieldsets.
- '#pre_render' => array_merge(array('field_ui_field_edit_instance_pre_render'), element_info_property('fieldset', '#pre_render', array())),
+ // to, not instead of, the #pre_render function(s) needed by all details.
+ '#pre_render' => array_merge(array('field_ui_field_edit_instance_pre_render'), element_info_property('details', '#pre_render', array())),
);
// Build the non-configurable instance values.
@@ -908,7 +908,7 @@ function field_ui_field_edit_form($form, &$form_state, $instance) {
// Create a form structure for the field values.
$form['field'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#title' => t('Global settings'),
@@ -966,7 +966,7 @@ function field_ui_field_edit_form_delete_submit($form, &$form_state) {
/**
* Render API callback: Merges instance, widget and other settings.
*
- * Combines the instance, widget, and other settings into a single fieldset so
+ * Combines the instance, widget, and other settings into a single details so
* that elements within each group can be shown at different weights as if they
* all had the same parent.
*
@@ -994,14 +994,14 @@ function field_ui_field_edit_instance_pre_render($element) {
}
/**
- * Builds the default value fieldset for a given field instance.
+ * Builds the default value widget for a given field instance.
*/
function field_ui_default_value_widget($field, $instance, &$form, &$form_state) {
$field_name = $field['field_name'];
$entity = $form['#entity'];
$element = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Default value'),
'#collapsible' => FALSE,
'#tree' => TRUE,
diff --git a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php
index a5e30eb..a95ebae 100644
--- a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php
+++ b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php
@@ -337,7 +337,7 @@ public function form(array $form, array &$form_state) {
// Only show the settings if there is more than one view mode.
if (count($view_modes) > 1) {
$form['modes'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Custom display settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php
index a1c854f..1745f7c 100644
--- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php
+++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php
@@ -168,11 +168,11 @@ function testViewModeCustom() {
}
/**
- * Tests hiding the view modes fieldset when there's only one available.
+ * Tests hiding the view modes widget when there's only one available.
*/
function testSingleViewMode() {
$this->drupalGet('admin/config/people/accounts/display');
- $this->assertNoText('Use custom display settings for the following view modes', 'Custom display settings fieldset found.');
+ $this->assertNoText('Use custom display settings for the following view modes');
// This may not trigger a notice when 'view_modes_custom' isn't available.
$this->drupalPost('admin/config/people/accounts/display', array(), t('Save'));
diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc
index 9c37a32..3cc053d 100644
--- a/core/modules/file/file.field.inc
+++ b/core/modules/file/file.field.inc
@@ -437,7 +437,7 @@ function file_field_widget_form(&$form, &$form_state, $field, $instance, $langco
// after building up the full list (like draggable table rows).
$elements['#file_upload_delta'] = $delta;
$elements['#theme'] = 'file_widget_multiple';
- $elements['#theme_wrappers'] = array('fieldset');
+ $elements['#theme_wrappers'] = array('details');
$elements['#process'] = array('file_field_widget_process_multiple');
$elements['#title'] = $element['#title'];
$elements['#description'] = $element['#description'];
diff --git a/core/modules/filter/filter.admin-rtl.css b/core/modules/filter/filter.admin-rtl.css
index c49481b..10620bf 100644
--- a/core/modules/filter/filter.admin-rtl.css
+++ b/core/modules/filter/filter.admin-rtl.css
@@ -7,10 +7,6 @@
/**
* Filter information under field.
*/
-.filter-wrapper .form-item {
- float: right;
- padding: 0 1.5em 0.5em 0;
-}
.filter-help {
float: left;
}
diff --git a/core/modules/filter/filter.admin.css b/core/modules/filter/filter.admin.css
index fdb2eff..db3898e 100644
--- a/core/modules/filter/filter.admin.css
+++ b/core/modules/filter/filter.admin.css
@@ -7,18 +7,16 @@
/**
* Filter information under field.
*/
-.text-format-wrapper .form-item {
+.text-format-wrapper > .form-item {
margin-bottom: 0;
}
.filter-wrapper {
border-top: 0;
margin: 0;
- padding: 1.5em 0;
}
.filter-wrapper .form-item {
- float: left; /* LTR */
- padding: 0 0 0.5em 1.5em; /* LTR */
+ margin-top: 0;
}
.filter-wrapper .form-item label {
display: inline;
@@ -26,7 +24,6 @@
.filter-help {
float: right; /* LTR */
- padding: 0 1.5em 0.5em;
}
.filter-help p {
margin: 0;
@@ -36,10 +33,6 @@
padding: 0 20px;
}
-.filter-guidelines {
- clear: left;
- padding: 0 1.5em;
-}
.text-format-wrapper .description {
margin-top: 0.5em;
}
diff --git a/core/modules/filter/filter.admin.inc b/core/modules/filter/filter.admin.inc
index 4f56856..c01fb93 100644
--- a/core/modules/filter/filter.admin.inc
+++ b/core/modules/filter/filter.admin.inc
@@ -284,7 +284,7 @@ function filter_admin_format_form($form, &$form_state, $format) {
$settings_form = $function($form, $form_state, $filters[$name], $format, $defaults, $filters);
if (!empty($settings_form)) {
$form['filters']['settings'][$name] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => $filter['title'],
'#parents' => array('filters', $name, 'settings'),
'#weight' => $filter['weight'],
diff --git a/core/modules/filter/filter.admin.js b/core/modules/filter/filter.admin.js
index b2d7c6e..f55159a 100644
--- a/core/modules/filter/filter.admin.js
+++ b/core/modules/filter/filter.admin.js
@@ -38,7 +38,7 @@ Drupal.behaviors.filterStatus = {
// Attach summary for configurable filters (only for screen-readers).
if (tab) {
- tab.fieldset.drupalSetSummary(function (tabContext) {
+ tab.details.drupalSetSummary(function (tabContext) {
return $checkbox.is(':checked') ? Drupal.t('Enabled') : Drupal.t('Disabled');
});
}
diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module
index b55066f..a9619ae 100644
--- a/core/modules/filter/filter.module
+++ b/core/modules/filter/filter.module
@@ -53,7 +53,7 @@ function filter_help($path, $arg) {
$output .= '
' . t('Defining text formats') . '
';
$output .= '
' . t('One format is included by default: Plain text (which removes all HTML tags). Additional formats may be created by your installation profile when you install Drupal, and more can be created by an administrator on the Text formats page.', array('@text-formats' => url('admin/config/content/formats'))) . '
';
$output .= '
' . t('Choosing a text format') . '
';
- $output .= '
' . t('Users with access to more than one text format can use the Text format fieldset to choose between available text formats when creating or editing multi-line content. Administrators can define the text formats available to each user role, and control the order of formats listed in the Text format fieldset on the Text formats page.', array('@text-formats' => url('admin/config/content/formats'))) . '
';
+ $output .= '
' . t('Users with access to more than one text format can use the Text format widget to choose between available text formats when creating or editing multi-line content. Administrators can define the text formats available to each user role, and control the order of formats listed in the Text format widget on the Text formats page.', array('@text-formats' => url('admin/config/content/formats'))) . '
';
$output .= '';
return $output;
@@ -905,7 +905,7 @@ function check_markup($text, $format_id = NULL, $langcode = '', $cache = FALSE,
* selector:
* - value: Holds the original element, having its #type changed to the value
* of #base_type or 'textarea' by default.
- * - format: Holds the text format fieldset and the text format selection,
+ * - format: Holds the text format details and the text format selection,
* using the text format ID specified in #format or the user's default format
* by default, if NULL.
*
@@ -967,7 +967,7 @@ function filter_process_format($element) {
// Setup child container for the text format widget.
$element['format'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#attributes' => array('class' => array('filter-wrapper')),
);
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
index f56cfbb..f6bda73 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
@@ -312,9 +312,9 @@ private function doAdminTests($user) {
// Test tags vocabulary term form is not affected.
$this->drupalGet('admin/structure/taxonomy/tags/add');
$this->assertField('parent[]', 'Parent field found.');
- // Test relations fieldset exists.
- $relations_fieldset = $this->xpath("//fieldset[@id='edit-relations']");
- $this->assertTrue(isset($relations_fieldset[0]), 'Relations fieldset element found.');
+ // Test relations widget exists.
+ $relations_widget = $this->xpath("//details[@id='edit-relations']");
+ $this->assertTrue(isset($relations_widget[0]), 'Relations widget element found.');
}
/**
diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc
index d51aa91..5379204 100644
--- a/core/modules/language/language.admin.inc
+++ b/core/modules/language/language.admin.inc
@@ -650,7 +650,7 @@ function language_negotiation_configure_url_form($form, &$form_state) {
);
$form['prefix'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#tree' => TRUE,
'#title' => t('Path prefix configuration'),
'#description' => t('Language codes or other custom text to use as a path prefix for URL language detection. For the default language, this value may be left blank. Modifying this value may break existing URLs. Use with caution in a production environment. Example: Specifying "deutsch" as the path prefix code for German results in URLs like "example.com/deutsch/contact".'),
@@ -663,7 +663,7 @@ function language_negotiation_configure_url_form($form, &$form_state) {
),
);
$form['domain'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#tree' => TRUE,
'#title' => t('Domain configuration'),
'#description' => t('The domain names to use for these languages. Leave blank for the default language. Use with caution in a production environment.Modifying this value may break existing URLs. Use with caution in a production environment. Example: Specifying "de.example.com" as language domain for German will result in an URL like "http://de.example.com/contact".'),
@@ -882,7 +882,7 @@ function language_negotiation_configure_browser_form($form, &$form_state) {
// Add empty row.
$form['new_mapping'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Add a new mapping'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php
index 61bfcf3..5379364 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php
@@ -87,7 +87,7 @@ function testContentTypeLanguageConfiguration() {
// Set the content type to use multilingual support.
$this->drupalGet("admin/structure/types/manage/{$type2->type}");
- $this->assertText(t('Language settings'), 'Multilingual support fieldset present on content type configuration form.');
+ $this->assertText(t('Language settings'), 'Multilingual support widget present on content type configuration form.');
$edit = array(
'language_configuration[language_hidden]' => FALSE,
);
diff --git a/core/modules/locale/locale.admin.css b/core/modules/locale/locale.admin.css
index 4b252b6..cb80592 100644
--- a/core/modules/locale/locale.admin.css
+++ b/core/modules/locale/locale.admin.css
@@ -1,3 +1,6 @@
+#locale-translate-filter-form .details-wrapper {
+ overflow: hidden;
+}
#locale-translate-filter-form .form-item-langcode,
#locale-translate-filter-form .form-item-translation,
#locale-translate-filter-form .form-item-customized {
@@ -16,7 +19,7 @@
}
#locale-translate-filter-form .form-actions {
float: left; /* LTR */
- padding: 3.5ex 0 0 0em; /* LTR */
+ padding: 3.8ex 0 0 0em; /* LTR */
}
#locale-translate-edit-form th{
width: 50%;
@@ -37,14 +40,10 @@
position: absolute;
}
-#locale-translate-filter-form fieldset.form-wrapper {
+#locale-translate-filter-form .form-wrapper {
margin-bottom:0;
}
-#locale-translate-edit-form #edit-strings table.locale-translate-edit-table {
- margin-top: 54px;
-}
-
#locale-translate-edit-form #edit-strings table.locale-translate-edit-table.changed {
margin-top: 0;
}
diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc
index 0be2aec..d29cf6f 100644
--- a/core/modules/locale/locale.bulk.inc
+++ b/core/modules/locale/locale.bulk.inc
@@ -174,7 +174,7 @@ function locale_translate_export_form($form, &$form_state) {
'#empty_value' => LANGUAGE_SYSTEM,
);
$form['content_options'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Export options'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc
index 8ea8780..72f1793 100644
--- a/core/modules/locale/locale.pages.inc
+++ b/core/modules/locale/locale.pages.inc
@@ -167,7 +167,7 @@ function locale_translate_filter_form($form, &$form_state) {
);
$form['filters'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Filter translatable strings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
diff --git a/core/modules/menu/menu.admin.js b/core/modules/menu/menu.admin.js
index d6a228a..530c8b6 100644
--- a/core/modules/menu/menu.admin.js
+++ b/core/modules/menu/menu.admin.js
@@ -13,10 +13,10 @@ Drupal.behaviors.menuChangeParentItems = {
* Function to set the options of the menu parent item dropdown.
*/
Drupal.menuUpdateParentList = function () {
- var $menuFieldset = $('#edit-menu');
+ var $menu = $('#edit-menu');
var values = [];
- $menuFieldset.find('input:checked').each(function () {
+ $menu.find('input:checked').each(function () {
// Get the names of all checked menus.
values.push(Drupal.checkPlain($.trim($(this).val())));
});
diff --git a/core/modules/menu/menu.js b/core/modules/menu/menu.js
index 1990374..77baddb 100644
--- a/core/modules/menu/menu.js
+++ b/core/modules/menu/menu.js
@@ -2,9 +2,9 @@
"use strict";
-Drupal.behaviors.menuFieldsetSummaries = {
+Drupal.behaviors.menuDetailsSummaries = {
attach: function (context) {
- $(context).find('fieldset.menu-link-form').drupalSetSummary(function (context) {
+ $(context).find('.menu-link-form').drupalSetSummary(function (context) {
var $context = $(context);
if ($context.find('.form-item-menu-enabled input').is(':checked')) {
return Drupal.checkPlain($context.find('.form-item-menu-link-title input').val());
@@ -22,7 +22,7 @@ Drupal.behaviors.menuFieldsetSummaries = {
Drupal.behaviors.menuLinkAutomaticTitle = {
attach: function (context) {
var $context = $(context);
- $context.find('fieldset.menu-link-form').each(function () {
+ $context.find('.menu-link-form').each(function () {
var $this = $(this);
// Try to find menu settings widget elements as well as a 'title' field in
// the form, but play nicely with user permissions and form alterations.
@@ -53,7 +53,7 @@ Drupal.behaviors.menuLinkAutomaticTitle = {
$link_title.val('');
$link_title.removeData('menuLinkAutomaticTitleOveridden');
}
- $checkbox.closest('fieldset.vertical-tabs-pane').trigger('summaryUpdated');
+ $checkbox.closest('.vertical-tabs-pane').trigger('summaryUpdated');
$checkbox.trigger('formUpdated');
});
// Take over any title change.
diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module
index 22f5dd7..16281b1 100644
--- a/core/modules/menu/menu.module
+++ b/core/modules/menu/menu.module
@@ -643,7 +643,7 @@ function menu_form_node_form_alter(&$form, $form_state) {
}
$form['menu'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Menu settings'),
'#access' => user_access('administer menu'),
'#collapsible' => TRUE,
@@ -750,7 +750,7 @@ function menu_form_node_type_form_alter(&$form, $form_state) {
$menu_options = menu_get_menus();
$type = $form['#node_type'];
$form['menu'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Menu settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
diff --git a/core/modules/node/content_types.inc b/core/modules/node/content_types.inc
index a7faa59..7d3ff61 100644
--- a/core/modules/node/content_types.inc
+++ b/core/modules/node/content_types.inc
@@ -154,7 +154,7 @@ function node_type_form($form, &$form_state, $type = NULL) {
);
$form['submission'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Submission form settings'),
'#collapsible' => TRUE,
'#group' => 'additional_settings',
@@ -189,7 +189,7 @@ function node_type_form($form, &$form_state, $type = NULL) {
'#description' => t('This text will be displayed at the top of the page when creating or editing content of this type.'),
);
$form['workflow'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Publishing options'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
@@ -208,7 +208,7 @@ function node_type_form($form, &$form_state, $type = NULL) {
);
if (module_exists('language')) {
$form['language'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Language settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
@@ -227,7 +227,7 @@ function node_type_form($form, &$form_state, $type = NULL) {
$form['#submit'][] = 'language_configuration_element_submit';
}
$form['display'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Display settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
diff --git a/core/modules/node/content_types.js b/core/modules/node/content_types.js
index d2a63b6..f85ba7b 100644
--- a/core/modules/node/content_types.js
+++ b/core/modules/node/content_types.js
@@ -6,12 +6,12 @@ Drupal.behaviors.contentTypes = {
attach: function (context) {
var $context = $(context);
// Provide the vertical tab summaries.
- $context.find('fieldset#edit-submission').drupalSetSummary(function(context) {
+ $context.find('#edit-submission').drupalSetSummary(function(context) {
var vals = [];
vals.push(Drupal.checkPlain($(context).find('#edit-title-label').val()) || Drupal.t('Requires a title'));
return vals.join(', ');
});
- $context.find('fieldset#edit-workflow').drupalSetSummary(function(context) {
+ $context.find('#edit-workflow').drupalSetSummary(function(context) {
var vals = [];
$(context).find("input[name^='node_options']:checked").parent().each(function() {
vals.push(Drupal.checkPlain($(this).text()));
@@ -21,7 +21,7 @@ Drupal.behaviors.contentTypes = {
}
return vals.join(', ');
});
- $('fieldset#edit-language', context).drupalSetSummary(function(context) {
+ $('#edit-language', context).drupalSetSummary(function(context) {
var vals = [];
vals.push($(".form-item-language-configuration-langcode select option:selected", context).text())
@@ -32,7 +32,7 @@ Drupal.behaviors.contentTypes = {
return vals.join(', ');
});
- $context.find('fieldset#edit-display').drupalSetSummary(function(context) {
+ $context.find('#edit-display').drupalSetSummary(function(context) {
var vals = [];
var $context = $(context);
$context.find('input:checked').next('label').each(function() {
diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php
index 5add3df..073c910 100644
--- a/core/modules/node/lib/Drupal/node/NodeFormController.php
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -115,7 +115,7 @@ public function form(array $form, array &$form_state, EntityInterface $node) {
// Add a log field if the "Create new revision" option is checked, or if the
// current user has the ability to check that option.
$form['revision_information'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Revision information'),
'#collapsible' => TRUE,
// Collapsed by default when "Create new revision" is unchecked.
@@ -159,7 +159,7 @@ public function form(array $form, array &$form_state, EntityInterface $node) {
// Node author information for administrators.
$form['author'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#access' => user_access('administer nodes'),
'#title' => t('Authoring information'),
'#collapsible' => TRUE,
@@ -200,7 +200,7 @@ public function form(array $form, array &$form_state, EntityInterface $node) {
// Node options for administrators.
$form['options'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#access' => user_access('administer nodes'),
'#title' => t('Publishing options'),
'#collapsible' => TRUE,
diff --git a/core/modules/node/node.admin.inc b/core/modules/node/node.admin.inc
index 2ca2d3e..fbb6e22 100644
--- a/core/modules/node/node.admin.inc
+++ b/core/modules/node/node.admin.inc
@@ -165,7 +165,7 @@ function node_filter_form() {
$i = 0;
$form['filters'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Show only items where'),
'#theme' => 'exposed_filters__node',
);
@@ -431,7 +431,7 @@ function node_admin_nodes() {
// Build the 'Update options' form.
$form['options'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Update options'),
'#attributes' => array('class' => array('container-inline')),
'#access' => $admin_access,
diff --git a/core/modules/node/node.js b/core/modules/node/node.js
index 0899d3c..d4c5dc7 100644
--- a/core/modules/node/node.js
+++ b/core/modules/node/node.js
@@ -2,10 +2,10 @@
"use strict";
-Drupal.behaviors.nodeFieldsetSummaries = {
+Drupal.behaviors.nodeDetailsSummaries = {
attach: function (context) {
var $context = $(context);
- $context.find('fieldset.node-form-revision-information').drupalSetSummary(function (context) {
+ $context.find('.node-form-revision-information').drupalSetSummary(function (context) {
var $context = $(context);
var revisionCheckbox = $context.find('.form-item-revision input');
@@ -20,7 +20,7 @@ Drupal.behaviors.nodeFieldsetSummaries = {
return Drupal.t('No revision');
});
- $context.find('fieldset.node-form-author').drupalSetSummary(function (context) {
+ $context.find('.node-form-author').drupalSetSummary(function (context) {
var $context = $(context);
var name = $context.find('.form-item-name input').val() || Drupal.settings.anonymous,
date = $context.find('.form-item-date input').val();
@@ -29,7 +29,7 @@ Drupal.behaviors.nodeFieldsetSummaries = {
Drupal.t('By @name', { '@name': name });
});
- $context.find('fieldset.node-form-options').drupalSetSummary(function (context) {
+ $context.find('.node-form-options').drupalSetSummary(function (context) {
var $context = $(context);
var vals = [];
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 5c11424..4920a6e 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -1332,7 +1332,7 @@ function node_search_status() {
function node_search_admin() {
// Output form for defining rank factor weights.
$form['content_ranking'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Content ranking'),
);
$form['content_ranking']['#theme'] = 'node_search_admin';
@@ -2099,7 +2099,7 @@ function node_form_block_admin_configure_alter(&$form, &$form_state) {
':delta' => $form['delta']['#value'],
))->fetchCol();
$form['visibility']['node_type'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Content types'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
@@ -2500,7 +2500,7 @@ function node_form_search_form_alter(&$form, $form_state) {
if (isset($form['module']) && $form['module']['#value'] == 'node' && user_access('use advanced search')) {
// Keyword boxes:
$form['advanced'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Advanced search'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module
index 8e6e65b..06214b2 100644
--- a/core/modules/overlay/overlay.module
+++ b/core/modules/overlay/overlay.module
@@ -88,7 +88,7 @@ function overlay_form_user_profile_form_alter(&$form, &$form_state) {
$account = $form_state['controller']->getEntity($form_state);
if (user_access('access overlay', $account)) {
$form['overlay_control'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Administrative overlay'),
'#weight' => 4,
'#collapsible' => TRUE,
diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc
index 5465141..e78502c 100644
--- a/core/modules/path/path.admin.inc
+++ b/core/modules/path/path.admin.inc
@@ -296,7 +296,7 @@ function path_admin_delete_confirm_submit($form, &$form_state) {
*/
function path_admin_filter_form($form, &$form_state, $keys = '') {
$form['#attributes'] = array('class' => array('search-form'));
- $form['basic'] = array('#type' => 'fieldset',
+ $form['basic'] = array('#type' => 'details',
'#title' => t('Filter aliases'),
'#attributes' => array('class' => array('container-inline')),
);
diff --git a/core/modules/path/path.js b/core/modules/path/path.js
index 41b6e8f..7349d12 100644
--- a/core/modules/path/path.js
+++ b/core/modules/path/path.js
@@ -6,9 +6,9 @@
"use strict";
-Drupal.behaviors.pathFieldsetSummaries = {
+Drupal.behaviors.pathDetailsSummaries = {
attach: function (context) {
- $(context).find('fieldset.path-form').drupalSetSummary(function (context) {
+ $(context).find('.path-form').drupalSetSummary(function (context) {
var path = $('.form-item-path-alias input').val();
return path ?
diff --git a/core/modules/path/path.module b/core/modules/path/path.module
index 942fbb6..cd9b952 100644
--- a/core/modules/path/path.module
+++ b/core/modules/path/path.module
@@ -120,7 +120,7 @@ function path_form_node_form_alter(&$form, $form_state) {
);
$form['path'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('URL path settings'),
'#collapsible' => TRUE,
'#collapsed' => empty($path['alias']),
diff --git a/core/modules/poll/poll.module b/core/modules/poll/poll.module
index d3f8d3a..d1c6093 100644
--- a/core/modules/poll/poll.module
+++ b/core/modules/poll/poll.module
@@ -318,7 +318,7 @@ function poll_form(Node $node, &$form_state) {
$active = array(0 => t('Closed'), 1 => t('Active'));
$form['settings'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#collapsible' => TRUE,
'#title' => t('Poll settings'),
'#weight' => -3,
diff --git a/core/modules/search/search.admin.inc b/core/modules/search/search.admin.inc
index 57e5d6b..ef70eb7 100644
--- a/core/modules/search/search.admin.inc
+++ b/core/modules/search/search.admin.inc
@@ -61,7 +61,7 @@ function search_admin_settings($form, &$form_state) {
$count = format_plural($remaining, 'There is 1 item left to index.', 'There are @count items left to index.');
$percentage = ((int)min(100, 100 * ($total - $remaining) / max(1, $total))) . '%';
$status = '
' . t('%percentage of the site has been indexed.', array('%percentage' => $percentage)) . ' ' . $count . '
';
- $form['status'] = array('#type' => 'fieldset', '#title' => t('Indexing status'));
+ $form['status'] = array('#type' => 'details', '#title' => t('Indexing status'));
$form['status']['status'] = array('#markup' => $status);
$form['status']['wipe'] = array('#type' => 'submit', '#value' => t('Re-index site'), '#submit' => array('search_admin_reindex_submit'));
@@ -69,7 +69,7 @@ function search_admin_settings($form, &$form_state) {
// Indexing throttle:
$form['indexing_throttle'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Indexing throttle')
);
$form['indexing_throttle']['cron_limit'] = array(
@@ -81,7 +81,7 @@ function search_admin_settings($form, &$form_state) {
);
// Indexing settings:
$form['indexing_settings'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Indexing settings')
);
$form['indexing_settings']['info'] = array(
@@ -103,7 +103,7 @@ function search_admin_settings($form, &$form_state) {
);
$form['active'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Active search modules')
);
$module_options = _search_get_module_names();
diff --git a/core/modules/search/search.api.php b/core/modules/search/search.api.php
index 0dd0a84..e3c8cbb 100644
--- a/core/modules/search/search.api.php
+++ b/core/modules/search/search.api.php
@@ -133,7 +133,7 @@ function hook_search_status() {
function hook_search_admin() {
// Output form for defining rank factor weights.
$form['content_ranking'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Content ranking'),
);
$form['content_ranking']['#theme'] = 'node_search_admin';
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
index 8abc198..8db5bde 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
@@ -276,13 +276,13 @@ function assertAssertion($message, $type, $status, $file, $function) {
function getTestResults() {
$results = array();
if ($this->parse()) {
- if ($fieldset = $this->getResultFieldSet()) {
+ if ($details = $this->getResultFieldSet()) {
// Code assumes this is the only test in group.
- $results['summary'] = $this->asText($fieldset->div->div[1]);
- $results['name'] = $this->asText($fieldset->legend);
+ $results['summary'] = $this->asText($details->div->div[1]);
+ $results['name'] = $this->asText($details->summary);
$results['assertions'] = array();
- $tbody = $fieldset->div->table->tbody;
+ $tbody = $details->div->table->tbody;
foreach ($tbody->tr as $row) {
$assertion = array();
$assertion['message'] = $this->asText($row->td[0]);
@@ -300,14 +300,14 @@ function getTestResults() {
}
/**
- * Get the fieldset containing the results for group this test is in.
+ * Get the details containing the results for group this test is in.
*/
function getResultFieldSet() {
- $fieldsets = $this->xpath('//fieldset');
+ $all_details = $this->xpath('//details');
$info = $this->getInfo();
- foreach ($fieldsets as $fieldset) {
- if ($this->asText($fieldset->legend) == $info['name']) {
- return $fieldset;
+ foreach ($all_details as $details) {
+ if ($this->asText($details->summary) == $info['name']) {
+ return $details;
}
}
return FALSE;
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
index f9bc3f4..3bb29f5 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -1368,7 +1368,7 @@ protected function drupalPostAJAX($path, $edit, $triggering_element, $ajax_path
if ($wrapperNode) {
// ajax.js adds an enclosing DIV to work around a Safari bug.
$newDom = new DOMDocument();
- $newDom->loadHTML('
' . $command['data'] . '
');
+ @$newDom->loadHTML('
' . $command['data'] . '
');
$newNode = $dom->importNode($newDom->documentElement->firstChild->firstChild, TRUE);
$method = isset($command['method']) ? $command['method'] : $ajax_settings['method'];
// The "method" is a jQuery DOM manipulation function. Emulate
diff --git a/core/modules/simpletest/simpletest.pages.inc b/core/modules/simpletest/simpletest.pages.inc
index 337a62c..fcd90ab 100644
--- a/core/modules/simpletest/simpletest.pages.inc
+++ b/core/modules/simpletest/simpletest.pages.inc
@@ -10,7 +10,7 @@
*/
function simpletest_test_form($form) {
$form['tests'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Tests'),
'#description' => t('Select the test(s) or test group(s) you would like to run, and click Run tests.'),
);
@@ -41,7 +41,7 @@ function simpletest_test_form($form) {
'#value' => t('Run tests'),
);
$form['clean'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#title' => t('Clean test environment'),
@@ -219,9 +219,9 @@ function simpletest_result_form($form, &$form_state, $test_id) {
'fail' => array(),
);
- // Summary result fieldset.
+ // Summary result widget.
$form['result'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Results'),
);
$form['result']['summary'] = $summary = array(
@@ -238,10 +238,10 @@ function simpletest_result_form($form, &$form_state, $test_id) {
$header = array(t('Message'), t('Group'), t('Filename'), t('Line'), t('Function'), array('colspan' => 2, 'data' => t('Status')));
$form['result']['results'] = array();
foreach ($results as $group => $assertions) {
- // Create group fieldset with summary information.
+ // Create group details with summary information.
$info = call_user_func(array($group, 'getInfo'));
$form['result']['results'][$group] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => $info['name'],
'#description' => $info['description'],
'#collapsible' => TRUE,
@@ -289,7 +289,7 @@ function simpletest_result_form($form, &$form_state, $test_id) {
// Actions.
$form['#action'] = url('admin/config/development/testing/results/re-run');
$form['action'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Actions'),
'#attributes' => array('class' => array('container-inline')),
'#weight' => -11,
@@ -437,7 +437,7 @@ function simpletest_result_status_image($status) {
function simpletest_settings_form($form, &$form_state) {
$config = config('simpletest.settings');
$form['general'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('General'),
);
$form['general']['simpletest_clear_results'] = array(
@@ -454,7 +454,7 @@ function simpletest_settings_form($form, &$form_state) {
);
$form['httpauth'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('HTTP authentication'),
'#description' => t('HTTP auth settings to be used by the SimpleTest browser during testing. Useful when the site requires basic HTTP authentication.'),
'#collapsible' => TRUE,
diff --git a/core/modules/statistics/statistics.admin.inc b/core/modules/statistics/statistics.admin.inc
index bec1eb5..5e0e256 100644
--- a/core/modules/statistics/statistics.admin.inc
+++ b/core/modules/statistics/statistics.admin.inc
@@ -331,7 +331,7 @@ function statistics_settings_form($form, &$form_state) {
$config = config('statistics.settings');
// Access log settings.
$form['access'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Access log settings'),
);
$form['access']['statistics_enable_access_log'] = array(
@@ -350,7 +350,7 @@ function statistics_settings_form($form, &$form_state) {
// Content counter settings.
$form['content'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Content viewing counter settings'),
);
$form['content']['statistics_count_content_views'] = array(
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/ArrayUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/ArrayUnitTest.php
index 48425e2..ede0b0b 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/ArrayUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/ArrayUnitTest.php
@@ -36,12 +36,12 @@ function setUp() {
parent::setUp();
// Create a form structure with a nested element.
- $this->form['fieldset']['element'] = array(
+ $this->form['details']['element'] = array(
'#value' => 'Nested element',
);
// Set up parent array.
- $this->parents = array('fieldset', 'element');
+ $this->parents = array('details', 'element');
}
/**
@@ -57,7 +57,7 @@ function testGet() {
$value['#value'] = 'New value';
$value = drupal_array_get_nested_value($this->form, $this->parents);
$this->assertEqual($value['#value'], 'New value', 'Nested element value was changed by reference.');
- $this->assertEqual($this->form['fieldset']['element']['#value'], 'New value', 'Nested element value was changed by reference.');
+ $this->assertEqual($this->form['details']['element']['#value'], 'New value', 'Nested element value was changed by reference.');
// Verify that an existing key is reported back.
$key_exists = NULL;
@@ -83,8 +83,8 @@ function testSet() {
// Verify setting the value of a nested element.
drupal_array_set_nested_value($this->form, $this->parents, $new_value);
- $this->assertEqual($this->form['fieldset']['element']['#value'], 'New value', 'Changed nested element value found.');
- $this->assertIdentical($this->form['fieldset']['element']['#required'], TRUE, 'New nested element value found.');
+ $this->assertEqual($this->form['details']['element']['#value'], 'New value', 'Changed nested element value found.');
+ $this->assertIdentical($this->form['details']['element']['#required'], TRUE, 'New nested element value found.');
}
/**
@@ -97,13 +97,13 @@ function testUnset() {
$parents = $this->parents;
$parents[] = 'foo';
drupal_array_unset_nested_value($this->form, $parents, $key_existed);
- $this->assertTrue(isset($this->form['fieldset']['element']['#value']), 'Outermost nested element key still exists.');
+ $this->assertTrue(isset($this->form['details']['element']['#value']), 'Outermost nested element key still exists.');
$this->assertIdentical($key_existed, FALSE, 'Non-existing key not found.');
// Verify unsetting a nested element.
$key_existed = NULL;
drupal_array_unset_nested_value($this->form, $this->parents, $key_existed);
- $this->assertFalse(isset($this->form['fieldset']['element']), 'Removed nested element not found.');
+ $this->assertFalse(isset($this->form['details']['element']), 'Removed nested element not found.');
$this->assertIdentical($key_existed, TRUE, 'Existing key was found.');
}
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 adc35ba..485dc50 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php
@@ -94,7 +94,7 @@ function testDrupalRenderChildrenAttached() {
$child_js = drupal_get_path('module', 'forum') . '/forum.js';
$subchild_js = drupal_get_path('module', 'book') . '/book.js';
$element = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#cache' => array(
'keys' => array('simpletest', 'drupal_render', 'children_attached'),
),
@@ -102,7 +102,7 @@ function testDrupalRenderChildrenAttached() {
'#title' => 'Parent',
);
$element['child'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#attached' => array('js' => array($child_js)),
'#title' => 'Child',
);
@@ -240,19 +240,19 @@ function testDrupalRenderFormElements() {
));
$element = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => $this->randomName(),
);
- $this->assertRenderedElement($element, '//fieldset/legend[contains(., :title)]', array(
+ $this->assertRenderedElement($element, '//details/summary[contains(., :title)]', array(
':title' => $element['#title'],
));
$element = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => $this->randomName(),
'#collapsible' => TRUE,
);
- $this->assertRenderedElement($element, '//fieldset[contains(@class, :class)]', array(
+ $this->assertRenderedElement($element, '//details[contains(@class, :class)]', array(
':class' => 'collapsible',
));
@@ -261,7 +261,7 @@ function testDrupalRenderFormElements() {
'#title' => $this->randomName(),
'#markup' => $this->randomName(),
);
- $this->assertRenderedElement($element, '//fieldset/div/div[contains(@class, :class) and contains(., :markup)]', array(
+ $this->assertRenderedElement($element, '//details/div/div[contains(@class, :class) and contains(., :markup)]', array(
':class' => 'form-type-item',
':markup' => $element['item']['#markup'],
));
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index c55289c..6f1c540 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -248,7 +248,7 @@ function system_themes_page() {
function system_themes_admin_form($form, &$form_state, $theme_options) {
// Administration theme settings.
$form['admin_theme'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Administration theme'),
);
$form['admin_theme']['admin_theme'] = array(
@@ -419,7 +419,7 @@ function system_theme_settings($form, &$form_state, $key = '') {
}
$form['theme_settings'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Toggle display'),
'#description' => t('Enable or disable the display of certain page elements.'),
);
@@ -434,7 +434,7 @@ function system_theme_settings($form, &$form_state, $key = '') {
}
if (!element_children($form['theme_settings'])) {
- // If there is no element in the theme settings fieldset then do not show
+ // If there is no element in the theme settings details then do not show
// it -- but keep it in the form if another module wants to alter.
$form['theme_settings']['#access'] = FALSE;
}
@@ -442,7 +442,7 @@ function system_theme_settings($form, &$form_state, $key = '') {
// Logo settings, only available when file.module is enabled.
if ((!$key) || in_array('logo', $features) && module_exists('file')) {
$form['logo'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Logo image settings'),
'#attributes' => array('class' => array('theme-settings-bottom')),
);
@@ -476,7 +476,7 @@ function system_theme_settings($form, &$form_state, $key = '') {
if ((!$key) || in_array('favicon', $features) && module_exists('file')) {
$form['favicon'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Shortcut icon settings'),
'#description' => t("Your shortcut icon, or 'favicon', is displayed in the address bar and bookmarks of most browsers."),
);
@@ -545,7 +545,7 @@ function system_theme_settings($form, &$form_state, $key = '') {
$function = $themes[$key]->prefix . '_engine_settings';
if (function_exists($function)) {
$form['engine_specific'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Theme-engine-specific settings'),
'#description' => t('These settings only exist for the themes based on the %engine theme engine.', array('%engine' => $themes[$key]->prefix)),
);
@@ -911,13 +911,13 @@ function system_modules($form, $form_state = array()) {
$form['modules'][$module->info['package']][$filename] = _system_modules_build_row($module->info, $extra);
}
- // Add basic information to the fieldsets.
+ // Add basic information to the details.
foreach (element_children($form['modules']) as $package) {
$form['modules'][$package] += array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t($package),
'#collapsible' => TRUE,
- '#theme' => 'system_modules_fieldset',
+ '#theme' => 'system_modules_details',
'#header' => array(
array('data' => t('Enabled'), 'class' => array('checkbox')),
t('Name'),
@@ -925,12 +925,12 @@ function system_modules($form, $form_state = array()) {
array('data' => t('Description'), 'class' => array(RESPONSIVE_PRIORITY_LOW)),
array('data' => t('Operations'), 'colspan' => 3),
),
- // Ensure that the "Core" package fieldset comes first.
+ // Ensure that the "Core" package comes first.
'#weight' => $package == 'Core' ? -10 : NULL,
);
}
- // Lastly, sort all fieldsets by title.
+ // Lastly, sort all packages by title.
uasort($form['modules'], 'element_sort_by_title');
$form['actions'] = array('#type' => 'actions');
@@ -1384,7 +1384,7 @@ function system_site_information_settings($form, &$form_state) {
}
$form['site_information'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Site details'),
);
$form['site_information']['site_name'] = array(
@@ -1407,7 +1407,7 @@ function system_site_information_settings($form, &$form_state) {
'#required' => TRUE,
);
$form['front_page'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Front page'),
);
$form['front_page']['site_frontpage'] = array(
@@ -1419,7 +1419,7 @@ function system_site_information_settings($form, &$form_state) {
'#field_prefix' => url(NULL, array('absolute' => TRUE)),
);
$form['error_page'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Error pages'),
);
$form['error_page']['site_403'] = array(
@@ -1513,7 +1513,7 @@ function system_cron_settings($form, &$form_state) {
);
$form['cron'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
);
$form['cron']['cron_safe_threshold'] = array(
'#type' => 'select',
@@ -1598,7 +1598,7 @@ function system_performance_settings($form, &$form_state) {
$config = config('system.performance');
$form['clear_cache'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Clear cache'),
);
@@ -1609,7 +1609,7 @@ function system_performance_settings($form, &$form_state) {
);
$form['caching'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Caching'),
);
@@ -1639,7 +1639,7 @@ function system_performance_settings($form, &$form_state) {
}
$form['bandwidth_optimization'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Bandwidth optimization'),
'#description' => t('External resources can be optimized automatically, which can reduce both the size and number of requests made to your website.') . $disabled_message,
);
@@ -1862,7 +1862,7 @@ function system_regional_settings() {
$zones = system_time_zones();
$form['locale'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Locale'),
);
@@ -1883,7 +1883,7 @@ function system_regional_settings() {
);
$form['timezone'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Time zones'),
);
@@ -2493,13 +2493,12 @@ function theme_status_report($variables) {
*
* @ingroup themeable
*/
-function theme_system_modules_fieldset($variables) {
+function theme_system_modules_details($variables) {
$form = $variables['form'];
// Individual table headers.
$rows = array();
- // Iterate through all the modules, which are
- // children of this fieldset.
+ // Iterate through all the modules, which are children of this element.
foreach (element_children($form) as $key) {
// Stick it into $module for easier accessing.
$module = $form[$key];
diff --git a/core/modules/system/system.base.css b/core/modules/system/system.base.css
index c50b085..f336ebd 100644
--- a/core/modules/system/system.base.css
+++ b/core/modules/system/system.base.css
@@ -38,25 +38,13 @@
}
/**
- * Collapsible fieldsets.
+ * Collapsible details.
*
* @see collapse.js
*/
-.js fieldset.collapsed {
- border-bottom-width: 0;
- border-left-width: 0;
- border-right-width: 0;
- height: 1em;
-}
-.js fieldset.collapsed .fieldset-wrapper {
+.js details:not([open]) .details-wrapper {
display: none;
}
-fieldset.collapsible {
- position: relative;
-}
-fieldset.collapsible .fieldset-legend {
- display: block;
-}
/**
* Resizable textareas.
@@ -192,8 +180,8 @@ tr .ajax-progress-throbber .throbber {
.container-inline label {
display: inline;
}
-/* Fieldset contents always need to be rendered as block. */
-.container-inline .fieldset-wrapper {
+/* Details contents always need to be rendered as block. */
+.container-inline .details-wrapper {
display: block;
}
@@ -216,7 +204,7 @@ tr .ajax-progress-throbber .throbber {
* Hide elements from all users.
*
* Used for elements which should not be immediately displayed to any user. An
- * example would be a collapsible fieldset that will be expanded with a click
+ * example would be collapsible details that will be expanded with a click
* from a user. The effect of this class can be toggled with the jQuery show()
* and hide() functions.
*/
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 4475104..44db0a6 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -150,7 +150,7 @@ function system_theme() {
'confirm_form' => array(
'render element' => 'form',
),
- 'system_modules_fieldset' => array(
+ 'system_modules_details' => array(
'render element' => 'form',
'file' => 'system.admin.inc',
),
@@ -526,10 +526,17 @@ function system_element_info() {
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#value' => NULL,
- '#process' => array('form_process_fieldset', 'ajax_process_form'),
- '#pre_render' => array('form_pre_render_fieldset'),
+ '#process' => array('ajax_process_form'),
'#theme_wrappers' => array('fieldset'),
);
+ $types['details'] = array(
+ '#collapsible' => FALSE,
+ '#collapsed' => FALSE,
+ '#value' => NULL,
+ '#process' => array('form_process_details', 'ajax_process_form'),
+ '#pre_render' => array('form_pre_render_details'),
+ '#theme_wrappers' => array('details'),
+ );
$types['vertical_tabs'] = array(
'#theme_wrappers' => array('vertical_tabs'),
'#default_tab' => '',
@@ -1260,9 +1267,9 @@ function system_library_info() {
),
);
- // Drupal's collapsible fieldset.
+ // Drupal's collapsible details.
$libraries['drupal.collapse'] = array(
- 'title' => 'Drupal collapsible fieldset',
+ 'title' => 'Drupal collapsible details',
'version' => VERSION,
'js' => array(
'core/misc/collapse.js' => array('group' => JS_DEFAULT),
@@ -2491,7 +2498,7 @@ function system_user_timezone(&$form, &$form_state) {
$account = $form_state['controller']->getEntity($form_state);
$form['timezone'] = array(
- '#type' => 'fieldset',
+ '#type' => 'details',
'#title' => t('Locale settings'),
'#weight' => 6,
'#collapsible' => TRUE,
diff --git a/core/modules/system/system.theme-rtl.css b/core/modules/system/system.theme-rtl.css
index b13345a..e5dc2c1 100644
--- a/core/modules/system/system.theme-rtl.css
+++ b/core/modules/system/system.theme-rtl.css
@@ -39,16 +39,19 @@ th {
}
/**
- * Collapsible fieldsets.
+ * Collapsible details.
*/
-.js fieldset.collapsible > legend .fieldset-legend {
- background-position: 98% 75%;
- padding-left: 0;
- padding-right: 15px;
+.collapse-processed > summary:before {
+ background-position: 100% 100%;
+ float: right;
}
-.js fieldset.collapsed > legend .fieldset-legend {
- background-image: url(../../misc/menu-collapsed-rtl.png);
- background-position: 98% 50%;
+.collapse-processed:not([open]) > summary:before {
+ background-position: 75% 35%;
+ -moz-transform: rotate(90deg);
+ -ms-transform: rotate(90deg);
+ -o-transform: rotate(90deg);
+ -webkit-transform: rotate(90deg);
+ transform: rotate(90deg);
}
/**
diff --git a/core/modules/system/system.theme.css b/core/modules/system/system.theme.css
index 84c0078..65d5f73 100644
--- a/core/modules/system/system.theme.css
+++ b/core/modules/system/system.theme.css
@@ -8,7 +8,8 @@
* HTML elements.
*/
fieldset {
- margin-bottom: 1em;
+ border: 1px solid #ccc;
+ margin: 1em 0;
padding: 0.5em;
}
form {
@@ -180,22 +181,43 @@ abbr.form-required, abbr.tabledrag-changed, abbr.ajax-changed {
}
/**
- * Collapsible fieldsets.
+ * Collapsible details.
*
* @see collapse.js
+ * @thanks http://nicolasgallagher.com/css-background-image-hacks/
*/
-.js fieldset.collapsible > legend .fieldset-legend a {
- background: url(../../misc/menu-expanded.png) 5px 65% no-repeat; /* LTR */
- padding-left: 15px; /* LTR */
-}
-.js fieldset.collapsed > legend .fieldset-legend a {
- background-image: url(../../misc/menu-collapsed.png); /* LTR */
- background-position: 5px 50%; /* LTR */
+details {
+ border: 1px solid #ccc;
+ margin-top: 1em;
+ margin-bottom: 1em;
}
-.fieldset-legend span.summary {
- color: #999;
- font-size: 0.9em;
- margin-left: 0.5em;
+details > .details-wrapper {
+ padding: 0.5em 1.5em;
+}
+/* @todo Regression: The summary of uncollapsible details are no longer
+ vertically aligned with the .details-wrapper in browsers without native
+ details support. */
+summary {
+ padding: 0.2em 0.5em;
+}
+.collapse-processed > summary {
+ padding-left: 0.5em;
+ padding-right: 0.5em;
+}
+.collapse-processed > summary:before {
+ background: url(../../misc/menu-expanded.png) 0px 100% no-repeat; /* LTR */
+ content: "";
+ float: left;
+ height: 1em;
+ width: 1em;
+}
+.collapse-processed:not([open]) > summary:before {
+ background-position: 25% 35%; /* LTR */
+ -moz-transform: rotate(-90deg);
+ -ms-transform: rotate(-90deg);
+ -o-transform: rotate(-90deg);
+ -webkit-transform: rotate(-90deg);
+ transform: rotate(-90deg);
}
/**
diff --git a/core/modules/system/tests/modules/design_test/design_test.info b/core/modules/system/tests/modules/design_test/design_test.info
new file mode 100644
index 0000000..ff7159c
--- /dev/null
+++ b/core/modules/system/tests/modules/design_test/design_test.info
@@ -0,0 +1,6 @@
+name = Design test
+description = Support module for design, markup, JavaScript, and CSS testing.
+package = Testing
+version = VERSION
+core = 8.x
+;hidden = TRUE
diff --git a/core/modules/system/tests/modules/design_test/design_test.module b/core/modules/system/tests/modules/design_test/design_test.module
new file mode 100644
index 0000000..b0dc5a1
--- /dev/null
+++ b/core/modules/system/tests/modules/design_test/design_test.module
@@ -0,0 +1,144 @@
+ 'name', 'recurse' => TRUE));
+ foreach ($tests as $name => $file) {
+ // Build include file path and category.
+ $filepath = strtr($file->uri, array($module_path . '/' => ''));
+ list($category) = explode('/', $filepath, 2);
+ $categories[$category] = $category;
+
+ // Build router item path.
+ $path = preg_replace('@[^a-zA-Z0-9-]@', '-', $name);
+ // Build page callback function name.
+ $callback = "design_test_{$category}_" . strtr($path, '-', '_');
+
+ // Build router item callback.
+ if ($category == 'form') {
+ $page_callback = 'drupal_get_form';
+ }
+ else {
+ $page_callback = $callback;
+ }
+
+ $items["design_test/{$category}/{$path}"] = array(
+ 'title' => drupal_ucfirst($name),
+ 'page callback' => $page_callback,
+ 'page arguments' => array($callback),
+ 'file' => $filepath,
+ 'access callback' => TRUE,
+ 'type' => MENU_LOCAL_TASK | MENU_VISIBLE_IN_TREE,
+ );
+ }
+
+ // Now add some theme local tasks black magic...
+ $themes = array();
+ $list = list_themes();
+ foreach ($list as $name => $theme) {
+ if ($theme->status && !isset($theme->info['hidden'])) {
+ $themes[$name] = $theme->info['name'];
+ }
+ }
+ foreach ($items as $path => $item) {
+ foreach ($themes as $name => $theme) {
+ $items[$path . '/' . $name] = array(
+ 'title' => $theme,
+ 'type' => MENU_LOCAL_ACTION,
+ 'theme callback' => '_block_custom_theme',
+ 'theme arguments' => array($name),
+ 'access callback' => TRUE,
+ );
+ }
+ }
+
+ $items['design_test'] = array(
+ 'title' => 'Design test',
+ 'page callback' => 'design_test_category_page',
+ 'page arguments' => array(1),
+ 'access callback' => TRUE,
+ );
+ $items['design_test/list'] = array(
+ 'title' => 'List',
+ 'type' => MENU_DEFAULT_LOCAL_TASK,
+ 'weight' => -10,
+ );
+ // Lastly, add the category containers.
+ foreach ($categories as $category) {
+ $items["design_test/{$category}"] = array(
+ 'title' => drupal_ucfirst($category),
+ 'page callback' => 'design_test_category_page',
+ 'page arguments' => array(1),
+ 'access callback' => TRUE,
+ 'type' => MENU_LOCAL_TASK | MENU_VISIBLE_IN_TREE,
+ );
+ }
+
+ return $items;
+}
+
+/**
+ * Menu page callback for a category listing page.
+ *
+ * This is a specialized version of system_admin_menu_block_page(), which
+ * retrieves all direct child menu links of the current page, regardless of
+ * their type, skips default local tasks, and outputs them as a simple menu
+ * tree as the main page content.
+ *
+ * @param string $category
+ * The design test category being currently accessed. Maps to the subdirectory
+ * names of this module.
+ *
+ * @return array
+ * A render array containing a menu link tree.
+ */
+function design_test_category_page($category) {
+ $link = menu_link_get_preferred();
+ $tree = menu_build_tree($link['menu_name'], array(
+ 'expanded' => array($link['mlid']),
+ 'min_depth' => $link['depth'] + 1,
+ 'max_depth' => $link['depth'] + 2,
+ ));
+ // Local tasks are hidden = -1, so normally not rendered in menu trees.
+ foreach ($tree as &$data) {
+ // Exclude default local tasks.
+ if (!($data['link']['type'] & MENU_LINKS_TO_PARENT)) {
+ $data['link']['hidden'] = 0;
+ }
+ }
+ $build = menu_tree_output($tree);
+ return $build;
+}
diff --git a/core/modules/system/tests/modules/design_test/form/details.inc b/core/modules/system/tests/modules/design_test/form/details.inc
new file mode 100644
index 0000000..febcda3
--- /dev/null
+++ b/core/modules/system/tests/modules/design_test/form/details.inc
@@ -0,0 +1,173 @@
+ 'details',
+ '#title' => 'Collapsible details',
+ '#description' => 'Details description',
+ '#collapsible' => TRUE,
+ '#collapsed' => FALSE,
+ '#states' => array(
+ 'collapsed' => array(
+ ':input[name="states-trigger"]' => array('checked' => TRUE),
+ ),
+ ),
+ );
+
+ $form['collapsed'] = array(
+ '#type' => 'details',
+ '#title' => 'Collapsed details',
+ '#description' => 'Details description',
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ );
+ $form['collapsed']['textfield'] = array(
+ '#type' => 'textfield',
+ '#title' => 'Textfield',
+ '#default_value' => '',
+ '#description' => 'Textfield description',
+ '#required' => TRUE,
+ );
+ $form['collapsed']['textarea'] = array(
+ '#type' => 'textarea',
+ '#title' => 'Textarea',
+ '#default_value' => '',
+ '#description' => 'Textarea description',
+ '#required' => TRUE,
+ );
+
+ $form['collapsed2'] = array(
+ '#type' => 'details',
+ '#title' => 'Details',
+ '#description' => 'Details description',
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ );
+ $form['collapsed2']['collapsible'] = array(
+ '#type' => 'details',
+ '#title' => 'Collapsible details',
+ '#description' => 'Details description',
+ '#collapsible' => TRUE,
+ '#collapsed' => FALSE,
+ );
+ $form['collapsed2']['collapsed'] = array(
+ '#type' => 'details',
+ '#title' => 'Collapsed details',
+ '#description' => 'Details description',
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ );
+ $form['collapsed2']['regular'] = array(
+ '#type' => 'details',
+ '#title' => 'Details',
+ '#description' => 'Details description',
+ '#collapsible' => FALSE,
+ );
+
+ $form['regular'] = array(
+ '#type' => 'details',
+ '#title' => 'Details',
+ '#description' => 'Details description',
+ '#collapsible' => FALSE,
+ );
+
+ #$form['#attributes'] = array('class' => array('search-form'));
+ $form['basic'] = array(
+ '#type' => 'details',
+ '#title' => 'Filter aliases',
+ '#attributes' => array('class' => array('container-inline')),
+ );
+ $form['basic']['filter'] = array(
+ '#type' => 'textfield',
+ '#title' => '',
+ '#default_value' => '',
+ '#maxlength' => 128,
+ '#size' => 25,
+ );
+ $form['basic']['actions'] = array(
+ '#type' => 'actions',
+ );
+ $form['basic']['actions']['submit'] = array(
+ '#type' => 'submit',
+ '#value' => 'Filter',
+ );
+ $form['basic']['actions']['reset'] = array(
+ '#type' => 'submit',
+ '#value' => 'Reset',
+ );
+
+ // Vertical tabs.
+ // Replicate the entire form; some more black magic.
+ $subform = array_diff_key($form, array('group' => 0, 'tabs' => 0));
+
+ $form['group'] = array(
+ '#type' => 'vertical_tabs',
+ );
+ $form['tabs'][0] = array(
+ '#type' => 'details',
+ '#title' => 'Vertical tab 1',
+ '#description' => 'Description',
+ '#group' => 'group',
+ );
+ $form['tabs'][0] += $subform;
+
+ $form['tabs'][1] = array(
+ '#type' => 'details',
+ '#title' => 'Vertical tab 2',
+ '#description' => '