Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8e7fad56aa4971c6ba1417fbcd7d166bd0e6097b
      
https://github.com/WebKit/WebKit/commit/8e7fad56aa4971c6ba1417fbcd7d166bd0e6097b
  Author: tannal <[email protected]>
  Date:   2026-09-22 (Tue, 22 Sep 2026)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/dom/KeyboardEvent.cpp
    M Source/WebCore/dom/KeyboardEvent.h
    A Source/WebCore/html/AnchorElementFunctions.cpp
    A Source/WebCore/html/AnchorElementFunctions.h
    M Source/WebCore/html/HTMLAnchorElement.cpp
    M Source/WebCore/html/HTMLAnchorElement.h
    M Source/WebCore/html/HTMLFormElement.cpp
    M Source/WebCore/mathml/MathMLElement.cpp
    M Source/WebCore/svg/SVGAElement.cpp

  Log Message:
  -----------
  [Refactor] Extract common anchor element logic into AnchorElementFunctions
https://bugs.webkit.org/show_bug.cgi?id=324146

Reviewed by Anne van Kesteren.

Factored out common hyperlink behavior (rel attributes parsing, ping sending,
download attribute sanitization, and hyperlink navigation) from 
HTMLAnchorElement
and SVGAElement into free functions in `AnchorElementFunctions`.

Also exposed `KeyboardEvent::isEnterKeyKeydownEvent` for reuse.

No behavior change, in preparation for supporting the MathMLAnchorElement IDL. 
[1]

[1] https://github.com/WebKit/WebKit/pull/71827

* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::isEnterKeyKeydownEvent):
* Source/WebCore/dom/KeyboardEvent.h:
* Source/WebCore/html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::defaultEventHandler):
(WebCore::HTMLAnchorElement::setActive):
(WebCore::HTMLAnchorElement::attributeChanged):
(WebCore::HTMLAnchorElement::relList):
(WebCore::HTMLAnchorElement::isSystemPreviewLink):
(WebCore::HTMLAnchorElement::sendPings): Deleted.
* Source/WebCore/html/HTMLAnchorElement.h:
* Source/WebCore/mathml/MathMLElement.cpp:
(WebCore::MathMLElement::defaultEventHandler):
* Source/WebCore/svg/SVGAElement.cpp:
(WebCore::SVGAElement::attributeChanged):
(WebCore::SVGAElement::defaultEventHandler):
(WebCore::SVGAElement::relList):
* Source/WebCore/html/AnchorElementFunctions.cpp: Added.
(WebCore::AnchorElementFunctions::relationsForRelAttribute):
(WebCore::AnchorElementFunctions::isSupportedRelToken):
(WebCore::AnchorElementFunctions::hasRel):
(WebCore::AnchorElementFunctions::parseDownloadAttribute):
(WebCore::AnchorElementFunctions::sendPings):
(WebCore::AnchorElementFunctions::effectiveReferrerPolicy):
(WebCore::AnchorElementFunctions::navigateHyperlink):
(WebCore::relationsForRelAttribute):
(WebCore::isSupportedRelToken):
(WebCore::hasRel):
(WebCore::parseDownloadAttribute):
(WebCore::sendPings):
(WebCore::effectiveReferrerPolicy):
(WebCore::navigateHyperlink):
* Source/WebCore/html/AnchorElementFunctions.h: Added.
(WebCore::AnchorElementFunctions::navigateHyperlink):
(WebCore::navigateHyperlink):
* Source/WebCore/html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::namedElements):

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



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

Reply via email to