diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 319fb2f..96eb451 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2440,32 +2440,28 @@ function theme_feed_icon($variables) { * * @param array $variables * An associative array containing: - * - element: An associative array describing the tag: - * - #tag: The tag name to output. Typical tags added to the HTML HEAD: - * - meta: Used to provide meta information, such as a page refresh. - * - link: Used to refer to stylesheets and other contextual information. - * - script: Used for loading JavaScript. - * - #attributes: (optional) An array of HTML attributes to apply to the - * tag. - * - #value: (optional) A string containing tag content, such as inline CSS. - * - #value_prefix: (optional) A string to prepend to #value, e.g. a CDATA - * wrapper prefix. - * - #value_suffix: (optional) A string to append to #value, e.g. a CDATA - * wrapper suffix. + * - tag: The tag name to output. Typical tags added to the HTML HEAD: + * - meta: Used to provide meta information, such as a page refresh. + * - link: Used to refer to stylesheets and other contextual information. + * - script: Used for loading JavaScript. + * - attributes: (optional) An array of HTML attributes to apply to the + * tag. + * - value: (optional) A string containing tag content, such as inline CSS. + * - value_prefix: (optional) A string to prepend to #value, e.g. a CDATA + * wrapper prefix. + * - value_suffix: (optional) A string to append to #value, e.g. a CDATA + * wrapper suffix. */ function template_preprocess_html_tag(&$variables) { - $element = $variables['element']; - $variables['attributes'] = isset($element['#attributes']) ? new Attribute($element['#attributes']) : new Attribute(array()); - $variables['tag'] = $element['#tag']; - if (isset($element['#value'])) { - $variables['value'] = $element['#value']; - } - if (isset($element['#value_prefix'])) { - $variables['value_prefix'] = $element['#value_prefix']; - } - if (isset($element['#value_prefix'])) { - $variables['value_suffix'] = $element['#value_suffix']; + // Remove default 'html-tag' class from attributes, but leave other classes. + // @todo: Remove this hack once http://drupal.org/node/1938430 lands. + if (!empty($variables['attributes']['class'])) { + $variables['attributes']['class'] = array_diff($variables['attributes']['class'], array('html-tag')); + if (empty($variables['attributes']['class'])) { + unset($variables['attributes']['class']); + } } + $variables['attributes'] = new Attribute($variables['attributes']); } /** @@ -3204,7 +3200,7 @@ function drupal_common_theme() { 'variables' => array('size' => 1), ), 'html_tag' => array( - 'render element' => 'element', + 'variables' => array('tag' => NULL, 'value' => NULL, 'attributes' => array(), 'value_prefix' => NULL, 'value_suffix' => NULL), 'template' => 'html-tag', ), // From theme.maintenance.inc. diff --git a/core/modules/system/templates/html-tag.html.twig b/core/modules/system/templates/html-tag.html.twig index a917cc3..83a876c 100644 --- a/core/modules/system/templates/html-tag.html.twig +++ b/core/modules/system/templates/html-tag.html.twig @@ -22,10 +22,10 @@ @todo Delete this file once http://drupal.org/node/1825090 is resolved. #} {# - We use 'is defined' here because