daisy / ace

Ace by DAISY, an Accessibility Checker for EPUB
MIT License
74 stars 22 forks source link

MathML not accepted as valid content for th element #398

Open francofaa opened 7 months ago

francofaa commented 7 months ago

Ace 1.3.2, Ace by DAISY app

The error was Minor, Best Practice, empty-table-header with the text

  • Element does not have text that is visible to screen readers
  • Ensures table headers have discernible text
  • Table header text should not be empty

The content of this th element was

<th class="center v3" id="deb_9781319237219_uWM1BaRCW9" scope="col">
                  <p class="noindent" id="deb_9781319237219_4hvuwm3VJ3">
                    <span class="math" id="deb_9781319237219_QZUQ3ajUm5" tabindex="0">
                      <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="not stretchy left parenthesis X minus X with bar on top squared not stretchy right parenthesis" display="inline" id="bjlj7be0eaf27e99f19deb2f3838f2e6">
                        <semantics id="wrtgb65162dd336dc37fcccdee15983d">
                          <mrow id="gprh71db5b0ebba32fbd25f6a3d8d62f">
                            <mo id="gjgy93713360b6de56108b54eb89822d" stretchy="false">( </mo>
                            <mi id="hftw38a20c69a26543d043b739860ea7">X </mi>
                            <mo id="wumz1399929d98c663afebd7ed5f1d57">− </mo>
                            <msup id="jyifd02fc89ba22ac645ac67a9792434">
                              <mover accent="true" id="wsrd9eedc72743b4b5bd5c721959d7ad">
                                <mi id="vegi8f1df61f3d584d89a7bb39a8abe9">X </mi>
                                <mo id="ofok7bb59cc9f93826bce0ab44a42611">¯ </mo>
                              </mover>
                              <mn id="wnee1803474ca3118cb7a23dd734f554">2 </mn>
                            </msup>
                            <mo id="yoajf0504a123669f6adab047b9cc42e" stretchy="false">) </mo>
                          </mrow>
                          <annotation-xml encoding="application/xhtml+xml" id="mzff1ff62b92c9da1fc10c952ec9558f">
                            <img xmlns="http://www.w3.org/1999/xhtml" alt="not stretchy left parenthesis X minus X with bar on top squared not stretchy right parenthesis" id="wnrnd7031fcfc78801a0d61d4e35e1c4" src="../images/bjlj7be0eaf27e99f19deb2f3838f2e6.png"></img>
                          </annotation-xml>
                        </semantics>
                      </math>
                    </span>
                  </p>
                </th>

It appears that the MathML is being read as no text or as inaccessible text. Is this error correct? Should MathML not be used in th?

Thank you for any assistance that can be provided.

clapierre commented 7 months ago

Any update on this issue? One would think you should be able to put mathML within a table cell. Is the issue that it is within a element?

amhci commented 6 months ago

Just chiming in that we've run into this too, and this is absolutely legit-- there is no accessibility reason that I know of that this shouldn't be allowed. MathML is widely supported now and does not require any text or image backups; it's as valid as plain text as a header for both visual and non-visual users.

danielweck commented 6 months ago

hello all, this message is generated by Deque Axe. I am in the process of updating Axe inside Ace, hopefully this will fix the misguided reporting. Regards, Daniel

francofaa commented 4 months ago

Hi just as an additional follow-up, it looks like this is happening with heading elements as well. I will provide an example and open a related issue.

danielweck commented 3 months ago

This is a known issue with Deque Axe, I have tried to implement missing parts in Axe's code but I am lacking some understanding of Axe's internals (plus, I started exploring this issue from a slightly older revision of the Axe codebase which was used by DAISY Ace at the time). Here is the relevant issue at the Axe GitHub repository: https://github.com/dequelabs/axe-core/issues/3285