Bug 185246 - AX: VoiceOver on macOS does not announce fieldset description from aria-describedby when focussing inputs
Summary: AX: VoiceOver on macOS does not announce fieldset description from aria-descr...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Safari 11
Hardware: Mac macOS 10.13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-03 05:37 PDT by Oliver Byford
Modified: 2018-05-30 19:27 PDT (History)
11 users (show)

See Also:


Attachments
HTML test case (821 bytes, text/html)
2018-05-03 05:37 PDT, Oliver Byford
no flags Details
patch (4.73 KB, patch)
2018-05-30 16:39 PDT, Nan Wang
no flags Details | Formatted Diff | Diff
patch (4.74 KB, patch)
2018-05-30 17:39 PDT, Nan Wang
no flags Details | Formatted Diff | Diff
patch (4.74 KB, patch)
2018-05-30 18:00 PDT, Nan Wang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Byford 2018-05-03 05:37:40 PDT
Created attachment 339403 [details]
HTML test case

TEST CASE:

Given the following HTML within a valid HTML5 document:

  <form>
    <fieldset aria-describedby="hint error">
      <legend>
        <h1>Have you changed your name?</h1>
      </legend>

      <span id="hint">This includes changing your last name or spelling your name differently.</span>
      <span id="error">Choose yes or no</span>

      <input name="changed_name" id="yes" type="radio" value="yes" >
      <label for="yes">Yes</label>

      <input name="changed_name" id="no" type="radio" value="no">
      <label for="no">No</label>

    </fieldset>
  </form>

EXPECTED BEHAVIOUR:

When focussing the first radio input ("Yes") in the fieldset, Voiceover should include the text content of any element(s) associated with the containing fieldset (using aria-describedby):

"Yes, radio button, 1 of 2, Have you changed your name? This includes changing your last name or spelling your name differently. Choose yes or no.

You are currently on a radio button, 1 of 2, inside of a group. To select this option press Control-Option-Space"


This is the behaviour currently exhibited by iOS 10/11, and would be consistent with other assistive technologies (as tested with JAWS 18, NVDA).


ACTUAL BEHAVIOUR:

When focussing the first radio input in a fieldset, Voiceover announces:

"Yes, radio button, 1 of 2, Have you changed your name?

You are currently on a radio button, 1 of 2, inside of a group. To select this option press Control-Option-Space"


As tested in Safari 11 and Safari Technology Preview 11.2 on macOS 10.13.4.
Comment 1 Radar WebKit Bug Importer 2018-05-03 05:37:57 PDT
<rdar://problem/39939028>
Comment 2 Nan Wang 2018-05-30 16:39:44 PDT
Created attachment 341621 [details]
patch
Comment 3 chris fleizach 2018-05-30 17:07:38 PDT
Comment on attachment 341621 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=341621&action=review

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1444
> +    else {

should this be an else if (isControl()

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1445
> +        // For controls, use their fieldset parent's described-by text if avaialble.

available

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1448
> +                return object.isFieldset() && !object.ariaDescribedByAttribute().isEmpty();

does it matter if we check whether ariaDescribedByAttribute is empty here? if we try to try to append an empty string nothing will happen anyway right? and then we'll save a call to ariaDescribedByAttribute?
Comment 4 Nan Wang 2018-05-30 17:35:38 PDT
Comment on attachment 341621 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=341621&action=review

>> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1448
>> +                return object.isFieldset() && !object.ariaDescribedByAttribute().isEmpty();
> 
> does it matter if we check whether ariaDescribedByAttribute is empty here? if we try to try to append an empty string nothing will happen anyway right? and then we'll save a call to ariaDescribedByAttribute?

No I think we still need to check empty() in this case, since AccessibilityText doesn't check empty in construction and also baseAccessibilityHelpText doesn't check empty before return.
Comment 5 Nan Wang 2018-05-30 17:39:35 PDT
Created attachment 341627 [details]
patch

updated from review
Comment 6 EWS Watchlist 2018-05-30 17:42:19 PDT
Attachment 341627 [details] did not pass style-queue:


ERROR: Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1444:  Missing space before {  [whitespace/braces] [5]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Nan Wang 2018-05-30 18:00:45 PDT
Created attachment 341628 [details]
patch

update style
Comment 8 WebKit Commit Bot 2018-05-30 19:27:14 PDT
Comment on attachment 341628 [details]
patch

Clearing flags on attachment: 341628

Committed r232331: <https://trac.webkit.org/changeset/232331>
Comment 9 WebKit Commit Bot 2018-05-30 19:27:15 PDT
All reviewed patches have been landed.  Closing bug.