Problem/Motivation
The WYSIWYG editor has a useful ARIA "application" landmark role, but the label supplied for it includes an unfriendly machine name deriving from the Field API machine name. This is potentially confusing for users who rely on (or otherwise make use of) the ARIA landmarks.
The following code sample appears inside the text editor for the Body field on the default article content type at node/add/article, nested inside div.edit-body-wrapper. The human-readable label is provided by use of an 'aria-labelledby' attribute. The label reads "Rich Text Editor, edit-body-0-value".
<div lang="en" aria-labelledby="cke_edit-body-0-value_arialbl" role="application" dir="ltr" class="cke_1 cke cke_reset cke_chrome cke_editor_edit-body-0-value cke_ltr cke_browser_gecko" id="cke_edit-body-0-value">
<span class="cke_voice_label" id="cke_edit-body-0-value_arialbl">Rich Text Editor, edit-body-0-value</span>
Proposed resolution
Change this label to use the human-readable field name, e.g. "Rich Text Editor, Body field."
We'll need to investigate how this label can be assigned programmatically by Drupal.
Comment | File | Size | Author |
---|---|---|---|
#24 | 2292035-24-aria-label-voice-over-fixed.patch | 856 bytes | mgifford |
#22 | 2292035-22-aria-label-voice-over-fixed.patch | 855 bytes | DimitriV |
#20 | 2292035-20-aria-label-voice-over-fixed.patch | 858 bytes | DimitriV |
#18 | 2292035-18-aria-label-voice-over-fixed.patch | 845 bytes | DimitriV |
#16 | 2292035-16-aria-label-voice-over-fixed.patch | 676 bytes | DimitriV |
Comments
Comment #1
andrewmacpherson CreditAttribution: andrewmacpherson commentedScreenshot to illustrate the Application landmark on a node edit screen.
I'm coming at this as a sighted keyboard user, using the Landmarks Firefox add-on to navigate regions. The screenshot shows the GUI interface provided by this Firefox add-on. Various screen-readers provide comparable means of navigating by landmark.
The landmark for the Body field wysiwyg is identified as "application: Rich Text Editor, edit-body-0-value".
Comment #2
andrewmacpherson CreditAttribution: andrewmacpherson commentedComment #3
mgiffordThis is a tricky one, but I can't see where else it would be. I haven't tried this in a new install, but..
Comment #4
mgiffordNope.. that doesn't fix it..
Comment #5
davidhernandezSo this is grabbing the form element's ID, which isn't going to be changed, right? Combined with the fact that it is coming from a vendor asset, is there really anything that can be done? Wouldn't this have to be a fix requested in the CKEditor project?
Comment #6
mgiffordI just checked it out in the CKEditor demo and it's the same issue there.
http://ckeditor.com/demo
Before marking an accessibility bug here http://dev.ckeditor.com/query?status=!closed&component=Accessibility
What do we want CKEditor to do?
There may be multiple machine names.
Rather than saying:
<span id="cke_editor1_arialbl" class="cke_voice_label">Rich Text Editor, editor1</span>
Would it be better to:
What else?
Comment #7
davidhernandezFrom a user standpoint, using "Rich Text Editor" I think is better than "CKEditor" which a user won't understand.
Pulling it from the label would probably be ideal, as it is already there.
If there is more than one, it already increments, though in reverse order? 3, 2, 1 ...
Comment #8
Wim LeersThe root cause for this is that CKEditor generates
Rich Text Editor, <editor's name attribute>
as the label. And the editor's name is http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-name, which in turns is retrieved/generated as follows:I'm talking to the CKEditor developers to figure out the correct way to solve this.
Comment #9
Wim LeersMost likely, we've found a bug in CKEditor. The ARIA label should use the editor's "title", which is configurable, but it turns out it's using the editor's "name", which we cannot configure. I filed a CKEditor ticket: https://dev.ckeditor.com/ticket/12204, where you can find more details.
(Changing the
name
attribute in Drupal is not an option, because the label may contain characters that are invalid for thename
attribute.)Marking as postponed because this is blocked on an upstream issue.
Comment #10
Reinmar CreditAttribution: Reinmar commentedThe bug in CKEditor has been fixed. It will be included in next week's CKEditor 4.4.4.
Comment #11
Wim LeersLovely! I'll roll a patch here once 4.4.4 is released, but I'll first need to update Drupal 8's CKEditor to 4.4.4 then :)
Comment #12
mgifford@Wim Leers - is there an existing issue for that? Would be great to ensure that D8 gets released with 4.4.4.
Comment #13
Wim Leers#12: yes, #2271051: Update CKEditor library to 4.4.4. :)
Comment #14
Wim Leers#2271051: Update CKEditor library to 4.4.4 landed, so now this is unblocked! :)
Comment #15
DimitriV CreditAttribution: DimitriV commentedChanged the title of the editor to next format: Rich Text Editor, {label of attached field} field
Comment #16
DimitriV CreditAttribution: DimitriV commentedForgot patch#15, attached the new version!
Comment #17
Wim LeersLooks great!
But let's add a comment to explain that this is the label used by screenreaders.
Perhaps something like
?
Comment #18
DimitriV CreditAttribution: DimitriV commentedAdded the comment to the patch.
Comment #19
Wim LeersJust one more nitpick round…
Please change to one leading space and wrap at 80 cols.
Comment #20
DimitriV CreditAttribution: DimitriV commentedChanged the comments layout
Comment #21
Wim LeersYou added this blank line, which sadly needs to be removed. Hopefully this is the last reroll!
Comment #22
DimitriV CreditAttribution: DimitriV commentedNo blank line anymore
Comment #24
mgiffordjust re-rolled #22.
Comment #25
Wim LeersComment #34
Wim LeersComment #35
alexpottCommitted 1e727b3 and pushed to 8.0.x. Thanks!