Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing xlink:href attribute node from <use> element throws error #1901

Closed
m4w4q7 opened this issue Jan 17, 2019 · 7 comments
Closed

Removing xlink:href attribute node from <use> element throws error #1901

m4w4q7 opened this issue Jan 17, 2019 · 7 comments

Comments

@m4w4q7
Copy link

m4w4q7 commented Jan 17, 2019

Removing xlink:href attribute with removeAttributeNode from a <use> element throws an error with Hammerhead ("Uncaught DOMException: Failed to execute 'removeAttributeNode' on 'Element': The node provided is owned by another element." in Chrome and "NotFoundError: Node was not found" in Firefox) but works fine without proxy.

Here's a simple example:

<!DOCTYPE html>
<html>
  <head>
  </head>

  <body>

    <svg style="display: none" xmlns="http://www.w3.org/2000/svg">
      <defs>
        <g id="icon">
          <rect x="0" y="0" width="100" height="100"></rect>
        </g>
      </defs>
    </svg>

    <svg xmlns="http://www.w3.org/2000/svg">
      <use xlink:href="#icon"></use>
    </svg>

    <script>
      var use = document.querySelector('use');
      use.removeAttributeNode(use.attributes[0]);
    </script>

  </body>
</html>

You can check it here: https://m4w4q7.github.io/remove-attribute-node-bug-example
(an empty page without proxy and a black rectangle with console error when using proxy)

It also works if we use href instead of xlink:href, but Safari does not support it yet, so we can't change that.

This method of removing the attribute is used in recent versions of hyperHTML, and currently we can't use TestCafe with it.

@LavrovArtem
Copy link
Contributor

Thank you for the detailed description. I've reproduced the problem. Our team will research it and find a suitable solution.

@LavrovArtem LavrovArtem modified the milestones: Planned, Sprint #28 Feb 15, 2019
@LavrovArtem LavrovArtem assigned LavrovArtem and unassigned Farfurix Feb 25, 2019
@LavrovArtem LavrovArtem modified the milestones: Sprint #28, Sprint #29 Mar 13, 2019
@LavrovArtem LavrovArtem modified the milestones: Sprint #29, Sprint #30 Mar 21, 2019
@LavrovArtem LavrovArtem modified the milestones: Sprint #30, Sprint #31 Apr 2, 2019
@LavrovArtem LavrovArtem modified the milestones: Sprint #31, Sprint #32 Apr 22, 2019
@LavrovArtem LavrovArtem modified the milestones: Sprint #32, Sprint #33 May 14, 2019
@Farfurix Farfurix self-assigned this May 28, 2019
@LavrovArtem LavrovArtem modified the milestones: Sprint #33, Sprint #34 May 29, 2019
@LavrovArtem LavrovArtem modified the milestones: Sprint #34, Sprint #35 Jun 17, 2019
@LavrovArtem LavrovArtem modified the milestones: Sprint #35, Planned Jul 3, 2019
@JeremyCraigMartinez
Copy link

JeremyCraigMartinez commented Dec 26, 2019

Has there been any movement on this? Our team is seeing a similar issue

@Dmitry-Ostashev
Copy link
Collaborator

Currently we cannot provide any estimate on this.

@Farfurix Farfurix removed their assignment Feb 17, 2020
@LavrovArtem LavrovArtem removed this from the Planned milestone Feb 26, 2020
@LavrovArtem LavrovArtem removed their assignment Feb 26, 2020
@carolord999
Copy link

Hi, any news about this?

@AlexSkorkin
Copy link
Contributor

No news yet. Once we get any results, we will share them here.

@TrevorKarjanis
Copy link
Contributor

Support for HTMLElement.removeAttributeNode has been merged and released in testcafe-hammerhead@25.5.15. We're waiting for the root testcafe package to uptake the version before validation can be completed.

@miherlosev
Copy link
Contributor

Fixed in #2742

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants