Bug 146452 - AX: VoiceOver does not correctly read square root with 2 children or more
Summary: AX: VoiceOver does not correctly read square root with 2 children or more
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 146578 230986
  Show dependency treegraph
 
Reported: 2015-06-30 03:39 PDT by Frédéric Wang (:fredw)
Modified: 2021-09-29 14:30 PDT (History)
4 users (show)

See Also:


Attachments
image (96.58 KB, image/png)
2020-04-15 23:59 PDT, chris fleizach
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 2015-06-30 03:39:55 PDT
Testcase:
data:text/html,<math><msqrt><mi>x</mi><mi>y</mi></msqrt></math>

Accessible tree exposed by Safari:
Role: AXGroup
Subrole: AXMathSquareRoot
MathRootRadicand: pointer to child "x"
accessibilityChildren: 3 items
  0 AXStaticText (radical symbol)
  1 AXMathIdentifier (x)
  2 AXMathIdentifier (y)

Accessible tree exposed by Firefox Nightly:
Role: AXGroup
Subrole: AXMathSquareRoot
MathRootRadicand: pointer to child "x"
accessibilityChildren: 2 items
  0 AXMathIdentifier (x)
  1 AXMathIdentifier (y)

Actual Result:
In both cases, VoiceOver reads "square root of x".

Expect Result:
VoiceOver should read "square root of xy".

It seems that VoiceOver uses the MathRootRadicand attribute in order to get the accessible child of AXMathSquareRoot to read but ignores the other siblings. Instead, it should use this attribute to determine the first child to read and then read the next siblings. Alternatively, WebKit could do as Firefox and only expose the relevant children (i.e. not the AXStaticText with the radical symbol). Then the MathRootRadicand attribute will no longer be necessary for AXMathSquareRoot and VoiceOver could just read the children of AXMathSquareRoot.

Note 1: <msqrt> can have any number of children while <mroot> always has two children (base, index). So while using MathRootRadicand / MathRootIndex attributes works well for AXMathRoot, this does not for AXMathSquareRoot.

Note 2: The equivalent markup with an explicit <mrow> is correclty read: <math><msqrt><mrow><mi>x</mi><mi>y</mi></mrow></msqrt></math>.
Comment 1 Radar WebKit Bug Importer 2015-06-30 03:40:15 PDT
<rdar://problem/21608794>
Comment 2 Frédéric Wang (:fredw) 2015-07-01 00:54:45 PDT
This bug appears in test 13 of the MathML torture test:

https://mdn.mozillademos.org/en-US/docs/Mozilla/MathML_Project/MathML_Torture_Test$samples/MathML_Torture_Test
Comment 3 chris fleizach 2020-04-15 23:59:48 PDT
Created attachment 396626 [details]
image
Comment 4 chris fleizach 2020-04-16 00:00:18 PDT
(In reply to chris fleizach from comment #3)
> Created attachment 396626 [details]
> image

VoiceOver appears to say the correct thing 10.15. see attached picture
Comment 5 Frédéric Wang (:fredw) 2020-04-16 01:17:37 PDT
(In reply to chris fleizach from comment #4)
> (In reply to chris fleizach from comment #3)
> > Created attachment 396626 [details]
> > image
> 
> VoiceOver appears to say the correct thing 10.15. see attached picture

Thanks Chris! Out of curiosity, do you know whether it was fixed by a change in the accessibility of WebKit or in how VoiceOver handles it?
Comment 6 Frédéric Wang (:fredw) 2020-04-16 01:20:04 PDT
(In reply to Frédéric Wang (:fredw) from comment #0)
> accessibilityChildren: 3 items
>   0 AXStaticText (radical symbol)
>   1 AXMathIdentifier (x)
>   2 AXMathIdentifier (y)

The StaticText has probably been removed after https://bugs.webkit.org/show_bug.cgi?id=153987 so it should be consistent with Firefox now.
Comment 7 chris fleizach 2020-04-16 09:23:07 PDT
(In reply to Frédéric Wang (:fredw) from comment #5)
> (In reply to chris fleizach from comment #4)
> > (In reply to chris fleizach from comment #3)
> > > Created attachment 396626 [details]
> > > image
> > 
> > VoiceOver appears to say the correct thing 10.15. see attached picture
> 
> Thanks Chris! Out of curiosity, do you know whether it was fixed by a change
> in the accessibility of WebKit or in how VoiceOver handles it?

It was a fix in VoiceOver side that handled this kind of equation