Skip to content

Preserve canonical DOM identity through SameObject getters - #141

Merged
FlorianRappl merged 3 commits into
AngleSharp:develfrom
EvotecIT:feature/dom-node-identity
Sep 22, 2026
Merged

FlorianRappl merged 3 commits into
AngleSharp:develfrom
EvotecIT:feature/dom-node-identity

Conversation

@PrzemyslawKlys

Copy link
Copy Markdown
Contributor

MutationRecord.target currently gets a new proxy projected as INode, losing the element API and the canonical wrapper used elsewhere. Reuse GetDomNode for node/window values returned by DomSameObject getters so the concrete prototype, strict identity and script-owned properties are preserved. Other SameObject values retain the existing cache.

Fixes #140.

The regression exposes an attribute mutation record to Jint and checks target.id, target === document.body, and an expando written through document.body. It fails on unmodified devel and passes with this fix.

This reusable binding defect was encountered by the public OfficeIMO HTML runtime. The patch has no OfficeIMO dependency and requires no downstream change or coordinated release to test.

Prerequisites

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project

Contribution type

  • Bug fix (non-breaking)
  • Added regression coverage
  • Added a pending changelog note
  • New and existing tests passed locally on .NET 10: 301 tests

netstandard2.0 build also passed with zero warnings/errors. Local validation used macOS arm64, SDK 10.0.303, AngleSharp 1.8.0 and Jint 4.15.3. Windows/Linux validation is left to the repository CI.

@CLAassistant

CLAassistant commented Sep 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread CHANGELOG.md Outdated

@FlorianRappl FlorianRappl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - we just need to put it into a 1.1.1 version

@FlorianRappl FlorianRappl added this to the v1.1.1 milestone Sep 22, 2026
@FlorianRappl
FlorianRappl merged commit bf03621 into AngleSharp:devel Sep 22, 2026
5 checks passed
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.

MutationRecord.target loses concrete node API through SameObject

3 participants