-
Notifications
You must be signed in to change notification settings - Fork 166
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
feat: insert before method element deno dom #76
Conversation
} else { | ||
for (let i = 0; i < this.childNodes.length; i++) { | ||
//TODO: use deep equal or something | ||
if (this.childNodes[i] === existingNode) { |
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.
What would be the best way to see if they are equal because ===
won't work?
if (!existingNode) { | ||
return this.appendChild(newNode); | ||
} else { | ||
for (let i = 0; i < this.childNodes.length; i++) { |
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.
I haven't used for
loops in such a long time I feel like it isn't looping fully over the this.childNodes
, correct me if I am wrong.
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.
You're doubting me, but I really think it's right.
@@ -370,4 +370,30 @@ export class Element extends Node { | |||
} | |||
return null | |||
} | |||
|
|||
insertBefore(newNode: Node, existingNode: Node | null) { |
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.
Not ready for merge yet, insertBefore
is a Node
method so I will move it shortly.
@shadowtime2000 , I'm trying to remove the |
good point, closing this PR then. |
Partially resolves #75, implements
insertBefore
in theElement
class for SSR.