[Webkit-unassigned] [Bug 279265] New: Support `referrerPolicy` for SVG <a> element

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 6 07:20:01 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=279265

            Bug ID: 279265
           Summary: Support `referrerPolicy` for SVG <a> element
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Keywords: WPTImpact
          Severity: Normal
          Priority: P2
         Component: DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ahmad.saleem792 at gmail.com
                CC: annevk at annevk.nl, karlcow at apple.com,
                    sabouhallawa at apple.com

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!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240906/eb3066d8/attachment.htm>


More information about the webkit-unassigned mailing list