[webkit-changes] [WebKit/WebKit] a8188f: Consider focusability even when tabs-to-links is e...

Ahmad Saleem noreply at github.com
Wed Dec 21 18:26:32 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a8188f2bba91c479e8fadfdc9bbdbeb3d1a0e3e1
      https://github.com/WebKit/WebKit/commit/a8188f2bba91c479e8fadfdc9bbdbeb3d1a0e3e1
  Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
  Date:   2022-12-21 (Wed, 21 Dec 2022)

  Changed paths:
    M LayoutTests/platform/ios/TestExpectations
    A LayoutTests/svg/custom/display-none-a-does-not-stop-focus-navigation-expected.txt
    A LayoutTests/svg/custom/display-none-a-does-not-stop-focus-navigation.html
    M Source/WebCore/svg/SVGAElement.cpp

  Log Message:
  -----------
  Consider focusability even when tabs-to-links is enabled for <svg:a>

Consider focusability even when tabs-to-links is enabled for <svg:a>
https://bugs.webkit.org/show_bug.cgi?id=249546

Reviewed by Aditya Keerthi.

Merge - https://chromium.googlesource.com/chromium/src.git/+/ad66827206bf24e41a4afa7dd7c3083157506c6c

SVGAElement::isKeyboardFocusable could end up returning 'true' even when
the element wasn't focusable (because it had "display: none" and hence
no renderer) because the value of the 'tabsToLinks' setting would be
returned without further checks. Because it wasn't focusable
setFocusedElement would not do anything, and focus would remain where it
was previously.
Make sure the focusable check is considered in this case. This makes the
SVGAElement version of this code look the same as the HTMLAnchorElement
version.

* Source/WebCore/svg/SVGAElement.cpp:
(SVGAElement::isKeyboardEvent): Update logic to ensure focus check is done and return accordingly
* LayoutTests/svg/custom/display-none-a-does-not-stop-focus-navigation.html: Add Test Case
* LayoutTests/svg/custom/display-none-a-does-not-stop-focus-navigation-expected.txt: Add Test Case Expectation
* LayoutTests/platform/ios/TestExpectations: Added test to skip on iOS since it does not support 'keyDown'

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




More information about the webkit-changes mailing list