Closed Bug 1837163 Opened 1 year ago Closed 11 months ago

Accessibility: font info is not announced with the Orca ScreenReader on Linux

Categories

(Core :: Disability Access APIs, defect, P1)

Firefox 114
defect

Tracking

()

VERIFIED FIXED
117 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox-esr115 --- verified
firefox115 --- wontfix
firefox116 --- verified
firefox117 --- verified

People

(Reporter: francescotissera1211, Assigned: Jamie)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: [ctw-23h2])

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0

Steps to reproduce:

  1. turn on the Orca ScreenReader on any Linux distribution.
  2. Open Firefox, go to any webpage and press Oca plus F to announce the font information, such as font tipe, font size, forground and background colors.
    Please note that the Orca key is usually mapped to the Insert key on the keyboard, although it can be changed to the caps lock key if needed.

Actual results:

Orca announces nothing

Expected results:

Orca should announce font information.
If a webpage, for example, has the font aset as Arial, a size of 13 PT and the forground and background colors are black and white orca should announce something like: "Font arial, 13 PT, forground color wite, background color black".
Info such as alignment and justification should be reported as well.

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

It looks like I cannot change the component. But this should almost certainly be in Disability Access APIs. The bug is that Orca is not speaking font and formatting information. Orca gets that information via AtkText. I (Orca maintainer) haven't yet debugged where the failure is, but I can reproduce the problem and am not seeing it Chrome. I'll try to provide more details soon.

It appears that the bug is that the name of the exposed text attributes changed in Gecko. While I should be able to handle this in Orca, a quick code search suggests this is a regression rather than an intentional change. ConvertTextAttributeToAtkAttribute does the very thing Orca expects. For some reason it's no longer being called, which I assume is an accident?

Apparently Orca+F is not used very often in Gecko apps.

Good: 91.0a1 06-10-2021
Bad: 91.0a1 06-11-2021

I suspect:
commit 62d0cdcad450d6d61d60671e35f2d1d3933f4d01
Author: Eitan Isaacson <eitan@monotonous.org>
Date: Thu Jun 10 23:07:05 2021 +0000
Bug 1714390 - P2: Use AccAttributes for accessible and text attributes. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D116783

 static AtkAttributeSet* ConvertToAtkTextAttributeSet(
-    nsIPersistentProperties* aAttributes) {
-  if (!aAttributes) return nullptr;
-
+    AccAttributes* aAttributes) {
   AtkAttributeSet* objAttributeSet = nullptr;
-  nsCOMPtr<nsISimpleEnumerator> propEnum;
-  nsresult rv = aAttributes->Enumerate(getter_AddRefs(propEnum));
-  NS_ENSURE_SUCCESS(rv, nullptr);
-
-  bool hasMore = false;
-  while (NS_SUCCEEDED(propEnum->HasMoreElements(&hasMore)) && hasMore) {
-    nsCOMPtr<nsISupports> sup;
-    rv = propEnum->GetNext(getter_AddRefs(sup));
-    NS_ENSURE_SUCCESS(rv, objAttributeSet);
 
-    nsCOMPtr<nsIPropertyElement> propElem(do_QueryInterface(sup));
-    NS_ENSURE_TRUE(propElem, objAttributeSet);
-
-    nsAutoCString name;
-    rv = propElem->GetKey(name);
-    NS_ENSURE_SUCCESS(rv, objAttributeSet);
+  for (auto iter : *aAttributes) {
+    nsAutoString name;
+    iter.NameAsString(name);
 
     nsAutoString value;
-    rv = propElem->GetValue(value);
-    NS_ENSURE_SUCCESS(rv, objAttributeSet);
+    iter.ValueAsString(value);
 
     AtkAttribute* objAttr = (AtkAttribute*)g_malloc(sizeof(AtkAttribute));
-    objAttr->name = g_strdup(name.get());
+    objAttr->name = g_strdup(NS_ConvertUTF16toUTF8(name).get());
     objAttr->value = g_strdup(NS_ConvertUTF16toUTF8(value).get());
     objAttributeSet = g_slist_prepend(objAttributeSet, objAttr);
-
-    ConvertTextAttributeToAtkAttribute(name, value, &objAttributeSet);
   }
 

Jamie: Assuming I'm correct, could the conversion to the Atk attribute name be restored? That way I don't have to have special handling in Orca just for Gecko. Thanks in advance!

Flags: needinfo?(jteh)

Yeah, I don't think this was intentional. Sorry. :( Thanks for tracking it down.

Severity: -- → S2
Status: UNCONFIRMED → NEW
Component: CSS Parsing and Computation → Disability Access APIs
Ever confirmed: true
Flags: needinfo?(jteh)
Keywords: regression
Regressed by: 1714390
Blocks: orca
Priority: -- → P1

Set release status flags based on info from the regressing bug 1714390

:eeejay, since you are the author of the regressor, bug 1714390, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(eitan)
Assignee: nobody → jteh
Flags: needinfo?(eitan)

Gecko uses different text attribute names to ATK.
Some of the values are also in a different format.
This detail was missed in the conversion from nsPersistentProperties to AccAttributes (bug 1714390), thus regressing text attributes for ATK.
Ther old conversion code added additional attributes, mangled strings, etc.
AccAttributes allows us to do better than this, so refactor the code accordingly.

What should I expect to hear about colours when I press Orca+f? I don't hear anything about colours, but I can't see anything wrong with my code.

Here's a try build. Joanie, are you able to tell me if I'm doing something wrong?

Flags: needinfo?(jdiggs)

For the old builds I get a lot of "Gah. Your tab just crashed." BUT I can get the font info from the message. And it includes "foreground color: back", "background color: white". But, sure, let me try your try build.... Stay tuned.

Flags: needinfo?(jdiggs)

Jamie: Seems to fix the bug.
Test: data:text/html,<div>foo</div>
Orca+F: size: 12, family name: Noto Serif, foreground color: black, background color: white'
Thanks!

Weird. I couldn't get it to announce the colour no matter what I did. I wonder if I have some setting disabled... or something. Anyway, glad it fixes it for you.

I can confirm getting font information, colors and all, works. even the text being bold was announced.

Whiteboard: [ctw-23h2]
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/590df3705e5e
Use correct ATK text attribute names. r=eeejay
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch

The patch landed in nightly and beta is affected.
:Jamie, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox116 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(jteh)

Francesco, would you be willing to verify that this works as expected in Firefox Nightly? If it does, I'll try to get this uplifted to beta and ESR. Thanks.

Flags: needinfo?(jteh) → needinfo?(francescotissera1211)

I can confirm that reporting of all font info works on the latest nightly build downloaded from https://www.mozilla.org/en-US/firefox/channel/desktop.

Flags: needinfo?(francescotissera1211)

Comment on attachment 9343052 [details]
Bug 1837163: Use correct ATK text attribute names.

Beta/Release Uplift Approval Request

  • User impact if declined: Linux Orca screen reader users will not be able to access any font information.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Only impacts exposure of formatting attributes for Linux accessibility, which was completely broken before this patch anyway.
  • String changes made/needed:
  • Is Android affected?: No
Attachment #9343052 - Flags: approval-mozilla-beta?

Comment on attachment 9343052 [details]
Bug 1837163: Use correct ATK text attribute names.

Approved for 116.0b6

Attachment #9343052 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Please nominate for ESR115 also when you get a chance :)

Flags: needinfo?(jteh)
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Comment on attachment 9343052 [details]
Bug 1837163: Use correct ATK text attribute names.

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Some broken screen reader functionality on Linux.
  • User impact if declined: Linux Orca screen reader users will not be able to access any font information.
  • Fix Landed on Version: 116, 117
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Only impacts exposure of formatting attributes for Linux accessibility, which was completely broken before this patch anyway.
Flags: needinfo?(jteh)
Attachment #9343052 - Flags: approval-mozilla-esr115?

Verified fixed on Ubuntu 20.04 using Nightly 117.0a1 (20230718215135) and Beta 116.0b7 (20230718185323).

Comment on attachment 9343052 [details]
Bug 1837163: Use correct ATK text attribute names.

Approved for 115.1esr

Attachment #9343052 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+

Verified fixed on 115.1.0esr (20230719225449) build from treeherder.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

Confirmed to work in FF 116 from Arch testing

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: