LibWeb: Compute default ARIA roles for SVG elements

This change adds support for computing default ARIA roles for (selected)
SVG elements, per the requirements in the SVG Accessibility API Mappings
spec at https://w3c.github.io/svg-aam/#mapping_role_table.

This only computes roles for the elements which are covered in the WPT
test at https://wpt.fyi/results/svg-aam/role/roles.html — that is, the
“a”, “g”, and “image” elements.
This commit is contained in:
sideshowbarker 2024-12-24 17:16:10 +09:00 committed by Tim Ledbetter
commit f2ac591614
Notes: github-actions[bot] 2024-12-25 10:59:46 +00:00
4 changed files with 153 additions and 0 deletions

View file

@ -25,6 +25,9 @@ public:
GC::Ref<SVGAnimatedString> class_name();
GC::Ptr<SVGSVGElement> owner_svg_element();
bool should_include_in_accessibility_tree() const;
virtual Optional<ARIA::Role> default_role() const override;
protected:
SVGElement(DOM::Document&, DOM::QualifiedName);