-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gallery: Remove caption fallback for alt attribute #26676
Conversation
Size Change: -14 B (0%) Total Size: 1.21 MB
ℹ️ View Unchanged
|
Why didn't you consider to apply the fallback in edit? |
I performed some checks and this is what I found out:
If we merge this change, we should reopen #13164. I personally prefer this PR over #26574 only because it buys us more time to rethink how to improve the accessibility of the linked images in Gallery block without creating too much technical debt in the implementation and ensuring that we don't have to create a deprecation to cover something that is very rare:
Aside: The first result on Google has a quite interesting take on this (https://stackoverflow.com/a/58468470):
It might not be the case here, but it only makes the initial recommendation to use Unfortunately, introducing this new attribute would trigger the need for deprecation 😞 |
I considered it, but I'm similarly skeptical about it as you're about the
Considering these, and what @gziolo said, I think we should start with a simpler solution for 9.3, and reconsider how we'd like to solve this eventually when we're less pressed for time. |
Thanks a lot @gziolo for bringing a fresh perspective to this ❤️ The SO quote was particularly eye-opening; I agree that given that information, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do this. Thanks all for weighing in
Something to remember when we're back at the gutenberg/packages/block-library/src/image/image.js Lines 349 to 363 in 029b1d3
Also, the IMO it would be good to stay consistent and, whatever we end up with regarding the |
Working on this here - #25940 |
@gziolo that PR was not reverted; #26082 only changed where the caption content was added:
The From an accessibility point of view, I maintain that the best solution is something like #26574, except it should only apply to images that are inside links. In any case, further work on this issue must be tested with multiple screen readers, as that is the only way to be sure we get it right. |
I saw this change: #25833 contains also a comment:
|
Hmm, this deprecation is still in the file. I'm lost now: gutenberg/packages/block-library/src/gallery/deprecated.js Lines 22 to 175 in 3fd7a8e
Should we remove it? |
I opened #26736 in case we no longer need this deprecation added. |
* Cover block: Restore default overlay background (#26569) * Restore default Cover overlay background The default Cover block overlay background was removed. This changed the style of existing blocks on existing sites. Restore the default background in such a way that it does not conflict with theme-provided background-color styles and there is no need to artificially add extra specificity. Fix regression: #26545 * Limit the interface skeleton to a max width of 100% to prevent some blocks managing to exceed the width (#26552) * Cover Block: Restore opacity controls (#26625) * Fix image block centering when resizing to a smaller size (#26376) * Fix image block centering when resizing to a smaller size * Revert previous 100% width fix * Remove display: table when image block is resized to avoid centering of block * Match frontend classes for alignment in editor * Gallery: Remove caption fallback for alt attribute (#26676) * Fix quote block default alignment (#26680) * Gallery: Remove obsolete deprecation entry (#26736) * Do not apply text color if it is being overriden (#24626) * Fix: Preset colors don't work on button block style outline (#26707) * Tests: Add fixture for Column deprecation (#26774) * Fix/column width units (#26757) * Fix issues with different units in column widths * Columns with fixed width should keep width on recalculation * Address review feedback * fix undefined index notice in Social Link Block (#25663) * fix undefined index notice * use isset instead of array_key_exists check * Update packages/block-library/src/social-link/index.php Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl> Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl> * Adds in missing styling for toolbar when using text-only setting (#26769) * Adds in missing styling for toolbar when using text-only setting * Increases margin * Moves style to correct file * Inserter: Fix 'Browse All' in Quick Inserter (#26443) * Inserter: Fix 'Browse All' in Quick Inserter Maintain the insertion point in @wordpress/block-editor state when moving from the Quick Inserter to the Inserter. This fixes a bug where the insertion point is wrong after clicking a block appender and selecting 'Browse All'. Care is taken to not regress a previous bug where the insertion point is wrong after clicking an inline insertion button and selecting 'Browse ALl'. * Inserter: Fix typo Co-authored-by: Daniel Richards <daniel.richards@automattic.com> * Call getBlockInsertionPoint once * Add useSelect dependencies * Make setInsertionPoint unstable * Avoid setting `isVisible` state when `SET_INSERTION_POINT` is triggered * Make index required and clarify rootClientId usage * Split insertionPoint into two reducers * Fix getInsertionPoint selector that expects default state of reducer to be null * Avoid resetting insertionPoint state on HIDE_INSERTION_POINT Co-authored-by: Daniel Richards <daniel.richards@automattic.com> Co-authored-by: Jon Surrell <jon.surrell@automattic.com> Co-authored-by: Jacopo Tomasone <Copons@users.noreply.github.com> Co-authored-by: Daniel Richards <daniel.richards@automattic.com> Co-authored-by: Bernie Reiter <ockham@raz.or.at> Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl> Co-authored-by: Oliver Juhas <webmandesign@users.noreply.github.com> Co-authored-by: Jorge Costa <jorge.costa@automattic.com> Co-authored-by: Fabian Kägy <mail@fabian-kaegy.de> Co-authored-by: Tammie Lister <tammie@automattic.com> Co-authored-by: Robert Anderson <robert@noisysocks.com>
Fixes #26549.
Alternative to #26574, which is somewhat controversial (see discussion).
Effectively reverts #26082. Might require a follow-up for improved a11y.
Description
When a gallery image's
alt
attribute value is empty, we use what's in thecaption
prop to fill it out. The issue is thatcaption
can contain links, whereas thealt
attribute should not contain any HTML. This PR removes the fallback -- if the image has noalt
text set, thealt
attribute will be empty.How has this been tested?
Manually:
alt
attribute is empty.Types of changes
Bugfix
Checklist: