Closed Bug 822988 Opened 12 years ago Closed 5 years ago

Implement accessibility for SVG text element

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: surkov, Assigned: morgan)

References

(Blocks 1 open bug, )

Details

(Keywords: access)

Attachments

(1 file)

Jonathan said:

"Note that bug 655877 is radically changing the SVG text implementation. Best not to touch that code until that bug is fixed."
Depends on: 839955
The last parts of that SVG text implementation changes have landed now.
Blocks: 1471999

Morgan, do you want to take a crack at this? Our lack of support for this is causing fuzzing pain; see bug 1471999.

Example on this page:
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text

Beneath the diagram accessible, you'll see (e.g. with the Accessibility Inspector) text leaf accessibles. The expected result is that you should see text or text frame accessibles as the children of the diagram and the text leaf accessibles should be inside those; i.e. diagram -> text -> text leaf.

It should (hopefully?) just be a matter of checking for the SVG text element and creating a HyperTextAccessibleWrap for it here:
https://searchfox.org/mozilla-central/rev/5e830ac8f56fe191cb58a264e01cdbf6b6e847bd/accessible/base/nsAccessibilityService.cpp#1118
Then confirm that you no longer hit the assertion in the test case for bug 1471999. And add tree tests of course.

Assignee: nobody → mreschenberg

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

Morgan, do you want to take a crack at this? Our lack of support for this is causing fuzzing pain; see bug 1471999.

Example on this page:
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text

Beneath the diagram accessible, you'll see (e.g. with the Accessibility Inspector) text leaf accessibles. The expected result is that you should see text or text frame accessibles as the children of the diagram and the text leaf accessibles should be inside those; i.e. diagram -> text -> text leaf.

It should (hopefully?) just be a matter of checking for the SVG text element and creating a HyperTextAccessibleWrap for it here:
https://searchfox.org/mozilla-central/rev/5e830ac8f56fe191cb58a264e01cdbf6b6e847bd/accessible/base/nsAccessibilityService.cpp#1118
Then confirm that you no longer hit the assertion in the test case for bug 1471999. And add tree tests of course.

yeah sure! do we have tests that cover similar things, or would this be a new suite? any examples I can reference? not sure how we check for accessibles in JS.

Flags: needinfo?(jteh)

Looks like we currently only have role tests (not tree tests) for SVG:
accessible/tests/mochitest/role/test_svg.html
You could add a test for the text element there. That would confirm the fix, though I think I'd like to see a tree test as well confirming the diagram -> text -> text leaf tree structure. A simple tree test you can base this on is here:
accessible/tests/mochitest/tree/test_filectrl.html
I'd name it tree/test_svg.html; we can put other SVG tree tests there later.

Flags: needinfo?(jteh)

Looks like adding a HyperTextAccessibleWrap gives that intermediate text node role: text-container instead of just role: text. Is this expected behavior, or should I be creating a different kind accessible for the text object?

Flags: needinfo?(jteh)

TEXT_CONTAINER IS FINE. We use TEXT for inline content and TEXT_CONTAINER otherwise. I wasn't sure whether the frame would end up being inline or not (I'm not super familiar with SVG), hence the uncertainty around the role.

Flags: needinfo?(jteh)
Pushed by mreschenberg@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3025b00645fa
Create HyperTextAccessibleWrap for SVG text objects for correct role assignment. r=Jamie
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: