AX: An anchor element that has a click handler but no href should still be considered a link - #67035
Merged
Conversation
twilco
requested review from
AndresGonzalezApple,
fleizach and
minorninth
as code owners
June 12, 2026 02:45
Collaborator
|
EWS run on current version of this PR (hash db647b7) Details |
fleizach
approved these changes
Jun 12, 2026
…ll be considered a link https://bugs.webkit.org/show_bug.cgi?id=316929 rdar://179398579 Reviewed by Chris Fleizach. As a markup repair, Chrome and Firefox expose an <a> with a click handler but no href as a link. WebKit did not: Element::isLink() is only true for anchors with an href, so a hrefless anchor with an onclick handler fell through role determination to the generic Inline role and was ignored by the accessibility tree. With this commit, we implement this markup repair. * LayoutTests/accessibility/anchor-with-click-handler-is-link-expected.txt: Added. * LayoutTests/accessibility/anchor-with-click-handler-is-link.html: Added. * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::isClickEvent): (WebCore::AXObjectCache::onEventListenerAdded): (WebCore::AXObjectCache::onEventListenerRemoved): (WebCore::AXObjectCache::handleClickHandlerChanged): (WebCore::AXObjectCache::handleAttributeChange): * Source/WebCore/accessibility/AXObjectCache.h: * Source/WebCore/accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::determineAccessibilityRoleFromNode const): Canonical link: https://commits.webkit.org/315102@main
webkit-commit-queue
force-pushed
the
eng/AX-An-anchor-element-that-has-a-click-handler-but-no-href-should-still-be-considered-a-link
branch
from
June 12, 2026 15:33
db647b7 to
2387eef
Compare
Collaborator
|
Committed 315102@main (2387eef): https://commits.webkit.org/315102@main Reviewed commits have been landed. Closing PR #67035 and removing active labels. |
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
2387eef
db647b7
🧪 win-tests