In this HTML spec PR, we are making <details> automatically expand for element fragments and find-in-page: https://github.com/whatwg/html/pull/6466 This way, the user can effectively use find-in-page to search for content hidden inside <details> elements without having to manually expand all of them first. In order to make it performant, the spec PR also suggests using content-visibility:hidden inside <details>'s user agent shadowdom instead of "removing the slot from the rendering" when <details> are closed.
<rdar://problem/81856620>
Pull request: https://github.com/WebKit/WebKit/pull/18785
Whoever works on this feature, please work with WebKit Accessibility DRIs to make sure it works with accessibility, such as VoiceOver navigation by heading (VO+Cmd+H), where heading is in a collapsed section. Or VoiceOver Find (VO+F)
(In reply to James Craig from comment #3) > Whoever works on this feature, please work with WebKit Accessibility DRIs to > make sure it works with accessibility, such as VoiceOver navigation by > heading (VO+Cmd+H), where heading is in a collapsed section. Or VoiceOver > Find (VO+F) I have a PR ready for review at https://github.com/WebKit/WebKit/pull/18785. It doesn’t yet include any accessibility tests, and I’ve not yet done any manual testing of it myself with VoiceOver, but I’d love to get some guidance and review.
(In reply to sideshowbarker from comment #4) > (In reply to James Craig from comment #3) > > Whoever works on this feature, please work with WebKit Accessibility DRIs to > > make sure it works with accessibility, such as VoiceOver navigation by > > heading (VO+Cmd+H), where heading is in a collapsed section. Or VoiceOver > > Find (VO+F) > > I have a PR ready for review at https://github.com/WebKit/WebKit/pull/18785. > It doesn’t yet include any accessibility tests, and I’ve not yet done any > manual testing of it myself with VoiceOver, but I’d love to get some > guidance and review. VO-Cmd-H (find next heading) works via Accessibility::findMatchingObjects, which traverses the AX tree to try and find objects that match the given search key. AccessibilitySearchKey::Heading is one of many such keys. VO-F works similarly, searching the AX tree for the target AccessibilitySearchCriteria::searchText and comparing it against several different types of accessibility text. Unfortunately, I don't think either will "just work" as the contents of collapsed details elements are not part of the AX tree (because they are not rendered, inherently excluding them). So we’ll need to do something special here. Maybe we need to compute “collapsed descendants” for closed details element AX objects, which includes AX objects ignored only due to their lack of visibility / rendering. This collapsed descendants function would return early if the object’s role is not details, or if it is expanded. Then we update `findMatchingObjects` to check an object’s collapsed descendants for matches. If a collapsed descendant is found to be a match, we’ll need to call `AXCoreObject::setIsExpanded(true)` on the containing details. But this is pretty complicated, maybe there is some simpler solution here...not sure.