RESOLVED FIXED 273152
AX: SVG g elements should only be AccessibilityRole::Group if they are focusable or have an accname
https://bugs.webkit.org/show_bug.cgi?id=273152
Summary AX: SVG g elements should only be AccessibilityRole::Group if they are focusa...
Tyler Wilcock
Reported 2024-04-23 15:15:55 PDT
...
Attachments
Patch (22.32 KB, patch)
2024-04-23 15:22 PDT, Tyler Wilcock
no flags
Patch (22.45 KB, patch)
2024-04-25 12:25 PDT, Tyler Wilcock
no flags
Radar WebKit Bug Importer
Comment 1 2024-04-23 15:16:07 PDT
Tyler Wilcock
Comment 2 2024-04-23 15:22:28 PDT
chris fleizach
Comment 3 2024-04-24 19:38:07 PDT
Comment on attachment 471092 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=471092&action=review > Source/WebCore/accessibility/AXObjectCache.cpp:602 > + const auto& value = element.attributeWithDefaultARIA(attribute); Can we use getAttributeTrimmed instead of making a new utility? > Source/WebCore/accessibility/AccessibilitySVGElement.cpp:202 > +bool AccessibilitySVGElement::hasTitleOrDescChild() const Can we avoid abbreviations in names?
Tyler Wilcock
Comment 4 2024-04-25 08:57:06 PDT
(In reply to chris fleizach from comment #3) > Comment on attachment 471092 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=471092&action=review > > > Source/WebCore/accessibility/AXObjectCache.cpp:602 > > + const auto& value = element.attributeWithDefaultARIA(attribute); > > Can we use getAttributeTrimmed instead of making a new utility? I thought about this too, but ultimately decided to just inline this lambda for a few reasons: 1. getAttributeTrimmed both trims and simplifies whitespace (because that's what its callers need) -- we only need to trim here 2. getAttributeTrimmed is a class method on AccessibilityObject, this is a free-standing method, so there's no object to call it on 3. getAttributeTrimmed does a virtual function call to get element(), which is unnecessary in some contexts (we already have an element) But I could probably switch some things around to make this work if you feel strongly about this one. > > Source/WebCore/accessibility/AccessibilitySVGElement.cpp:202 > > +bool AccessibilitySVGElement::hasTitleOrDescChild() const > > Can we avoid abbreviations in names? "desc" is the element name, so I thought it might be right to match it. What do you think? https://developer.mozilla.org/en-US/docs/Web/SVG/Element/desc
chris fleizach
Comment 5 2024-04-25 12:06:29 PDT
Comment on attachment 471092 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=471092&action=review >>> Source/WebCore/accessibility/AXObjectCache.cpp:602 >>> + const auto& value = element.attributeWithDefaultARIA(attribute); >> >> Can we use getAttributeTrimmed instead of making a new utility? > > I thought about this too, but ultimately decided to just inline this lambda for a few reasons: > 1. getAttributeTrimmed both trims and simplifies whitespace (because that's what its callers need) -- we only need to trim here > 2. getAttributeTrimmed is a class method on AccessibilityObject, this is a free-standing method, so there's no object to call it on > 3. getAttributeTrimmed does a virtual function call to get element(), which is unnecessary in some contexts (we already have an element) > > But I could probably switch some things around to make this work if you feel strongly about this one. I guess its ok, its just weird that we have to have so many ways to trim attributes >>> Source/WebCore/accessibility/AccessibilitySVGElement.cpp:202 >>> +bool AccessibilitySVGElement::hasTitleOrDescChild() const >> >> Can we avoid abbreviations in names? > > "desc" is the element name, so I thought it might be right to match it. What do you think? > > https://developer.mozilla.org/en-US/docs/Web/SVG/Element/desc I guess that's ok. can you add a comment to that effect what this does? If I'm just reading it I don't know if this means it has a title or a descendant child? or a title or a child named desc
Tyler Wilcock
Comment 6 2024-04-25 12:25:59 PDT
Tyler Wilcock
Comment 7 2024-04-25 12:28:42 PDT
> >>> Source/WebCore/accessibility/AccessibilitySVGElement.cpp:202 > >>> +bool AccessibilitySVGElement::hasTitleOrDescChild() const > >> > >> Can we avoid abbreviations in names? > > > > "desc" is the element name, so I thought it might be right to match it. What do you think? > > > > https://developer.mozilla.org/en-US/docs/Web/SVG/Element/desc > > I guess that's ok. can you add a comment to that effect what this does? If > I'm just reading it I don't know if this means it has a title or a > descendant child? or a title or a child named desc OK yeah, I see your point now. I've changed the name to hasTitleOrDescriptionChild() and added a comment so that it's clear.
EWS
Comment 8 2024-04-25 19:31:21 PDT
Committed 278024@main (9f05a02fc85a): <https://commits.webkit.org/278024@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 471134 [details].
Note You need to log in before you can comment on or make changes to this bug.