Bug 279265

Summary: Support `referrerPolicy` for SVG <a> element
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: annevk, karlcow, sabouhallawa, webkit-bug-importer
Priority: P2 Keywords: InRadar, WPTImpact
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Ahmad Saleem
Reported 2024-09-06 07:20:01 PDT
Hi Team, While looking into failing SVG idlharness tests, I noticed that we fail `referrerpolicy` related tests, I don't know is it easy to fix or not but this does make us pass tests: WPT Test Case: http://wpt.live/svg/idlharness.window.html > SVGAElement interface: objects.a must inherit property "referrerPolicy" with the proper type > SVGAElement interface: attribute referrerPolicy Progress after below and only Firefox has support for it so far: In `SVGAElement.idl`: [CEReactions=NotNeeded, ImplementedAs=referrerPolicyForBindings] attribute [AtomString] DOMString referrerPolicy; In `SVGAElement.h`: void setReferrerPolicyForBindings(const AtomString&); String referrerPolicyForBindings() const; ReferrerPolicy referrerPolicy() const; In `SVGAElement.cpp`: void SVGAElement::setReferrerPolicyForBindings(const AtomString& value) { setAttributeWithoutSynchronization(HTMLNames::referrerpolicyAttr, value); } String SVGAElement::referrerPolicyForBindings() const { return referrerPolicyToString(referrerPolicy()); } ReferrerPolicy SVGAElement::referrerPolicy() const { return parseReferrerPolicy(attributeWithoutSynchronization(HTMLNames::referrerpolicyAttr), ReferrerPolicySource::ReferrerPolicyAttribute).value_or(ReferrerPolicy::EmptyString); } ___ Above does not add logic around `handleClick`, which is in HTMLAnchorElemnet.cpp and I also leverage `HTMLNames` similar in feedback from Anne in leveraging as much as `HTMLNames` rather than reintroducing same thing in SVGNames. Just raising to get feedback and input. Thanks!
Attachments
Radar WebKit Bug Importer
Comment 1 2024-09-13 07:20:14 PDT
Note You need to log in before you can comment on or make changes to this bug.