Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7c509707e29d40a0e194ac5fe89f796da4f05e7a
      
https://github.com/WebKit/WebKit/commit/7c509707e29d40a0e194ac5fe89f796da4f05e7a
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-09-03 (Thu, 03 Sep 2026)

  Changed paths:
    M Source/WebCore/html/HTMLAnchorElement.cpp
    M Source/WebCore/svg/SVGAElement.cpp

  Log Message:
  -----------
  Add early-return to `SVGAElement::isKeyboardFocusable` and drop redundant 
`isFocusable()` checks
https://bugs.webkit.org/show_bug.cgi?id=281540
rdar://138005652

Reviewed by Chris Dumez.

This adds an early return when the element is not focusable in
'SVGAElement::isKeyboardFocusable', matching 
'HTMLAnchorElement::isKeyboardFocusable',
and then removes the now-redundant 'isFocusable()' from the following condition 
in
both functions, since it is already guaranteed by the early return above it.

This is not a change in behavior. 'Element::isKeyboardFocusable', which both of 
these
override and call through to, already returns false when 'isFocusable()' is 
false, and
the two intermediate early returns ('!frame' and 'isLink() && !tabsToLinks()') 
return
false as well, so every path already returned false for a non-focusable 
element. The
early return just avoids the frame lookup and the 'tabsToLinks()' query, 
neither of
which has an observable side effect. No new tests, since no behavior change is
observable from content.

* Source/WebCore/html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isKeyboardFocusable const):
* Source/WebCore/svg/SVGAElement.cpp:
(WebCore::SVGAElement::isKeyboardFocusable const):

Canonical link: https://commits.webkit.org/320478@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to