https://www.w3.org/TR/wai-aria-1.1/#aria-modal "If focus moves to an element outside the modal element, assistive technologies SHOULD NOT limit navigation to the modal element." We don't follow this recommendation, and we should.
<rdar://problem/101209793>
Created attachment 463012 [details] Patch
Created attachment 463013 [details] Patch
Comment on attachment 463013 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=463013&action=review > Source/WebCore/accessibility/AXObjectCache.h:515 > + enum class WillRecomputeFocus : bool { No, Yes }; "RecomputeFocus" seems like might be enough > Source/WebCore/accessibility/AXObjectCache.h:517 > + Element* updateCurrentModalNodeInternal(WillRecomputeFocus = WillRecomputeFocus::No); both of these are private methods. can they be combined? or renamed to be more specific?
Created attachment 463039 [details] Patch
(In reply to chris fleizach from comment #4) > Comment on attachment 463013 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=463013&action=review > > > Source/WebCore/accessibility/AXObjectCache.h:515 > > + enum class WillRecomputeFocus : bool { No, Yes }; > > "RecomputeFocus" seems like might be enough I chose "WillRecomputeFocus" here because updateCurrentModalNodeInternal needs to know if the calling code knows we will recompute the focus through some other means (e.g. via our modal auto-focusing mechanism). It needs to know this because if the calling context will not recompute focus, and the focused element is outside our modals, we must invalidate modality per-spec. I feel like "RecomputeFocus" doesn't capture this intent the same way "WillRecomputeFocus" does, but if you feel strongly about RecomputeFocus or some other alternative I'd be willing to make the change. > > Source/WebCore/accessibility/AXObjectCache.h:517 > > + Element* updateCurrentModalNodeInternal(WillRecomputeFocus = WillRecomputeFocus::No); > > both of these are private methods. can they be combined? or renamed to be > more specific? Fixed by inlining updateCurrentModalNodeInternal into a lambda within updateCurrentModalNode.
Committed 255665@main (b6eab27a3f8d): <https://commits.webkit.org/255665@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 463039 [details].