[webkit-changes] [WebKit/WebKit] 351891: Consider HTMLAnchorElements with no href but click...

Etienne Segonzac noreply at github.com
Fri Aug 25 01:19:02 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 351891573781afb9625e9cf767eb2331053968a8
      https://github.com/WebKit/WebKit/commit/351891573781afb9625e9cf767eb2331053968a8
  Author: Etienne Segonzac <sgz at apple.com>
  Date:   2023-08-25 (Fri, 25 Aug 2023)

  Changed paths:
    M LayoutTests/interaction-region/inline-link-expected.txt
    M LayoutTests/interaction-region/inline-link.html
    M Source/WebCore/page/InteractionRegion.cpp

  Log Message:
  -----------
  Consider HTMLAnchorElements with no href but click event listeners for Interaction Regions
https://bugs.webkit.org/show_bug.cgi?id=260657
<rdar://114215168>

Reviewed by Tim Horton.

HTMLAnchorElements with no `href` don't have the `isLink` flag set. But
we're sitll seeing instances of `<a onclick="...">`.
Since we already have the `EventListenerRegionType::MouseClick` check,
add HTMLAnchorElement to the list of elements that get
InteractionRegions even without `cursor: pointer`.

* Source/WebCore/page/InteractionRegion.cpp:
(WebCore::shouldAllowNonPointerCursorForElement):
Add HTMLAnchorElement to the list.

* LayoutTests/interaction-region/inline-link-expected.txt:
* LayoutTests/interaction-region/inline-link.html:
Update the test to cover the "onclick-only" scenario and the scenario
where a link has neither a href nor a click event listener (and doesn't
get a region).

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




More information about the webkit-changes mailing list