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
#988@patch: Fix labels attribute with no IDs. #989
Conversation
Refactor duplicate labels logic. I've only updated tests for HTMLInputElement but would be happy to update other tests if this approach seems reasonable.
? const {Window} = require('happy-dom'); const window = new Window({ |
@2516455367 , I'm not sure why you shared that code snippet here. |
Hello, I apologize for taking so long to reply.The issue I mentioned in my last email is the following code, which cannot add an ID and then retrieve and print its elements, which is feasible in a real browser or JSdom. The code is as follows.Thanks you!
const {Window} = require('happy-dom');
const window = new Window({
url: " https://www.example.com "
});
document = window.document
document.write( <!DOCTYPE html><html><head><meta charset="UTF-8"><title></title></head><body></body></html>)
var id = Math.floor(Math.random() * 100000000)
console.log(id)
var span = document.createElement('span')
console.log(span.setAttribute)
console.log(span.removeAttribute)
console.log(span.removeChild)
span.setAttribute('id', id)
document.body.appendChild(span)
var ele = document.getElementById(id)
console.log(ele)
…---Original---
From: "Josh ***@***.***>
Date: Fri, Jul 21, 2023 22:31 PM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [capricorn86/happy-dom] ***@***.***: Fix labels attribute with noIDs. (PR #989)
@2516455367 , I'm not sure why you shared that code snippet here.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution @joshkel! 🌟
I made some fixes to the code, so that is better follows the code standard of the rest of the code in Happy DOM.
@2516455367 I believe I fixed your issue as well. If not, please open a new ticket.
Refactor duplicate labels logic. I've only updated tests for HTMLInputElement but would be happy to update other tests if this approach seems reasonable.
Fixes #988.