Open Bug 1787976 Opened 26 days ago Updated 9 days ago

Text position attributes not properly exposed on elements wrapped in sub or sup tags

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

People

(Reporter: nlapre, Unassigned)

References

(Blocks 1 open bug)

Details

Steps to reproduce (Windows 11, tested in 104.0 and 106.0a1 with NVDA):

  1. Load data:text/html,<sub><div>testing</div></sub>
  2. Use NVDA key + f to report text formatting for the page contents

Expected results:

  • NVDA says "Times New Roman 10pt black on white subscript align default" (the important part for our purposes is the word "subscript" here).

Actual results:

  • NVDA says "Times New Roman 10pt black on white align default" (note no "subscript").

It works just fine if you use data:text/html,<sub>testing</sub>. For some reason, the subscript (or superscript) attribute does not propagate as expected. In the code, the mVerticalAlign value here will not be eTextPosSub as you might expect; it'll be eTextPosBaseline instead.

Exposing incorrect information is not great. On the other hand, I think this bug has existed for decades without anyone noticing, hence the s3.

Severity: -- → S3

I also discovered this while testing with NVDA and filed an issue with NVDA on 11 September, but it appears this is in Firefox. I am replicating it here (James linked the issue too) just so it is easier to get the test I made and the output I recorded.

  1. NVDA 2022.2 with Firefox 105 does not expose superscript text with CSS style vertical-align: text-top.
  2. NVDA 2022.2 with Firefox 105 does not expose subscript text with CSS style vertical-align: baseline.

Steps to reproduce:

  1. Enable sub/superscript announcement in NVDA (Preferences → Settings… → Document Formatting → Font: Superscript and subscripts).
  2. Open Firefox and browse to https://cdpn.io/pen/debug/xxjOrEX.
  3. Compare announcements of subscript and superscript text in each of the four sections.

Actual behavior:

  • Superscript text with CSS style vertical-align: text-top is not announced as superscript.
  • Subscript text with CSS style vertical-align: baseline is not announced as subscript.

Expected behavior:

Regardless of CSS vertical alignment styles, I expect any text in <sup> and <sub> to be announced as such.

Additional Info:

The browser default styling for <sub> is vertical-align: sub and for <sup> is vertical-align: super. With browser default styles the element is exposed.

System info:

  • Windows 11
  • NVDA 2022.2
  • Firefox 105

Test case:

Transcript of announcements:

This is a transcript from the NVDA speech viewer.

Superscript at Ascender Line (vertical-align: super)

  • 42 superscript nd baseline
  • superscript 2 baseline / subscript 3 baseline
  • superscript a baseline / subscript c baseline
  • this superscript A baseline
  • E=mc superscript 2 baseline
  • μ superscript + baseline
  • superscript 238 baseline U,
  • superscript c baseline / subscript o baseline
  • H subscript 2 baseline O,
  • H subscript 2 baseline SO subscript 4

Superscript above Ascender Line (vertical-align: text-top)

  • 42nd
  • 2/ subscript 3 baseline
  • a/ subscript c baseline
  • thisA
  • E=mc2
  • μ+
  • 238U
  • c/ subscript o baseline
  • H subscript 2 baseline O
  • H subscript 2 baseline SO subscript 4

Subscript at Baseline (vertical-align: baseline)

  • 42 superscript nd baseline
  • superscript 2 baseline /3
  • superscript a baseline /c
  • this superscript A baseline
  • E=mc superscript 2 baseline
  • μ superscript + baseline
  • superscript 238 baseline U
  • superscript c baseline /o
  • H2O
  • H2SO4

Subscript below Baseline (vertical-align: sub)

  • 42 superscript nd baseline
  • superscript 2 baseline / subscript 3 baseline
  • superscript a baseline / subscript c baseline
  • this superscript A baseline
  • E=mc superscript 2 baseline
  • μ superscript + baseline
  • superscript 238 baseline U
  • superscript c baseline / subscript o baseline
  • H subscript 2 baseline O
  • H subscript 2 baseline SO subscript 4
You need to log in before you can comment on or make changes to this bug.