Closed Bug 1175640 Opened 9 years ago Closed 2 years ago

Consider exposing sub and sup elements as accessible objects rather than text attributes

Categories

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

defect

Tracking

()

RESOLVED DUPLICATE of bug 1732280

People

(Reporter: jdiggs, Unassigned)

Details

Currently the sub and sup elements are not exposed as separate accessible objects; instead, the position is exposed as a text attribute associated with the parent element. (See bug 735645.)

That works. However, I'm wondering if it would make sense to expose sub and sup as accessible children of the parent element. The reason why is that in normal navigation (by line, by paragraph, etc.), the user is generally not interested in text attributes. So, at least in the case of Orca, text attributes are not asked for or examined unless the user specifically requests them. Orca does, however, piece together the content in that text (child links, child "clickables", child form fields, etc.) by looking at the accessible tree. Thus if sub/sup elements were exposed as accessible objects, Orca would present them as just another child. If they remain text attributes, presenting them will require Orca to check text attributes on the off chance there's a sub or sup element. Furthermore, due to limitations in ATK (and IA2??), that might mean multiple checks because one asks for the attributes at a given offset and gets a range back. If the end of the range is not the end of the text to be presented, subsequent call(s) are required.

Ccing James Teh for his thoughts.
While I do follow your reasoning here, I do think it makes sense that these are text attributes. Also, NVDA already depends on this behaviour. NVDA actually does consume text attributes in normal navigation, as the user can configure automatic reporting of requested formatting changes for both speech and braille.

So, for IA2, I'd prefer the text attributes weren't removed. That leaves two options:
1. Expose this differently for IA2 and ATK. I suspect Mozilla won't be willing to do this. :)
2. Do expose sup and sub as separate accessible objects, but keep the text attributes as well. That should keep both IA2 and ATK happy. Note that this will result in extra embedded objects (which we all know and love), which means a slight perf hit for IA2.
(In reply to James Teh [:Jamie] from comment #1)

> So, for IA2, I'd prefer the text attributes weren't removed.

I don't mind the text attributes being present; I simply don't want to have to use them to find sub and sup elements.

> That leaves two options:
> 1. Expose this differently for IA2 and ATK. I suspect Mozilla won't be
> willing to do this. :)

Agreed. :)

> 2. Do expose sup and sub as separate accessible objects, but keep the text
> attributes as well. That should keep both IA2 and ATK happy.

Agreed.

> Note that this will result in extra embedded objects (which we all know and love),
> which means a slight perf hit for IA2.

I assume that the hit will only happen when the sub or sup elements are used. If that is indeed the case, I would hope the hit would go unnoticed because sub and sup aren't used all that often (right?).
(In reply to Joanmarie Diggs from comment #2)
> I don't mind the text attributes being present; I simply don't want to have
> to use them to find sub and sup elements.
Out of interest, what will you use to detect this? Are there roles for sup and sub or will you use an attribute?

> > Note that this will result in extra embedded objects (which we all know and love),
> > which means a slight perf hit for IA2.
> I assume that the hit will only happen when the sub or sup elements are
> used. If that is indeed the case, I would hope the hit would go unnoticed
> because sub and sup aren't used all that often (right?).
Hopefully, you're right.
(In reply to James Teh [:Jamie] from comment #3)
> Out of interest, what will you use to detect this? Are there roles for sup
> and sub or will you use an attribute?

We have new roles for subscript and superscript.
 
> Hopefully, you're right.

Fair enough. Perhaps it could be done either as a try build or put into nightly so you could verify that. And if the change does have a noticeable impact, then we can discuss further how to proceed.
Ping?

Three years since the last ping. So... Ping? :)

Jamie and/or Marco: We need to figure something out so that we can implement this for ARIA (which just added superscript and subscript roles for role parity with HTML). How shall we deal with ATK expecting an accessible object and IA2 not expecting one?

BTW, there are cases where an accessible object would be needed (e.g. if the sub/sup/subscript/superscript element/role were focusable via tabindex). So we also need to figure out what IA2 role should be used to expose the element when a separate accessible object is needed.

Thanks in advance!

Flags: needinfo?(mzehe)
Flags: needinfo?(jteh)

I am strictly against creating accessibles for one platform and not the other. That introduces a form of complexity we definitely want to avoid, not least for consistency reasons. So if ATK needs this, it is very likely IA2 needs it, too, not least because of the ARIA role exposure. Keeping the text attributes on such elements is nothing I'd view as a problem. So... Give us a spec, and we'll implement, it's as simple as that. ;)

Flags: needinfo?(mzehe)

I agree; we should just expose the objects on both platforms, but keep the text attributes as they are.

(In reply to Joanmarie Diggs from comment #6)

BTW, there are cases where an accessible object would be needed (e.g. if the sub/sup/subscript/superscript element/role were focusable via tabindex). So we also need to figure out what IA2 role should be used to expose the element when a separate accessible object is needed.

I think IA2_ROLE_TEXT_FRAME will be fine for now. I don't see the need to introduce new IA2 role constants for these, but we can always introduce them later if needed.

Flags: needinfo?(jteh)

(In reply to James Teh [:Jamie] from comment #8)

I agree; we should just expose the objects on both platforms, but keep the text attributes as they are.

Thanks. Makes sense to me, though I have follow-up questions now that I'm doing a pull request to update HTML-AAM: Right now the text attributes are expected to be exposed on the parent container. When you say to "keep the text attributes as they are" do you mean on the parent container? Or do you mean the same attribute, but now exposed on the new object with IA2_ROLE_TEXT_FRAME? Or should the attribute be exposed on both, just to be safe?

Flags: needinfo?(jteh)

(In reply to Joanmarie Diggs from comment #9)

Right now the text attributes are expected to be exposed on the parent container. When you say to "keep the text attributes as they are" do you mean on the parent container? Or do you mean the same attribute, but now exposed on the new object with IA2_ROLE_TEXT_FRAME? Or should the attribute be exposed on both, just to be safe?

I think they need only be exposed on the object with IA2_ROLE_TEXT_FRAME, which is exactly what happens already when you do this:

data:text/html,<sup onclick=";">foo</sup>

Thanks for working on this.

Flags: needinfo?(jteh)
Priority: -- → P2
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.