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

Mapping of svg/math tags in non-SVG/non-MathML namespaces #344

Closed
fred-wang opened this issue Sep 18, 2021 · 3 comments · Fixed by #354
Closed

Mapping of svg/math tags in non-SVG/non-MathML namespaces #344

fred-wang opened this issue Sep 18, 2021 · 3 comments · Fixed by #354

Comments

@fred-wang
Copy link

cc @asurkov

The HTML-aam spec defines "how user agents map HTML elements" which I interpret it as elements in the HTML namespace ( see https://html.spec.whatwg.org/multipage/infrastructure.html#html-elements ). However, it also describes mapping for the <svg> and <math> elements which are not HTML elements, even if they are described in HTML5 (note that they are respectively put in the SVG and MathML namespaces by the parser).

Mapping for <svg> is actually already defined in svg-aam and it was suggested that html-aam cross-references it in #43 (comment)

Mapping for <math> is not defined in mathml-aam but it looks like this is the place where it should be ( see w3c/mathml-aam#9 )

If you want to keep <svg> and <math> in the HTML-aam spec, I believe you should be explicit about namespaces to avoid confusion. For example, I noticed that Chromium seems to only check the local name to map tag math to role math, which means it currently performs the mapping for non-MathML <math> tag too: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/accessibility/ax_node_object.cc;l=1005;drc=4b13e65c914599d4be74a9f4db257fa1218b865b

pull bot pushed a commit to Alan-love/chromium that referenced this issue Sep 21, 2021
AXNodeObject::NativeRoleIgnoringAria() currently uses role "math" for
elements whose tag name is "math", even when they are not in the MathML
namespace e.g. elements constructed by JavaScript calls like
document.createElementNS("https://example.com/namespace", "math"). The
specification is not really explicit about namespaces [1] but it seems
that the intention is to handle the normal case (math tag in the
MathML namespace). This CL restricts default "math" role accordingly
and adds a test for this and similar cases with the svg tag name.

[1] w3c/html-aam#344

AX-Relnotes: <math> tags in non-MathML namespaces no longer have role
"math" by default. Users should use an explicit attribute instead.

Bug: 6606, 1038895, 1051115
Change-Id: Ifee04f4bbbd96b86686422bc0b0f99bf4cbaf54b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168497
Reviewed-by: Nektarios Paisios <[email protected]>
Commit-Queue: Frédéric Wang <[email protected]>
Cr-Commit-Position: refs/heads/main@{#923328}
@scottaohara
Copy link
Member

scottaohara commented Sep 21, 2021

SVG points to the graphics aam where the graphics-document role is defined (svg aam points to this doc as well with their mapping of svg).

A comment in the table saying to refer to also refer to svg-aam for more mappings related to svgs and their descendants can be added.

Similarly, the math element points to core aam where the math role is defined. A comment, similar to what's described above for svgs, can be made to point to mathml aam for additional mappings related to math elements / their descendants.

@asurkov, @joanmarie or @stevefaulkner do any of you see a need for additional updates? Would it be better to not reference the wai-aria role at all and just point to the necessary specifications for math (core aam, mathml) / svg (svg aam, graphics aam)?

@fred-wang
Copy link
Author

Just to be clear, my point is that this spec seems to be about mapping HTML elements, but <math> and <svg> are not such elements. So MathML/SVG namespaces should be explicit, or they should be moved to their respective aam specs.

@stevefaulkner
Copy link
Contributor

Would it be better to not reference the wai-aria role at all and just point to the necessary specifications for math (core aam, mathml) / svg (svg aam, graphics aam)?

yes

scottaohara added a commit that referenced this issue Nov 3, 2021
stevefaulkner pushed a commit that referenced this issue Nov 7, 2021
* revise mapping tables for svg and math

closes #344

* removing some unintended whitespace changes

* removing more unintended whitespace changes

* Update index.html
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this issue Oct 14, 2022
AXNodeObject::NativeRoleIgnoringAria() currently uses role "math" for
elements whose tag name is "math", even when they are not in the MathML
namespace e.g. elements constructed by JavaScript calls like
document.createElementNS("https://example.com/namespace", "math"). The
specification is not really explicit about namespaces [1] but it seems
that the intention is to handle the normal case (math tag in the
MathML namespace). This CL restricts default "math" role accordingly
and adds a test for this and similar cases with the svg tag name.

[1] w3c/html-aam#344

AX-Relnotes: <math> tags in non-MathML namespaces no longer have role
"math" by default. Users should use an explicit attribute instead.

Bug: 6606, 1038895, 1051115
Change-Id: Ifee04f4bbbd96b86686422bc0b0f99bf4cbaf54b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168497
Reviewed-by: Nektarios Paisios <[email protected]>
Commit-Queue: Frédéric Wang <[email protected]>
Cr-Commit-Position: refs/heads/main@{#923328}
NOKEYCHECK=True
GitOrigin-RevId: e929ccd6402c234b3456692a2a05d76edf72bb3a
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 a pull request may close this issue.

3 participants