Skip to content

Add resolveProperty callback option#314

Draft
domenic wants to merge 1 commit intomainfrom
resolve-property-callback
Draft

Add resolveProperty callback option#314
domenic wants to merge 1 commit intomainfrom
resolve-property-callback

Conversation

@domenic
Copy link
Member

@domenic domenic commented Feb 25, 2026

Adds a resolveProperty constructor option that allows the caller to lazily resolve property values. This is a companion to jsdom/jsdom#4085.

When resolveProperty is provided and the declaration is readonly, getPropertyValue() calls the callback on cache miss before falling back to _values. This means all property getters (.fontFamily, .color, etc.) that route through getPropertyValue() automatically benefit from lazy resolution.

@asamuzaK — this is just a draft for discussion, not meant to be merged as-is. We haven't been able to run the full WPT suite locally to validate it. It's meant as an illustration of an alternative approach to the eager resolution in jsdom/jsdom#4079. Would appreciate your thoughts on whether something like this could work, or if you see issues with the approach.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant