Skip to content

Remove SVGElementInstance (correspondingElement / correspondingUseElement) #1070

Closed

Description

Activity

  1. karlcow commented on Mar 4, 2026

    @karlcow
    MemberAuthor

    How should this be used?
    to note that the spec mentions:

    When the referenced element is in an external file, the presence of this pointer implies that the entire DOM of the external file must be maintained in memory. However, as currently specified, the external DOM is read-only. It therefore offers limited functionality and a potentially large performance impact. Pending feedback from implementers, authors should consider the use of correspondingElement with external file references to be at-risk.

  2. changed the title [-]Remove correspondingElement and correspondingUseElement from SVGElement[/-] [+]Remove/Better testing correspondingElement and correspondingUseElement from SVGElement[/+] on Mar 5, 2026
  3. karlcow commented on Mar 18, 2026

    @karlcow
    MemberAuthor

    Using this testcase
    correspondingElement-test.html

    • Green "does NOT exist" = browser doesn't implement it (safe to remove)
    • Red "EXISTS" = browser still exposes it

    None of the browsers exposes it. This is safe to remove.

  4. karlcow commented on Mar 18, 2026

    @karlcow
    MemberAuthor
    Image
  5. karlcow commented on Mar 18, 2026

    @karlcow
    MemberAuthor

    This basically would mean to remove SVGElementInstance altogether. I should probably rephrase the title of this issue.

      interface mixin SVGElementInstance {                                                                                                                                                   
        [SameObject] readonly attribute SVGElement? correspondingElement;                                                                                                                    
        [SameObject] readonly attribute SVGUseElement? correspondingUseElement;                                                                                                              
      };
    

    Which is already not supported by all browsers.

    SVGElementInstance-exposure-test.html

    Image
  6. changed the title [-]Remove/Better testing correspondingElement and correspondingUseElement from SVGElement[/-] [+]Remove SVGElementInstance (correspondingElement / correspondingUseElement)[/+] on Mar 18, 2026
  7. karlcow commented on Mar 18, 2026

    @karlcow
    MemberAuthor

    Third test to make it extra-sure.
    correspondingElement-interface-test.html

    Image
  8. karlcow commented on Mar 18, 2026

    @karlcow
    MemberAuthor

    on WebKit

    https://searchfox.org/wubkat/rev/0dbabc018f3f222e0b93def93bccb3342f707ff6/Source/WebCore/svg/SVGElement.cpp#326-334

    SVGUseElement* SVGElement::correspondingUseElement() const
    {
        SUPPRESS_UNCOUNTED_LOCAL auto* root = containingShadowRoot();
        if (!root)
            return nullptr;
        if (root->mode() != ShadowRootMode::UserAgent)
            return nullptr;
        return dynamicDowncast<SVGUseElement>(root->host());
    }

    on Gecko, not implemented.
    https://searchfox.org/firefox-main/search?q=correspondingUseElement&path=svg&case=false&regexp=false

    On Chromium, not implemented
    https://source.chromium.org/search?q=correspondingUseElement&ss=chromium

  9. added a commit that references this issue on Mar 18, 2026
    e795401
  10. karlcow commented on Mar 18, 2026

    @karlcow
    MemberAuthor

    I prepared the PR for it
    #1076
    Let's merge or close depending on what we want to do with it.

    I'll take care of WPT too.

  11. karlcow commented on Mar 19, 2026

    @karlcow
    MemberAuthor

    https://www.w3.org/2026/03/19-svg-minutes.html#8e49
    RESOLUTION: Remove SVGElementInstance from SVG2
    ACTION: karlcow to update WPT

  12. karlcow commented on Apr 7, 2026

    @karlcow
    MemberAuthor

    See Also #440

  13. karlcow commented on Apr 7, 2026

    @karlcow
    MemberAuthor

    Tests almost removed.
    web-platform-tests/wpt#59015

  14. added 2 commits that reference this issue on Apr 22, 2026
    6666b0b
    c612d92
  15. karlcow commented on Apr 23, 2026

    @karlcow
    MemberAuthor

    I need review on the prose change for this.
    I also added a graph so that people have a better understanding of the definitions.

    Image
  16. karlcow commented on Apr 23, 2026

    @karlcow
    MemberAuthor

    The PR is at #1076

  17. added a commit that references this issue on Apr 23, 2026
    392aee1
  18. added a commit that references this issue on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions