Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ATK and AX API mapping for <mphantom> #20

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

fred-wang
Copy link
Contributor

@fred-wang fred-wang commented Nov 3, 2021

See discussion in [1]. Per MathML Core [2], <mphantom> has style
visibility: hidden by default and so is not exposed to ATs [3].
This commit specifies how to map <mphantom> when the element is
exposed (e.g. by reverting visibility: hidden), essentially
following what exists for the <mrow> element.

[1] https://github.com/w3c/mathml-aam/issues/9
[2] https://w3c.github.io/mathml-core/#making-sub-expressions-invisible-mphantom
[3] https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion

Preview | Diff

@fred-wang
Copy link
Contributor Author

cc @asurkov

Note that I'm keeping MathML 3 links for now, although we probably want to move to MathML Core at some point. This is separate from this issue.

@@ -359,6 +359,19 @@ <h3>MathML Element Mappings</h3>
<span class="subrole">AXSubrole: <code>TBD</code></span>
</td>
</tr>
<tr id="el-phantom">
<th><a data-cite="MathML3/chapter3.html#presm.mphantom">`mphantom`</a></th>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing the context, but where it says the default styling must be overridden in order to be exposed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it something that is defined in "another spec"? I mean isn't that the case that alll "visibility: hidden" node are not exposed by default?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, in these AAMs, if the role is only mapped in some scenarios, we do list the scenario in the description. For example: https://w3c.github.io/html-aam/#el-aside-ancestorbodymain

Would be nice to see this land because I want to make an editorial change that will cause a conflict with this branch!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so the general rule to exclude elements (including the one with visibility: hidden) from the Accessibility tree is here: https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion

mphatom's default "visibility: hidden" style is here: https://w3c.github.io/mathml-core/#making-sub-expressions-invisible-mphantom

This means that by default the mphantom element is not included in the accessibility tree. This PR just says to use the same roles as the <mrow> element in case the element is included (e.g. when "visibility: hidden" is reverted).

I don't think we need to specify precisely here when the element is included as that's explained in other specs. Otherwise, I guess we would need to be explicit that e.g. MathML elements are excluded if visibility: hidden, etc which would be redundant.

However, we can probably add a note that by default mpantom has visibility: hidden and so is not included in the tree. How do you suggest to do that? HTML AAM has a "comments" row which would work, but the layout is a bit different in MathML AAM. I'm also not sure I understand what you mean with the <aside> example?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see your point. By the <aside> example, I meant we often put in the first row, the element row, something like <code>aside</code> under these conditions so I imagined at first saying something like <code>mpantom</code> when exposed -- but on second thought, and looking at the mathml table, that doesn't seem to make sense. I think this PR is fine as is.

See discussion in [1]. Per MathML Core [2], `<mphantom>` has style
`visibility: hidden` by default and so is not exposed to ATs [3].
This commit specifies how to map `<mphantom>` when the element is
exposed (e.g. by reverting `visibility: hidden`), essentially
following what exists for the `<mrow>` element.

[1] w3c#9
[2] https://w3c.github.io/mathml-core/#making-sub-expressions-invisible-mphantom
[3] https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion
@fred-wang
Copy link
Contributor Author

@spectranaut Thanks! FWIW, I don't have write access to merge this.

@spectranaut spectranaut merged commit 1f2edb2 into w3c:main Aug 29, 2023
@fred-wang fred-wang deleted the mphantom branch August 30, 2023 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants