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

Add support for HTMLElement.removeAttributeNode. #2742

Merged
merged 2 commits into from Feb 18, 2022

Conversation

TrevorKarjanis
Copy link
Contributor

@TrevorKarjanis TrevorKarjanis commented Feb 15, 2022

Purpose

HTMLElement.attributes returns an attributes wrapper that clones stored attribute nodes. Iterating over the attributes and passing a cloned attribute to HTMLElement.removeAttributeNode results in an exception that fails tests.

Approach

Add support for HTMLElement.removeAttributeNode that reuses the removeAttributeCore implementation and supports namespaced attributes. Base attribute node and removeAttributeNode usage on the DOM living standard. Attempt to remove stored nodes, but continue not to the throw. Pass the attribute from the native attributes list to the native removeAttributeNode, and allow the call to refreshAttributesWrapper to remove it or the clone from the wrapper. Add string representation and method unit tests, and base them on the existing tests for removeAttribute. Native function argument DOM tests don't apply. Make a concerted effort to match existing code style.

References

Pre-Merge TODO

  • Write tests for your proposed changes
  • Make sure that existing tests do not fail

@miherlosev
Copy link
Contributor

Hi @TrevorKarjanis

Thank you for your contribution to TestCafe. We will review this PR.

@miherlosev miherlosev self-requested a review February 16, 2022 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants