Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293522

Duplicate "attributes" in docblock

$
0
0

Problem/Motivation

Repeat mention of "attributes" in docblock for template_preprocess_image_style(&$variables) preprocess function:
https://git.drupalcode.org/project/drupal/blob/8.8.x/core/modules/image/...

/**
 * Prepares variables for image style templates.
 *
 * Default template: image-style.html.twig.
 *
 * @param array $variables
 *   An associative array containing:
 *   - width: The width of the image.
 *   - height: The height of the image.
 *   - style_name: The name of the image style to be applied.
 *   - attributes: Additional attributes to apply to the image.
 *   - uri: URI of the source image before styling.
 *   - alt: The alternative text for text-based browsers. HTML 4 and XHTML 1.0
 *     always require an alt attribute. The HTML 5 draft allows the alt
 *     attribute to be omitted in some cases. Therefore, this variable defaults
 *     to an empty string, but can be set to NULL for the attribute to be
 *     omitted. Usually, neither omission nor an empty string satisfies
 *     accessibility requirements, so it is strongly encouraged for code using
 *     '#theme' => 'image_style' to pass a meaningful value for this variable.
 *     - http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.8
 *     - http://www.w3.org/TR/xhtml1/dtds.html
 *     - http://dev.w3.org/html5/spec/Overview.html#alt
 *   - title: The title text is displayed when the image is hovered in some
 *     popular browsers.
 *   - attributes: Associative array of attributes to be placed in the img tag.
 */
function template_preprocess_image_style(&$variables) {

Proposed resolution

Combine the substance of the two, and, idk the proper order of things? It's obviously not alphabetical... is it the order in which the variables get declared in the code that follows, or?

Remaining tasks

Initial patch coming in a minute -- with my best guess/effort for combining the substance of the documentation, and ordering :)

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 293522

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>