Skip to content
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

Iframe: try role=application #53364

Open
wants to merge 8 commits into
base: trunk
Choose a base branch
from
Open

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Aug 4, 2023

What?

Let's try role=application on the iframe. See #46260 (comment).

This PR also makes an adjustment to the RichText component. The component will now use role="textbox" by default with the option to override if necessary. However, role="group" is no longer a valid property here to avoid it being passed down from useBlockProps hook directly on RichText. Code comment added to explain.

Why?

To fine tune accessibility.

How?

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

@ellatrix ellatrix added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Aug 4, 2023
@ellatrix ellatrix requested a review from alexstine August 4, 2023 20:09
@github-actions
Copy link

github-actions bot commented Aug 4, 2023

Size Change: +20 B (0%)

Total Size: 1.74 MB

Filename Size Change
build/block-editor/index.min.js 256 kB +20 B (+0.01%)
ℹ️ View Unchanged
Filename Size
build/a11y/index.min.js 955 B
build/annotations/index.min.js 2.27 kB
build/api-fetch/index.min.js 2.32 kB
build/autop/index.min.js 2.1 kB
build/blob/index.min.js 578 B
build/block-directory/index.min.js 7.26 kB
build/block-directory/style-rtl.css 1.03 kB
build/block-directory/style.css 1.03 kB
build/block-editor/content-rtl.css 4.43 kB
build/block-editor/content.css 4.43 kB
build/block-editor/default-editor-styles-rtl.css 395 B
build/block-editor/default-editor-styles.css 395 B
build/block-editor/style-rtl.css 15.4 kB
build/block-editor/style.css 15.4 kB
build/block-library/blocks/archives/editor-rtl.css 61 B
build/block-library/blocks/archives/editor.css 60 B
build/block-library/blocks/archives/style-rtl.css 90 B
build/block-library/blocks/archives/style.css 90 B
build/block-library/blocks/audio/editor-rtl.css 150 B
build/block-library/blocks/audio/editor.css 150 B
build/block-library/blocks/audio/style-rtl.css 122 B
build/block-library/blocks/audio/style.css 122 B
build/block-library/blocks/audio/theme-rtl.css 133 B
build/block-library/blocks/audio/theme.css 133 B
build/block-library/blocks/avatar/editor-rtl.css 116 B
build/block-library/blocks/avatar/editor.css 116 B
build/block-library/blocks/avatar/style-rtl.css 104 B
build/block-library/blocks/avatar/style.css 104 B
build/block-library/blocks/block/editor-rtl.css 305 B
build/block-library/blocks/block/editor.css 305 B
build/block-library/blocks/button/editor-rtl.css 415 B
build/block-library/blocks/button/editor.css 414 B
build/block-library/blocks/button/style-rtl.css 627 B
build/block-library/blocks/button/style.css 626 B
build/block-library/blocks/buttons/editor-rtl.css 337 B
build/block-library/blocks/buttons/editor.css 337 B
build/block-library/blocks/buttons/style-rtl.css 332 B
build/block-library/blocks/buttons/style.css 332 B
build/block-library/blocks/calendar/style-rtl.css 239 B
build/block-library/blocks/calendar/style.css 239 B
build/block-library/blocks/categories/editor-rtl.css 113 B
build/block-library/blocks/categories/editor.css 112 B
build/block-library/blocks/categories/style-rtl.css 124 B
build/block-library/blocks/categories/style.css 124 B
build/block-library/blocks/code/editor-rtl.css 53 B
build/block-library/blocks/code/editor.css 53 B
build/block-library/blocks/code/style-rtl.css 121 B
build/block-library/blocks/code/style.css 121 B
build/block-library/blocks/code/theme-rtl.css 124 B
build/block-library/blocks/code/theme.css 124 B
build/block-library/blocks/columns/editor-rtl.css 108 B
build/block-library/blocks/columns/editor.css 108 B
build/block-library/blocks/columns/style-rtl.css 421 B
build/block-library/blocks/columns/style.css 421 B
build/block-library/blocks/comment-author-avatar/editor-rtl.css 125 B
build/block-library/blocks/comment-author-avatar/editor.css 125 B
build/block-library/blocks/comment-content/style-rtl.css 92 B
build/block-library/blocks/comment-content/style.css 92 B
build/block-library/blocks/comment-template/style-rtl.css 199 B
build/block-library/blocks/comment-template/style.css 198 B
build/block-library/blocks/comments-pagination-numbers/editor-rtl.css 123 B
build/block-library/blocks/comments-pagination-numbers/editor.css 121 B
build/block-library/blocks/comments-pagination/editor-rtl.css 222 B
build/block-library/blocks/comments-pagination/editor.css 209 B
build/block-library/blocks/comments-pagination/style-rtl.css 235 B
build/block-library/blocks/comments-pagination/style.css 231 B
build/block-library/blocks/comments-title/editor-rtl.css 75 B
build/block-library/blocks/comments-title/editor.css 75 B
build/block-library/blocks/comments/editor-rtl.css 840 B
build/block-library/blocks/comments/editor.css 839 B
build/block-library/blocks/comments/style-rtl.css 637 B
build/block-library/blocks/comments/style.css 636 B
build/block-library/blocks/cover/editor-rtl.css 671 B
build/block-library/blocks/cover/editor.css 674 B
build/block-library/blocks/cover/style-rtl.css 1.7 kB
build/block-library/blocks/cover/style.css 1.69 kB
build/block-library/blocks/details/editor-rtl.css 65 B
build/block-library/blocks/details/editor.css 65 B
build/block-library/blocks/details/style-rtl.css 86 B
build/block-library/blocks/details/style.css 86 B
build/block-library/blocks/embed/editor-rtl.css 312 B
build/block-library/blocks/embed/editor.css 312 B
build/block-library/blocks/embed/style-rtl.css 410 B
build/block-library/blocks/embed/style.css 410 B
build/block-library/blocks/embed/theme-rtl.css 133 B
build/block-library/blocks/embed/theme.css 133 B
build/block-library/blocks/file/editor-rtl.css 326 B
build/block-library/blocks/file/editor.css 327 B
build/block-library/blocks/file/style-rtl.css 280 B
build/block-library/blocks/file/style.css 281 B
build/block-library/blocks/file/view.min.js 324 B
build/block-library/blocks/footnotes/style-rtl.css 201 B
build/block-library/blocks/footnotes/style.css 199 B
build/block-library/blocks/form-input/editor-rtl.css 227 B
build/block-library/blocks/form-input/editor.css 227 B
build/block-library/blocks/form-input/style-rtl.css 343 B
build/block-library/blocks/form-input/style.css 343 B
build/block-library/blocks/form-submission-notification/editor-rtl.css 340 B
build/block-library/blocks/form-submission-notification/editor.css 340 B
build/block-library/blocks/form-submit-button/style-rtl.css 69 B
build/block-library/blocks/form-submit-button/style.css 69 B
build/block-library/blocks/form/view.min.js 471 B
build/block-library/blocks/freeform/editor-rtl.css 2.61 kB
build/block-library/blocks/freeform/editor.css 2.61 kB
build/block-library/blocks/gallery/editor-rtl.css 956 B
build/block-library/blocks/gallery/editor.css 960 B
build/block-library/blocks/gallery/style-rtl.css 1.72 kB
build/block-library/blocks/gallery/style.css 1.72 kB
build/block-library/blocks/gallery/theme-rtl.css 108 B
build/block-library/blocks/gallery/theme.css 108 B
build/block-library/blocks/group/editor-rtl.css 394 B
build/block-library/blocks/group/editor.css 394 B
build/block-library/blocks/group/style-rtl.css 103 B
build/block-library/blocks/group/style.css 103 B
build/block-library/blocks/group/theme-rtl.css 78 B
build/block-library/blocks/group/theme.css 78 B
build/block-library/blocks/heading/style-rtl.css 189 B
build/block-library/blocks/heading/style.css 189 B
build/block-library/blocks/html/editor-rtl.css 336 B
build/block-library/blocks/html/editor.css 337 B
build/block-library/blocks/image/editor-rtl.css 878 B
build/block-library/blocks/image/editor.css 878 B
build/block-library/blocks/image/style-rtl.css 1.6 kB
build/block-library/blocks/image/style.css 1.59 kB
build/block-library/blocks/image/theme-rtl.css 133 B
build/block-library/blocks/image/theme.css 133 B
build/block-library/blocks/image/view.min.js 1.54 kB
build/block-library/blocks/latest-comments/style-rtl.css 357 B
build/block-library/blocks/latest-comments/style.css 357 B
build/block-library/blocks/latest-posts/editor-rtl.css 213 B
build/block-library/blocks/latest-posts/editor.css 212 B
build/block-library/blocks/latest-posts/style-rtl.css 478 B
build/block-library/blocks/latest-posts/style.css 478 B
build/block-library/blocks/list/style-rtl.css 88 B
build/block-library/blocks/list/style.css 88 B
build/block-library/blocks/media-text/editor-rtl.css 306 B
build/block-library/blocks/media-text/editor.css 305 B
build/block-library/blocks/media-text/style-rtl.css 505 B
build/block-library/blocks/media-text/style.css 503 B
build/block-library/blocks/more/editor-rtl.css 431 B
build/block-library/blocks/more/editor.css 431 B
build/block-library/blocks/navigation-link/editor-rtl.css 668 B
build/block-library/blocks/navigation-link/editor.css 669 B
build/block-library/blocks/navigation-link/style-rtl.css 193 B
build/block-library/blocks/navigation-link/style.css 192 B
build/block-library/blocks/navigation-submenu/editor-rtl.css 296 B
build/block-library/blocks/navigation-submenu/editor.css 295 B
build/block-library/blocks/navigation/editor-rtl.css 2.26 kB
build/block-library/blocks/navigation/editor.css 2.26 kB
build/block-library/blocks/navigation/style-rtl.css 2.26 kB
build/block-library/blocks/navigation/style.css 2.25 kB
build/block-library/blocks/navigation/view.min.js 1.03 kB
build/block-library/blocks/nextpage/editor-rtl.css 395 B
build/block-library/blocks/nextpage/editor.css 395 B
build/block-library/blocks/page-list/editor-rtl.css 377 B
build/block-library/blocks/page-list/editor.css 377 B
build/block-library/blocks/page-list/style-rtl.css 175 B
build/block-library/blocks/page-list/style.css 175 B
build/block-library/blocks/paragraph/editor-rtl.css 235 B
build/block-library/blocks/paragraph/editor.css 235 B
build/block-library/blocks/paragraph/style-rtl.css 335 B
build/block-library/blocks/paragraph/style.css 335 B
build/block-library/blocks/post-author/style-rtl.css 175 B
build/block-library/blocks/post-author/style.css 176 B
build/block-library/blocks/post-comments-form/editor-rtl.css 96 B
build/block-library/blocks/post-comments-form/editor.css 96 B
build/block-library/blocks/post-comments-form/style-rtl.css 508 B
build/block-library/blocks/post-comments-form/style.css 508 B
build/block-library/blocks/post-content/editor-rtl.css 74 B
build/block-library/blocks/post-content/editor.css 74 B
build/block-library/blocks/post-date/style-rtl.css 61 B
build/block-library/blocks/post-date/style.css 61 B
build/block-library/blocks/post-excerpt/editor-rtl.css 71 B
build/block-library/blocks/post-excerpt/editor.css 71 B
build/block-library/blocks/post-excerpt/style-rtl.css 141 B
build/block-library/blocks/post-excerpt/style.css 141 B
build/block-library/blocks/post-featured-image/editor-rtl.css 734 B
build/block-library/blocks/post-featured-image/editor.css 732 B
build/block-library/blocks/post-featured-image/style-rtl.css 342 B
build/block-library/blocks/post-featured-image/style.css 342 B
build/block-library/blocks/post-navigation-link/style-rtl.css 215 B
build/block-library/blocks/post-navigation-link/style.css 214 B
build/block-library/blocks/post-template/editor-rtl.css 99 B
build/block-library/blocks/post-template/editor.css 98 B
build/block-library/blocks/post-template/style-rtl.css 409 B
build/block-library/blocks/post-template/style.css 408 B
build/block-library/blocks/post-terms/style-rtl.css 96 B
build/block-library/blocks/post-terms/style.css 96 B
build/block-library/blocks/post-time-to-read/style-rtl.css 69 B
build/block-library/blocks/post-time-to-read/style.css 69 B
build/block-library/blocks/post-title/style-rtl.css 100 B
build/block-library/blocks/post-title/style.css 100 B
build/block-library/blocks/preformatted/style-rtl.css 125 B
build/block-library/blocks/preformatted/style.css 125 B
build/block-library/blocks/pullquote/editor-rtl.css 135 B
build/block-library/blocks/pullquote/editor.css 135 B
build/block-library/blocks/pullquote/style-rtl.css 354 B
build/block-library/blocks/pullquote/style.css 353 B
build/block-library/blocks/pullquote/theme-rtl.css 174 B
build/block-library/blocks/pullquote/theme.css 174 B
build/block-library/blocks/query-pagination-numbers/editor-rtl.css 122 B
build/block-library/blocks/query-pagination-numbers/editor.css 121 B
build/block-library/blocks/query-pagination/editor-rtl.css 221 B
build/block-library/blocks/query-pagination/editor.css 211 B
build/block-library/blocks/query-pagination/style-rtl.css 288 B
build/block-library/blocks/query-pagination/style.css 284 B
build/block-library/blocks/query-title/style-rtl.css 63 B
build/block-library/blocks/query-title/style.css 63 B
build/block-library/blocks/query/editor-rtl.css 486 B
build/block-library/blocks/query/editor.css 486 B
build/block-library/blocks/query/view.min.js 958 B
build/block-library/blocks/quote/style-rtl.css 237 B
build/block-library/blocks/quote/style.css 237 B
build/block-library/blocks/quote/theme-rtl.css 233 B
build/block-library/blocks/quote/theme.css 235 B
build/block-library/blocks/read-more/style-rtl.css 140 B
build/block-library/blocks/read-more/style.css 140 B
build/block-library/blocks/rss/editor-rtl.css 149 B
build/block-library/blocks/rss/editor.css 149 B
build/block-library/blocks/rss/style-rtl.css 289 B
build/block-library/blocks/rss/style.css 288 B
build/block-library/blocks/search/editor-rtl.css 184 B
build/block-library/blocks/search/editor.css 184 B
build/block-library/blocks/search/style-rtl.css 690 B
build/block-library/blocks/search/style.css 689 B
build/block-library/blocks/search/theme-rtl.css 114 B
build/block-library/blocks/search/theme.css 114 B
build/block-library/blocks/search/view.min.js 478 B
build/block-library/blocks/separator/editor-rtl.css 146 B
build/block-library/blocks/separator/editor.css 146 B
build/block-library/blocks/separator/style-rtl.css 239 B
build/block-library/blocks/separator/style.css 239 B
build/block-library/blocks/separator/theme-rtl.css 194 B
build/block-library/blocks/separator/theme.css 194 B
build/block-library/blocks/shortcode/editor-rtl.css 323 B
build/block-library/blocks/shortcode/editor.css 323 B
build/block-library/blocks/site-logo/editor-rtl.css 805 B
build/block-library/blocks/site-logo/editor.css 805 B
build/block-library/blocks/site-logo/style-rtl.css 204 B
build/block-library/blocks/site-logo/style.css 204 B
build/block-library/blocks/site-tagline/editor-rtl.css 86 B
build/block-library/blocks/site-tagline/editor.css 86 B
build/block-library/blocks/site-title/editor-rtl.css 116 B
build/block-library/blocks/site-title/editor.css 116 B
build/block-library/blocks/site-title/style-rtl.css 57 B
build/block-library/blocks/site-title/style.css 57 B
build/block-library/blocks/social-link/editor-rtl.css 324 B
build/block-library/blocks/social-link/editor.css 324 B
build/block-library/blocks/social-links/editor-rtl.css 676 B
build/block-library/blocks/social-links/editor.css 675 B
build/block-library/blocks/social-links/style-rtl.css 1.48 kB
build/block-library/blocks/social-links/style.css 1.48 kB
build/block-library/blocks/spacer/editor-rtl.css 350 B
build/block-library/blocks/spacer/editor.css 350 B
build/block-library/blocks/spacer/style-rtl.css 48 B
build/block-library/blocks/spacer/style.css 48 B
build/block-library/blocks/table/editor-rtl.css 395 B
build/block-library/blocks/table/editor.css 395 B
build/block-library/blocks/table/style-rtl.css 639 B
build/block-library/blocks/table/style.css 639 B
build/block-library/blocks/table/theme-rtl.css 152 B
build/block-library/blocks/table/theme.css 152 B
build/block-library/blocks/tag-cloud/style-rtl.css 251 B
build/block-library/blocks/tag-cloud/style.css 253 B
build/block-library/blocks/template-part/editor-rtl.css 431 B
build/block-library/blocks/template-part/editor.css 431 B
build/block-library/blocks/template-part/theme-rtl.css 107 B
build/block-library/blocks/template-part/theme.css 107 B
build/block-library/blocks/term-description/style-rtl.css 111 B
build/block-library/blocks/term-description/style.css 111 B
build/block-library/blocks/text-columns/editor-rtl.css 95 B
build/block-library/blocks/text-columns/editor.css 95 B
build/block-library/blocks/text-columns/style-rtl.css 166 B
build/block-library/blocks/text-columns/style.css 166 B
build/block-library/blocks/verse/style-rtl.css 99 B
build/block-library/blocks/verse/style.css 99 B
build/block-library/blocks/video/editor-rtl.css 552 B
build/block-library/blocks/video/editor.css 555 B
build/block-library/blocks/video/style-rtl.css 185 B
build/block-library/blocks/video/style.css 185 B
build/block-library/blocks/video/theme-rtl.css 133 B
build/block-library/blocks/video/theme.css 133 B
build/block-library/classic-rtl.css 179 B
build/block-library/classic.css 179 B
build/block-library/common-rtl.css 1.11 kB
build/block-library/common.css 1.11 kB
build/block-library/editor-elements-rtl.css 75 B
build/block-library/editor-elements.css 75 B
build/block-library/editor-rtl.css 12.3 kB
build/block-library/editor.css 12.3 kB
build/block-library/elements-rtl.css 54 B
build/block-library/elements.css 54 B
build/block-library/index.min.js 218 kB
build/block-library/reset-rtl.css 472 B
build/block-library/reset.css 472 B
build/block-library/style-rtl.css 14.8 kB
build/block-library/style.css 14.8 kB
build/block-library/theme-rtl.css 707 B
build/block-library/theme.css 713 B
build/block-serialization-default-parser/index.min.js 1.12 kB
build/block-serialization-spec-parser/index.min.js 2.87 kB
build/blocks/index.min.js 51.7 kB
build/commands/index.min.js 15.2 kB
build/commands/style-rtl.css 953 B
build/commands/style.css 951 B
build/components/index.min.js 220 kB
build/components/style-rtl.css 11.9 kB
build/components/style.css 11.9 kB
build/compose/index.min.js 12.8 kB
build/core-commands/index.min.js 2.77 kB
build/core-data/index.min.js 72.5 kB
build/customize-widgets/index.min.js 11 kB
build/customize-widgets/style-rtl.css 1.36 kB
build/customize-widgets/style.css 1.36 kB
build/data-controls/index.min.js 640 B
build/data/index.min.js 9 kB
build/date/index.min.js 17.9 kB
build/deprecated/index.min.js 451 B
build/dom-ready/index.min.js 324 B
build/dom/index.min.js 4.65 kB
build/edit-post/classic-rtl.css 578 B
build/edit-post/classic.css 578 B
build/edit-post/index.min.js 16.2 kB
build/edit-post/style-rtl.css 3.79 kB
build/edit-post/style.css 3.79 kB
build/edit-site/index.min.js 223 kB
build/edit-site/style-rtl.css 13.6 kB
build/edit-site/style.css 13.6 kB
build/edit-widgets/index.min.js 17.6 kB
build/edit-widgets/style-rtl.css 4.17 kB
build/edit-widgets/style.css 4.17 kB
build/editor/index.min.js 81 kB
build/editor/style-rtl.css 7.56 kB
build/editor/style.css 7.55 kB
build/element/index.min.js 4.83 kB
build/escape-html/index.min.js 537 B
build/format-library/index.min.js 8.07 kB
build/format-library/style-rtl.css 493 B
build/format-library/style.css 492 B
build/hooks/index.min.js 1.55 kB
build/html-entities/index.min.js 448 B
build/i18n/index.min.js 3.58 kB
build/interactivity/debug.min.js 16.2 kB
build/interactivity/file.min.js 447 B
build/interactivity/image.min.js 1.67 kB
build/interactivity/index.min.js 13 kB
build/interactivity/navigation.min.js 1.17 kB
build/interactivity/query.min.js 740 B
build/interactivity/router.min.js 2.79 kB
build/interactivity/search.min.js 618 B
build/is-shallow-equal/index.min.js 527 B
build/keyboard-shortcuts/index.min.js 1.3 kB
build/keycodes/index.min.js 1.46 kB
build/list-reusable-blocks/index.min.js 2.11 kB
build/list-reusable-blocks/style-rtl.css 851 B
build/list-reusable-blocks/style.css 851 B
build/media-utils/index.min.js 2.92 kB
build/modules/importmap-polyfill.min.js 12.2 kB
build/notices/index.min.js 948 B
build/nux/index.min.js 1.57 kB
build/nux/style-rtl.css 748 B
build/nux/style.css 744 B
build/patterns/index.min.js 6.44 kB
build/patterns/style-rtl.css 595 B
build/patterns/style.css 595 B
build/plugins/index.min.js 1.8 kB
build/preferences-persistence/index.min.js 2.06 kB
build/preferences/index.min.js 2.85 kB
build/preferences/style-rtl.css 710 B
build/preferences/style.css 712 B
build/primitives/index.min.js 975 B
build/priority-queue/index.min.js 1.52 kB
build/private-apis/index.min.js 1 kB
build/react-i18n/index.min.js 623 B
build/react-refresh-entry/index.min.js 9.47 kB
build/react-refresh-runtime/index.min.js 6.78 kB
build/redux-routine/index.min.js 2.7 kB
build/reusable-blocks/index.min.js 2.7 kB
build/reusable-blocks/style-rtl.css 256 B
build/reusable-blocks/style.css 256 B
build/rich-text/index.min.js 10 kB
build/router/index.min.js 1.88 kB
build/server-side-render/index.min.js 1.96 kB
build/shortcode/index.min.js 1.39 kB
build/style-engine/index.min.js 2.03 kB
build/token-list/index.min.js 582 B
build/url/index.min.js 3.74 kB
build/vendors/inert-polyfill.min.js 2.48 kB
build/vendors/react-dom.min.js 41.7 kB
build/vendors/react.min.js 4.03 kB
build/viewport/index.min.js 957 B
build/warning/index.min.js 249 B
build/widgets/index.min.js 7.23 kB
build/widgets/style-rtl.css 1.17 kB
build/widgets/style.css 1.17 kB
build/wordcount/index.min.js 1.02 kB

compressed-size-action

Copy link
Contributor

@alexstine alexstine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ellatrix Thanks for trying this out. The initial results are promising.

The biggest problems I notice come from content that is rendered outside of the portal/iFrame. We could reduce a lot of verbosity if we were able to keep more inside the iFrame.

Is there any conceivable way to move the block toolbar inside the iFrame? It should really be attached to each block, the currently selected block, but I know discussions before indicated this is not really possible.

This is for sure an improvement as the screen reader only announces the application now vs. the iFrame, content body, and document of the block. We could make it even better if we could figure out how to keep the most used tools inside the iFrame that way screen reader does not announce every time you leave/enter again. The sidebar has to stay outside of the iFrame for obvious reasons but I wonder if the block toolbar could somehow join.

I would also like feedback from @afercia about how this behaves on Mac. It should be a better experience but I want to make sure of that.

Things are still crazy with the navigation block and I'm not sure why. The role="application" should force Windows screen readers into focus mode at all times unless the user changes it. However, after inserting the navigation block, focus gets placed on the block appender causing a mode change. I'm not sure if this is some bug I found in NVDA or maybe if this can be caused when focus is placed directly on a button, even inside of the application role. Either way, the PR does not fix this bug and we're going to need to explore this in another PR/issue. I was just silently hoping the insane navigation block might see some improvements from this.

Moving forward:

  1. Wait on @afercia review for Mac.
  2. See if there is any good way to move the block toolbar into the iFrame DOM. Maybe try to position it above the title field, as it is now? Might have to play around with the toolbar tabindex to ensure focus does not enter it when tabbing into the application.

Removing the title also made things a lot quieter. I prefer it this way and hopefully it can stay this way. I think we are okay since the application is the first item in the Editor content region.

@alexstine alexstine requested review from afercia and joedolson August 5, 2023 19:55
@ellatrix
Copy link
Member Author

ellatrix commented Aug 7, 2023

Rendering the block toolbar inside iframe defeats some of its purpose: a boundary between content and editor UI. We don't render the toolbar in the iframe for the same reason that we don't render the inspector in the iframe, it's not content but an interface for controlling the content that is also styled differently. The iframe should be seen as ideally identical to the front end.

Maybe the editor as a whole should be wrapped into role application?

@alexstine
Copy link
Contributor

@ellatrix

Maybe the editor as a whole should be wrapped into role application?

There has always been a lot of thought about this but also a lot of hesitation. When the whole editor is wrapped in this role, we'd have to manage every last keyboard event perfectly. I think at this point, Slack only wraps the message list and threads list but nowhere else. As I mentioned, adding it to the iFrame is certainly a good start but I just wanted to explore if it was possible to add the block toolbar because that would eliminate a bit more verbosity.

One thing worth noting, the toolbar is actually inside the application role for the classic editor. Any idea how that is being done?

Thanks.

@ellatrix
Copy link
Member Author

ellatrix commented Aug 8, 2023

One thing worth noting, the toolbar is actually inside the application role for the classic editor. Any idea how that is being done?

TinyMCE wraps its whole editor in role=application, which includes the toolbar and the TinyMCE iframe. That's why I suggested wrapping everything in it. Maybe an alternative is wrapping the iframe but additionally the toolbar as well?

@alexstine
Copy link
Contributor

@ellatrix If it's easy enough to try that, I think we should.

@afercia
Copy link
Contributor

afercia commented Sep 1, 2023

It is important to understand that role=application is risky, as it 'nullifies' any semantics perceived by screen readers, or at least by some of them. As such, many native screen readers features don't work any longer when inside a role=application. For example:

  • no landmarks listing and navigation, because no landmark is perceived
  • no forms elements listing navigation, because no forms elements are perceived
  • no links listing and navigation, because no links are perceived
  • etc.

Basically, most native screen readers navigational tools will not work any longer.

I think role=application is OK to use only in very limited cases, only as last resort, and only on small parts of the UI, when there is the need to force screen readers to switch to a sort of 'focus mode' rather than stayin in browse mode (note the terminology varies dependindg on the screen reader).

Such usage has been done for example for the List View, see #44291. In that case, role=application may help and it's limited to only this specific part of the UI. The List View is a complex widget and it's more usable when screen readers stop intercepting key strokes.

However, setting role=application on the entire Editor would have, in my opinion, a terrible impact as most native screen readers features would not work any longer. I'd strongly recommend against this proposal.

@alexstine
Copy link
Contributor

@afercia I tend to agree and that's why this started out as just wrapping the editor content area. I still think it would be wise to somehow place the block toolbar in the editor content region to reduce verbosity moving out/in of the iFrame. The big problem with the editor overall is most of the interactions you described with screen readers don't really work in Gutenberg to begin with, hints the idea that maybe we should be managing the entire experience. For example, switch to browse mode in NVDA after inserting some blocks and tell me if you can tell them apart. You can't because it is largely a bunch of divs with labels, no semantic elements.

I think efforts should continue here to move the block toolbar and we'll wait on trying role="application" globally.

Thanks.

@ellatrix
Copy link
Member Author

ellatrix commented Sep 1, 2023

Yes, this is only using it on the iframe, which mean it's only for editor content.

  • no landmarks listing and navigation, because no landmark is perceived
  • no forms elements listing navigation, because no forms elements are perceived
  • no links listing and navigation, because no links are perceived
  • etc.

Tbh, it makes sense to me that all these things don't work in the editor content. This is content to be edited, not elements that are part of the interface.

Regarding the toolbar, I still don't quite understand the benefit of role=application. Is that verbosity when switching useless? It seems important to know when it's switching from content to UI? I can try wrapping the toolbar separately. Would that work? Or does it have to be part of the same role=application parent element?

@ellatrix
Copy link
Member Author

ellatrix commented Sep 1, 2023

Is it worth adding role=application first to the iframe, then see if we expand it to toolbar? Or is it not so useful for just the iframe?

@alexstine
Copy link
Contributor

@ellatrix

Tbh, it makes sense to me that all these things don't work in the editor content. This is content to be edited, not elements that are part of the interface.

Not sure how familiar you are with Microsoft Word, but there is actually an option with screen readers to have the best of both worlds. Screen readers can either operate in edit mode where the whole document is a canvas or they can operate in browse/virtual mode where you can jump to lists, tables, links, etc. The problem with Gutenberg is it gives sighted people the idea of a wide open canvas but it isn't that for screen reader users. It is a bunch of blocks that all have different interaction models. For example, its not like Gutenberg is one huge text field that you can insert different elements into, it is a bunch of parts that make a final picture. A practical example might be inserting a table block. Visually, it probably looks like a table would on the front-end but it does not have actual table markup in the editor. This makes it fairly difficult for screen reader users to know at any given time what row or column they are editing in and it takes away the ability to use virtual navigation techniques to move around in the block. On the front-end, you can press "T" to find the first table and then move around the columns and rows with table navigation commands.

Regarding the toolbar, I still don't quite understand the benefit of role=application. Is that verbosity when switching useless? It seems important to know when it's switching from content to UI? I can try wrapping the toolbar separately. Would that work? Or does it have to be part of the same role=application parent element?

It becomes annoying in this situation because every time you enter the toolbar and then return to the iFrame, the screen reader announces the surrounding context of re-entering the iFrame. If I want to bold text in a paragraph block, I don't need to hear that I am entering the iFrame again as I never expected to leave it in the first place. I expect to hear I am in a formatting bar but it is reasonable to expect that if I am editing a block, I will return to said block. Its a balance between not enough information and too much information.

It would be great if the toolbar can appear in the DOM, just inside the iFrame so that extra verbosity goes away on return to editing content.

Thanks.

@alexstine
Copy link
Contributor

Here is a quick example that might help highlight my point. As you can see, this adds very clear structure to each block and because the table block in my example is coded like an actual table, users could use screen reader virtual mode to navigate to the different fields. Instead of just rendering divs with the contenteditable attribute. This is real and valid HTML.

<html>
	<head>
		<title>Test</title>
	</head>
	<body>
		<main>
			<h1>Gutenberg</h1>
			<h2>Post Title</h2>
			<textarea name="post_title" aria-label="Post Title"></textarea>
			<h2>Paragraph</h2>
			<textarea name="paragraph_block_1" aria-label="Paragraph Block">Some paragraph text</textarea>
			<h2>Table Block</h2>
			<table>
				<tr>
					<th><input type="text" name="table_block_1_row_1_header_1" value="Table Header 1" /></th>
					<th><input type="text" name="table_block_1_row_1_header_2" value="Table Header 2" /></th>
				</tr>
				<tr>
					<td><input type="text" name="table_block_1_row_2_cell_1" value="Table Cell 1" /></td>
					<td><input type="text" name="table_block_1_row_2_cell_2" value="Table Cell 2" /></td>
				</tr>
			</table>
		</main>
	</body>
</html>

@alexstine
Copy link
Contributor

The other problem we must solve for at some point is figuring out how to communicate block previews to screen readers. Currently, the only way to make ! isSelected is to not place focus on the block/deselect it. For obvious reasons, this doesn't work for keyboard-only users. It might be worth exploring some type of preview mode in a follow-up.

@alexstine
Copy link
Contributor

Things are still crazy with the navigation block and I'm not sure why. The role="application" should force Windows screen readers into focus mode at all times unless the user changes it. However, after inserting the navigation block, focus gets placed on the block appender causing a mode change. I'm not sure if this is some bug I found in NVDA or maybe if this can be caused when focus is placed directly on a button, even inside of the application role. Either way, the PR does not fix this bug and we're going to need to explore this in another PR/issue. I was just silently hoping the insane navigation block might see some improvements from this.

I tracked this down to the role="document" attached to every block. If I remove it, the issue above for Windows screen readers goes away combined with the application role.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/document_role

Only useful on focusable sections within complex composite widgets or applications, the document role inform assistive technologies to the reading context back to a reading mode: The document role tells assistive technologies with reading or browse modes to use the document mode to read the content contained within this element.

There is nothing to read within the navigation block so this role is actually an anti-pattern. I know @afercia has brought this up specifically before. I don't see much downside to removing it but certain blocks such as table get a little weird due to the announcing of the figure element the block is wrapped in. Part of me wants to remove this role and deal with the fallout vs. keeping this role and all the pain that comes with it. If you insert a paragraph block, it gets the role of textbox after removing the document role. Textbox role is for sure more valid than the generic document role defined as a required value in useBlockProps.

I think I'll play around a little with this over the weekend and see what the support looks like across Mac and Windows. I know there has to be a reason for the generic document role but I wonder if said reason is still valid these days.

Copy link
Contributor

@alexstine alexstine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple added thoughts now that I've had real time to test this.

@@ -183,7 +183,6 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
...props,
ref: mergedRefs,
id: `block-${ clientId }${ htmlSuffix }`,
role: 'document',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eliminating this may be actual trouble for a little while until we could work through all blocks and fix any accessibility issues. The problem is, keeping this is hurting us because trying to define a generic role for all the different blocks is not a reasonable solution. For example, this role makes no sense for the paragraph block because the paragraph block is an editable field and this role tells Windows screen readers to go into a mode which is not used for editing text, but navigating the virtual buffer of the page. Removing this also fixes the bug in the navigation block and other dynamic blocks where screen reader switches modes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we're always overriding the role to document which seems like a bug. Some blocks like paragraph define role=textbox (from rich text), but useBlockProps is overriding this. Maybe we should only set role=document if no role was defined by the block?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ellatrix I don't think that is possible at this point due to my comments around the navigation block. I think this should likely be managed block by block until we can find a suitable role that could work for any type of content. The document role causes Windows screen readers to switch modes and then the keyboard events no longer work in React so it would be good to avoid this pattern. I think it used the group role before this change and it needed to be modified for a bug in JAWS, another Windows screen reader.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're sure about removing role=document from all blocks, I'll update the e2e tests. There's lots of tests depending on this in their selectors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait on a good accessibility review from more people than just me before you commit to that. I will try to wrangle some testing here.

@@ -259,7 +260,7 @@ function Iframe( {
// mode. Also preload the styles to avoid a flash of unstyled
// content.
src={ src }
title={ __( 'Editor canvas' ) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out this is actually an accessibility violation. This isn't a rule I agree with considering the iFrame is wrapped in a role="region" with a valid aria-label.

@afercia You think this is something we can get away with given the situation?

Having a region labeled as Editor Content followed by the iFrame labeled as Editor Canvas is very verbose and not helpful. The other option, remove the aria-label from this region and the title should be good enough since it is the only element?

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/region_role

Regions seem to require accessible labels so really struggling here as to how labeling should:
A. Not be annoying.
B. Not be an accessibility violation from the lack of labeling.

@ellatrix
Copy link
Member Author

ellatrix commented Sep 7, 2023

The table in the editor is valid table markup? It's not divs. Here's the markup:

<table>
  <tbody>
    <tr>
      <td role="textbox" aria-multiline="true" aria-label="Body cell text" class="block-editor-rich-text__editable wp-block-table__cell-content rich-text" contenteditable="true"></td>
      <td role="textbox" aria-multiline="true" aria-label="Body cell text" class="block-editor-rich-text__editable wp-block-table__cell-content rich-text" contenteditable="true"></td>
    </tr>
    <tr>
      <td role="textbox" aria-multiline="true" aria-label="Body cell text" class="block-editor-rich-text__editable wp-block-table__cell-content rich-text" contenteditable="true"></td>
      <td role="textbox" aria-multiline="true" aria-label="Body cell text" class="block-editor-rich-text__editable wp-block-table__cell-content rich-text" contenteditable="true"></td>
    </tr>
  </tbody>
</table>

It becomes annoying in this situation because every time you enter the toolbar and then return to the iFrame, the screen reader announces the surrounding context of re-entering the iFrame.

And I guess removing the title attribute doesn't fix this. The next thing to try that I'm hoping works is adding role=application to just the block toolbar. But it is important to understand that you are leaving the block canvas? You don't want to think you're editing the block toolbar? Visually that is understood because it's styled like the admin and it floats around above the canvas, I'm not sure how that would make sense non visually.

The other problem we must solve for at some point is figuring out how to communicate block previews to screen readers. Currently, the only way to make ! isSelected is to not place focus on the block/deselect it.

I don't understand what you mean by communicating block previews. Could you elaborate?

@alexstine
Copy link
Contributor

@ellatrix Table might have been a bad example. I believe the table specifically doesn't work due to the fact it is wrapped in a <figure> tag. If that was removed, it might work. Probably need to open a tracking issue for block accessibility in general for the back-end.

Block previews. If you deselect the block with the mouse, some blocks can render different content based on the ! isSelected prop. There is currently no way to access this content because placing keyboard focus on the block will switch the prop to isSelected.

Yes, what you mention about the block toolbar does make sense. Also, removing the title attribute does eliminate some verbosity considering the iFrame is the only element within the role="region" aria-label="Editor Content" wrapper. Having the title attribute delivers duplicate information. When you hear announcements about entering Editor Content and then entering Editor Canvas, its essentially the same thing more or less?

CC @joedolson for further input. I could use some assistance thinking through the block toolbar and how to best present it to screen reader users.

We're making progress. Thanks.

@ellatrix
Copy link
Member Author

ellatrix commented Sep 8, 2023

Table might have been a bad example. I believe the table specifically doesn't work due to the fact it is wrapped in a <figure> tag. If that was removed, it might work. Probably need to open a tracking issue for block accessibility in general for the back-end.

But how come the table works fine on the front-end, where it is also wrapped in a figure?

@ellatrix ellatrix force-pushed the try/iframe-role-application branch from c624164 to 60f81cc Compare September 8, 2023 13:02
@ellatrix
Copy link
Member Author

ellatrix commented Sep 8, 2023

@alexstine I rebased this PR and added role=application to the block toolbar's popover. Can't add it to the toolbar directly, I think, because it already has role=toolbar? I have no idea what I'm doing... 🙂

@alexstine
Copy link
Contributor

@ellatrix I'll test this weekend, no worries.

Not sure why the table block loses its semantic meaning on the back-end and it works fine on the front-end. There are other blocks that have this problem though and its worth looking into why. Probably elsewhere. If you opened up the editor today, inserted a table block, and then used your quick navigation keys to find the table, it would not work.

Sorry for drifting though. I need to keep focus on the current issue so eventually I'll explore this elsewhere.

Thanks.

@joedolson
Copy link
Contributor

It'll probably need auditing globally; but removing role=document seems to be helpful in my testing, as well. Certainly with the paragraph block, it helps by removing some unhelpful verbosity. My first impression is that this is a plausible direction to go, just needs more detail.

Re: the table block. I assume that all of the aria roles are breaking the table semantics. A table cell with role=textbox is no longer a table cell. For editing purposes, the roles probably need to be on an inner container so that the table semantics aren't lost.

I did a quick test on CodePen, and a table where all the cells have role="textbox" behaves pretty strangely - it reports as having zero columns and zero rows, regardless of the content contained. Which is pretty much what I expected.

@alexstine
Copy link
Contributor

Thanks @joedolson. That gave me just enough to figure out the table issue. Opened another PR to take care of it. #54324

I will continue with testing this PR specifically over the weekend.

@alexstine
Copy link
Contributor

@ellatrix I think its okay to revert changes here.

packages/block-editor/src/components/block-tools/selected-block-popover.js

I think my end goal was to have the toolbar inside the role="application" and then the iFrame appearing just below that in the application region. This would have helped reduce verbosity but I think given how difficult it will be to introduce the block toolbar in a different DOM position, we can simply exclude it from this PR.

I think the changes to iFrame and useBlockProps is enough to deal with for the moment.

Thanks.

@afercia
Copy link
Contributor

afercia commented Sep 20, 2023

Thie Pulls request is trning into a very long discussion that is hard to read with my limited vision. Apoligiesin advance if I'm missing something important.

For example, switch to browse mode in NVDA after inserting some blocks and tell me if you can tell them apart. You can't because it is largely a bunch of divs with labels, no semantic elements.

I tracked this down to the role="document" attached to every block.

@alexstine Since the very beginning of this project we tried to make all the blocks based on RichTexr be perceived as textarea elements. It was our idea that was the most intuitive and exepected semantics and interaction. To do so, the RIchText, which is actually an editable field, usd to use role="textbox" and aria-multiline="true". Tha also made screen readers switch to focus mode, which is expected. I would like to remind you that you wanted to change role="textbox" to role="document" to solve some JAWS bug. Of course, role=document makes these editable divs have no semantics and makes screen readers stay in browse mode. I think that should be reverted to role="textbox". In my experience, trying to solve browsers or assistive technologies bugs by hacking around is often not ideal as it often introduces other problems.

Tbh, it makes sense to me that all these things don't work in the editor content. This is content to be edited, not elements that are part of the interface.

@ellatrix i deeply disagree with this point. Nullifying important native screen readers functionalities when inside the content is a no-go for me. This is not a Word process. It is still a web-based application. It does uses form elements, or the ARIA equivalents of them. Pretending to make it behave likw Microsoft Word may work visually, but it will never work semantically and for accessibility.

@alexstine
Regarding the region labelled Editor Content and the iframe labelled Editor Canvas. I do realize it is verbose. However, the root problem is not because od this labelling. The root problem is that the editor now users an iframe.

To me, the introduction of the iframe is maybe one of the most wrong decisions ever made in the editor. Users needs should prevaile on developers need. The iframe was only introduced to avoid CSS 'bleeding' between CSS used for the content and the CS used for the interface. While there is some value in that, the iframe is a subpar experience for assistive technology users and shouldn't have been introduced in the first place. Users needs above all.

Technically, the Editor Content region actually contains 3 things:

  • the notices area
  • the slot for the blocks toolbar, when not fixed at the top
  • the editor iframe

This isn't great. As you pointed out, each time users will move from the iframe to the block toolnbar or notice area and back, the will hear the iframe being announced. Sometimes the document title will be announced as well. Actually, the editor is now made of two separete documents. Asrhitecturally, not the best decision I would say. I would totally agree that at least the floating block toolnbar and the content should live in the same document. That would solve a part of the root issue.

Removing the title attribute from the iframe could alleviate the verbosity problem but it would be detected as a violation by any automated accessibility checker. Not opposed to experiment that if it actually helps users.

added role=application to the block toolbar's popover.

Not sure how that would ever help. The toolbat already has a role=toolbar, which triggers a sort of focus mode for screen readers thusa allowing the expected keyboard interaction. Glad it was removed.

Not sure why the table block loses its semantic meaning on the back-end and it works fine on the front-end.

As @joedolson pointed out, the unexpected roles on the table cells have likely a deep impact. Worth also reminding that some CSS properties actually nullity the table semantics.

@alexstine
Copy link
Contributor

@afercia

In my experience, trying to solve browsers or assistive technologies bugs by hacking around is often not ideal as it often introduces other problems.

Agreed. I fully own that this was my problem as I made the change. However, I am not sure the role it had before, role="group" was much better. No role might be the way to go here.

https://github.com/WordPress/gutenberg/pull/33627/files#diff-2840d9dde2ad8b676f1008acd75d77aca1349194be36689baace2c1f64afcef0L154

Docs: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/group_role

I can kind of see where blocks are groupings of sorts but blocks are not fieldsets.

Most closely related to HTML's

element, the group document structure role is used to identify a set of user interface objects which, as compared to region, is not intended to be included in the page's summary or table of contents.

I removed the group role in favor of document role and now I suggest no role. I am not sure when these blocks ever had the textbox role but it was before my change as the diff shows.

I fixed the table block in a follow-up PR: #54324.

I agree about the regions.

As far as the Microsoft Word editing experience, my comment here explains why Gutenberg is not TinyMCE.

#54324 (comment)

The entire canvas is content editable where Gutenberg is not.

Re, long PR, I know. Sorry about that. I have a lot of ideas on how to improve the experience without much background from when Gutenberg started. I should have thought better of using this PR as my creative canvas.

Thanks.

@ellatrix
Copy link
Member Author

ellatrix commented Oct 2, 2023

To me, the introduction of the iframe is maybe one of the most wrong decisions ever made in the editor. Users needs should prevaile on developers need. The iframe was only introduced to avoid CSS 'bleeding' between CSS used for the content and the CS used for the interface. While there is some value in that, the iframe is a subpar experience for assistive technology users and shouldn't have been introduced in the first place. Users needs above all.

@afercia It's not only for CSS bleeding, that's just a nice side effect. The main problem this solves and is the ability to preview relative CSS units correctly. Without this iframe these are broken. As you may remember, the classic editor was also iframed. We made the mistake to not take this over from the start.

@alexstine
Copy link
Contributor

  • Refreshed the PR for further testing.
  • Gave the iFrame maybe a better title for now. The floating block toolbar appears in the Editor content region so I was wrong about the iFrame being the only existing element. Better not remove title for now as much as that hurts.
  • Still testing the role="document" removal. It would be good to get input from a JAWS tester. Before, it used role="group" and that caused issues. It now uses role="document" and that also caused issues. Now each block can decide which role it uses with no default set. I am open to ideas for default roles excluding group or document. The RichText component uses role="textbox" by default and that seems to be producing much better results.
  • @afercia I finally tracked down the PR where a default role="group" was introduced.
    Accessibility: add role=group to block wrapper element #19213
    There is sadly no context here so hard to say what I could have broken when I tried to patch JAWS or what the impact could be to remove the role all together. Sigh.

@@ -183,7 +183,6 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
...props,
ref: mergedRefs,
id: `block-${ clientId }${ htmlSuffix }`,
role: 'document',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could try to change this back to group role but would need to land this first.

#47276

If not, JAWS compatibility may break.

@github-actions
Copy link

github-actions bot commented Oct 11, 2023

Flaky tests detected in 7d23eb3.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8919106948
📝 Reported issues:

@joedolson
Copy link
Contributor

If this needs JAWS testing, I can do a bit of that; I have a JAWS license, at any rate, though I'm far from proficient with it. Still, I could try and identify possible problems introduced by this change.

Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ellatrix <[email protected]>
Co-authored-by: alexstine <[email protected]>
Co-authored-by: afercia <[email protected]>
Co-authored-by: joedolson <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@alexstine
Copy link
Contributor

@joedolson Let me try to refresh this Friday or over the weekend and we can both do some more testing. At some point, we'll need to get into a state where the iFrame is an application and I remove the document role from blocks. That was my sin sadly trying to fix older JAWS versions so I think we'll set it back to group for non-content editable blocks. For content editable blocks, I say we let the rich text role take over which is textbox in most cases but can have additional attributes such as aria-multiline="true/false".

I also agree with @afercia, an issue is probably needed but at this point, there are an endless number of issues that exist from my bad choice, the person before me who made a bad choice, and then of course, the iFrame.

Might be best to close out this PR and draft a new one so I can organize my thoughts. I don't always do the best in writing, that's the dev in me I guess.

@ellatrix ellatrix requested review from fluiddot and dcalhoun as code owners May 2, 2024 06:19
Copy link

github-actions bot commented May 2, 2024

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: [Focus] Accessibility (a11y).

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@alexstine
Copy link
Contributor

@joedolson Okay, I think this is finally ready for some intense screen reader testing.

Summary:

  1. iFrame now has role="application".
  2. The useBlockProps hook now sets role="group" by default.
  3. It is now impossible for the RichText component to use role="group".
  4. The above change was necessary because RichText consumes useBlockProps hook so the prop will always be whatever we return from that hook by default. Not role="textbox". I decided to let that RichText role be customizeable as long as the value doesn't equal group but maybe textbox is solid enough to use everywhere. I want to be cautious making that wide of an assumption at this point.

Please let me know your thoughts. Early testing is looking good with NVDA. Interested to hear if JAWS behaves okay.

Thanks.

@dcalhoun dcalhoun removed their request for review August 28, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants