Repository navigation
Conversation
Safari's Favorites bar hit-tests an icon-only bookmark to its favicon: an AXImage whose parent is the bar itself, not the bookmark's AXMenuButton. Walking up from the image never reaches a pressable control, so Auto Scroll started instead of the native middle click that opens the bookmark in a new tab. Bookmarks with a title and folders were unaffected, because the hit lands on the button. When the hit is an AXImage and its parent is not pressable either, look among the parent's children for a pressable control whose frame contains the point, and treat the hit as pressable when one does. The scan only runs for image hits, reads roles before frames, and is bounded to 128 children. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Thanks for tracking down the cause! Superseded by #1498, which fixes the same Favorites bar favicon hit with a bypass rule matching Safari's accessibility identifiers ( |
…d of starting Auto Scroll (#1498) With Auto Scroll on the middle button, middle-clicking the favicon of a bookmark in Safari's Favorites bar starts Auto Scroll instead of opening the bookmark in a new tab. Middle-clicking the bookmark's title works. ## Cause Safari's accessibility hit test for the icon returns an `AXImage` (`FaviconImageView`) whose parent is the Favorites bar group (`FavoritesBarView`), not the bookmark's `AXMenuButton`. The button is a sibling of the image, so walking up from the image never reaches a pressable control. ## Fix A new bypass rule, `safariFavoritesBarFavicon`, treats a direct hit on an `AXImage` with identifier `FaviconImageView` whose parent's identifier starts with `FavoritesBarView` as pressable. Bypass rules gain `identifier` and `parentIdentifierHasPrefix` conditions. The classifier reads `AXIdentifier` only for `AXImage` elements, and the parent's identifier only when the hit itself is an image with an identifier, so elements in web content cost at most one extra query. Compared with #1496, this matches the element Safari exposes instead of scanning siblings by geometry, so it does not query the children of images in web pages and does not change how images in other apps are classified. Supersedes #1496. ## Testing - New rule tests cover a match, a parent outside the Favorites bar, and a hit that is not direct. - Tested by hand in Safari: middle-clicking a Favorites bar icon opens the bookmark in a new tab; middle-clicking empty space in the bar and images in web pages still starts Auto Scroll. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: kzaoaai <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
With Auto Scroll on the middle button, middle-clicking an icon-only bookmark in Safari's Favorites bar starts Auto Scroll instead of opening the bookmark in a new tab. Bookmarks with a title and bookmark folders are not affected, and neither are links and tabs.
Cause
Safari's accessibility hit test for an icon-only bookmark returns its favicon: an
AXImagewhoseAXParentis the Favorites bar group, not the bookmark'sAXMenuButton. The button is a sibling of the image in the bar's children. Walking up from the image never reaches a pressable control, so the classifier reports the click as non-pressable. For a titled bookmark the hit lands on theAXMenuButtonitself, which is why those work.Seen with Safari 27.2 on macOS 27.2: the hit path was
AXImage -> AXGroup -> AXWindow/AXStandardWindow -> AXApplication, and the bar's children are oneAXMenuButtonper bookmark, each withAXPress.Fix
When the hit is an
AXImageand its parent is not pressable either, the classifier looks among the parent's children for a pressable control whose frame contains the point, and treats the click as pressable when it finds one. The scan only runs for image hits, reads each child's role before its frame, and stops after 128 children. Clicks in the gaps between bookmarks still start Auto Scroll, because the hit there is the bar itself.Testing
AXImage -> AXGroup -> child:AXMenuButton[press]. Titled bookmarks, tabs and links behave as before. Against the live Favorites bar (25 items) the extra scan took a few milliseconds.🤖 Generated with Claude Code