-
-
Notifications
You must be signed in to change notification settings - Fork 8
Feat/is equal node #141
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/is equal node #141
Conversation
|
Warning Rate limit exceeded@stroiman has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 10 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (5)
WalkthroughAdds node equality support across the DOM types: a new IsEqualNode(Node) bool method is declared on the Node interface and implemented on the concrete node, element, and characterData types. An internal helper isEqualNode performs recursive/type-specific comparisons. The code-generation config no longer ignores isEqualNode, and the scripting layer gains a generated binding to expose the method to JS via isEqualNode on the Node prototype. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes Areas requiring extra attention:
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
dom/character_data.go(1 hunks)dom/element.go(3 hunks)dom/node.go(2 hunks)internal/code-gen/scripting/configuration/dom_configuration.go(0 hunks)scripting/internal/dom/node_generated.go(2 hunks)
💤 Files with no reviewable changes (1)
- internal/code-gen/scripting/configuration/dom_configuration.go
🧰 Additional context used
🧬 Code graph analysis (4)
scripting/internal/dom/node_generated.go (5)
dom/node.go (1)
Node(141-193)scripting/internal/js/script_abstractions.go (1)
As(8-23)scripting/internal/js/arguments.go (1)
ConsumeArgument(19-40)scripting/internal/codec/decoders.go (2)
ZeroValue(12-12)DecodeNode(26-36)scripting/internal/codec/encoders.go (1)
EncodeBoolean(37-39)
dom/element.go (1)
dom/node.go (1)
Node(141-193)
dom/character_data.go (2)
dom/node.go (1)
Node(141-193)scripting/internal/dom/character_data_generated.go (1)
CharacterData(12-15)
dom/node.go (1)
scripting/internal/dom/node_generated.go (1)
Node(12-12)
🔇 Additional comments (6)
dom/character_data.go (1)
53-58: LGTM!The implementation correctly checks CharacterData-specific equality (data comparison) and delegates to the base node equality check.
dom/element.go (3)
43-43: LGTM!Adding
Namespace()to the Element interface is necessary for namespace-aware equality comparisons.
128-128: LGTM!Simple getter implementation correctly exposes the namespace field.
79-99: LGTM!The implementation correctly extends the base node equality check with Element-specific comparisons: attributes, tagName, and namespace.
scripting/internal/dom/node_generated.go (1)
25-25: LGTM!The generated binding correctly follows the established pattern for Node prototype methods and properly marshals arguments and return values.
Also applies to: 77-89
dom/node.go (1)
168-168: LGTM!Adding
IsEqualNode(Node) boolto the Node interface aligns with the DOM specification and completes the public API for node equality checks.
b6e6d71 to
a077c59
Compare
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
dom/character_data.go(1 hunks)dom/element.go(3 hunks)dom/node.go(2 hunks)internal/code-gen/scripting/configuration/dom_configuration.go(0 hunks)scripting/internal/dom/node_generated.go(2 hunks)
💤 Files with no reviewable changes (1)
- internal/code-gen/scripting/configuration/dom_configuration.go
🧰 Additional context used
🧬 Code graph analysis (4)
dom/character_data.go (2)
dom/node.go (1)
Node(141-193)scripting/internal/dom/character_data_generated.go (1)
CharacterData(12-15)
dom/element.go (1)
dom/node.go (1)
Node(141-193)
dom/node.go (1)
scripting/internal/dom/node_generated.go (1)
Node(12-12)
scripting/internal/dom/node_generated.go (5)
dom/node.go (1)
Node(141-193)scripting/internal/js/script_abstractions.go (1)
As(8-23)scripting/internal/js/arguments.go (1)
ConsumeArgument(19-40)scripting/internal/codec/decoders.go (1)
DecodeNode(26-36)scripting/internal/codec/encoders.go (1)
EncodeBoolean(37-39)
🔇 Additional comments (4)
dom/character_data.go (1)
53-58: LGTM! Well-structured equality implementation.The IsEqualNode method correctly performs type-specific comparison (character data content) before delegating to the base node comparison logic for recursive child checks.
scripting/internal/dom/node_generated.go (1)
25-25: LGTM! Generated binding follows established patterns.The isEqualNode method registration and implementation correctly follow the same pattern as other Node methods, with proper argument decoding and result encoding.
Also applies to: 77-89
dom/node.go (1)
264-264: LGTM! Critical issues from previous review have been resolved.Both the infinite recursion bug (line 264 now correctly calls
isEqualNodeinstead ofIsEqualNode) and the indexing bug (line 274 now correctly usesItem(i)instead ofItem(0)) have been fixed. The implementation now correctly performs recursive node equality comparison.Also applies to: 266-279
dom/element.go (1)
43-43: LGTM! Clean namespace accessor.The Namespace() method correctly exposes the element's namespace property.
Also applies to: 128-128
a077c59 to
9879ca3
Compare
Not all DOM features affected by the rules are implemented
9879ca3 to
a119013
Compare
Implements
Node.isEqualNodein the DOM