RESOLVED WONTFIX 32658
Make it easier for plug-ins to participate in the Accessibility hierarchy
https://bugs.webkit.org/show_bug.cgi?id=32658
Summary Make it easier for plug-ins to participate in the Accessibility hierarchy
Sven-S. Porst
Reported 2009-12-17 06:18:22 PST
A plug-in should participate in the accessibility hierarchy. To do that it needs to supply an AXParent element to -accessibilityAttributeValue:. Finding the correct element for that seems unnecessarily hard as the NSView subclassed by the plug-in seems to be contained in another element in the accessibility hierarchy which is not easily accessed: Accessibility Inspector shows: <AXApplication: "Safari"> <AXWindow: "YouTube - Hampe Recycling Werbung (Kino)"> <AXGroup> <AXScrollArea> <AXWebArea: "HTML-Inhalt"> <AXGroup: "Blocked Flash content"> ← mystery element I have to reference <AXGroup: "Blocked Flash content"> ← plug-in's element I should return the 'mystery' AXGroup as the plug-in's AXParent element to keep the accessibility hierarchy intact, but it doesn't seem to be returned by any convenient method. Instead I had to resort to looping through all elements on the page and some speculation, giving code like this to find the desired object: id value = nil; id webArea = [[[self superview] accessibilityAttributeValue:NSAccessibilityChildrenAttribute] objectAtIndex:0]; NSArray * webAreaChildren = [webArea accessibilityAttributeValue:NSAccessibilityChildrenAttribute]; CTFForEachObject( NSObject , child, webAreaChildren ) { // looping macro NSArray * subChildren = [child accessibilityAttributeValue:NSAccessibilityChildrenAttribute]; if ([subChildren count] == 1) { id firstSubChild = [[child accessibilityAttributeValue:NSAccessibilityChildrenAttribute] objectAtIndex:0]; if ( firstSubChild == self ) { value = child; break; } } } return value; This seems all of non-obvious, non-elegant and not particularly efficient to me. Perhaps WebKit could assist plug-ins a bit more in being good accessibility citizens and provide a method returning the relevant object.
Attachments
Mark Rowe (bdash)
Comment 1 2009-12-17 17:49:53 PST
Alexey Proskuryakov
Comment 2 2022-07-01 11:35:20 PDT
Mass closing plug-in bugs, as plug-in support has been removed from WebKit. Please comment and/or reopen if this still affects WebKit in some way.
Note You need to log in before you can comment on or make changes to this bug.